Gist 96068363e74b4c1c148c55aad9ab0cf4
✓ Published0🌍 Public
TThomasG77
Last edited Dec 19, 2024
Created on Dec 19, 2024
This example demonstrates client-side reprojection of GeoJSON geometries from a source CRS to WGS84 using the Proj4js library. It fetches a French “quartiers prioritaires” dataset encoded in EPSG:2154 and transforms its Point, LineString, Polygon, and Multi* geometries via custom functions that recursively map coordinates through a proj4 transformer. It also tests a second transformation from EPSG:4326 to EPSG:3857 on sample geometries, logging converted coordinates to the console. The code relies on proj4.defs, proj4(...).forward, and the fetch API.
AI-generated description