SRID 4326 and Longitude/Latitude Order: The Practical Guide

When a geometry lands in the ocean, the data is often valid but expressed in the wrong coordinate reference system or coordinate order. For browser maps, the safe working output is normally EPSG:4326 with coordinates written as longitude, latitude: X first, Y second.

Longitude comes first in GeoJSON and WKT

-- Lima: longitude (X), then latitude (Y)
POINT (-77.0428 -12.0464)

Latitude values range from -90 to 90; longitude ranges from -180 to 180. If both values fall inside -90 to 90, a swap can still look technically valid, so verify the intended place instead of relying on parser errors.

Check and transform the SRID in PostGIS

SELECT ST_SRID(geom), ST_AsText(geom) FROM parcels LIMIT 1;

-- Transform projected data before exporting it for a web map
SELECT ST_AsText(ST_Transform(geom, 4326)) FROM parcels;

-- Do not use ST_SetSRID as a substitute for transforming coordinates
Rule of thumb: ST_SetSRID labels coordinates; ST_Transform converts them. Labelling Web Mercator metres as 4326 degrees produces incorrect data.

Verify the result visually

Paste the transformed output into the free WKT viewer. Once it is in the right place, save it with Google to keep a shareable project, or use Pro spatial tools when you need repeatable analysis.

Keep reading