on-internet
← Community

Why doesn't my AI generated GeoJSON to SVG conversion code work as a Stack Snippet? [closed]

Stack Overflow ·

My code converts GeoJSON to SVG and should run on this page. It's generated using OpenAI's ChatGPT (version Mar 14, 2023) to let the user click a button to download the SVG code but it does not work here, why? /* Steps: 1. parse GeoJSON 2. convert lon/lat -> Web Mercator (x, y) in meters 3. compute bbox of projected coords 4. compute uniform scale and translate to fit viewport with padding 5. build SVG path string and insert into container */ function lonLatToWebMercator(lon, lat) { // returns {x, y} in meters (EPSG:3857) const R = 6378137; const x = R * lon * Math.PI / 180; const latRad = lat

Comments

Sign in or sign up to comment and upvote.

No comments yet.