Atlaslog
Atlaslog / Field Notes / Coordinates & projections
Field note · Coordinates & projections

GeoJSON without a CRS: 3857 metres read as degrees

Quick answer

A GeoJSON exported straight from EPSG:3857 geometry holds metre coordinates but no usable CRS declaration. RFC 7946 removed the crs member and every parser assumes degrees, so nothing renders.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: Leaflet 1.9.x · Mapbox GL JS 2.15 · GeoServer 2.23
Symptom
Checklist
  1. Read the first coordinate pair and check magnitude; an absolute value above 180 is not a degree.
  2. Look for a top-level crs member, but note that Leaflet 1.x and Mapbox GL ignore it.
  3. Compute the bbox: x 7.3e6~1.5e7 and y 2.4e6~6.1e6 match China in EPSG:3857.
  4. Trace back to the export SQL and check whether ST_Transform(geom, 4326) was applied.
  5. If the export cannot be changed, reproject before constructing L.geoJSON, not inside coordsToLatLng.
Fix

Fix it at the source: serialize with ST_AsGeoJSON(ST_Transform(geom, 4326)); on the client, walk the coordinates with proj4('EPSG:3857','EPSG:4326', xy) before calling L.geoJSON.

Code
const c = fc.features[0].geometry.coordinates;
const is4326 = Math.abs(c[0]) <= 180 && Math.abs(c[1]) <= 90;
console.log(is4326 ? '经纬度' : '投影坐标,量级 ' + c[0].toExponential(2));
// 13522390.4 -> "投影坐标,量级 1.35e+7"
-- PostGIS:导出前必须转换
SELECT jsonb_build_object(
  'type', 'FeatureCollection',
  'features', jsonb_agg(ST_AsGeoJSON(t, 15)::jsonb)
)
FROM (
  SELECT id, name, ST_Transform(geom, 4326) AS geom FROM districts
) AS t;
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). GeoJSON without a CRS: 3857 metres read as degrees. https://www.jingweizhi.com/en/cookbook/geojson-no-crs.html (accessed 2026-11-03).