This content applies to a previous version of CARTO
In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com
Back to Help Center
How to Convert UTM Coordinates to Lat/Long Values
To convert UTM X/Y values into latitude/longitude coordinates, you need to know the SRID (Spatial Reference System Identifier) of your dataset. This identifier is essential for properly transforming your geographic data.
Solution
Use a combination of PostGIS functions to perform the conversion. The approach leverages three key functions: ST_Transform, ST_SetSRID, and ST_MakePoint.
Here’s the query structure (using SRID 25831 as an example):
UPDATE table_name
SET the_geom =
ST_Transform(
ST_SetSRID(
ST_MakePoint(x, y),
25831
),
4326
)
How it works:
ST_MakePoint(x, y)creates a point geometry from your UTM coordinatesST_SetSRID(..., 25831)assigns your dataset’s SRID to the pointST_Transform(..., 4326)converts the point to standard latitude/longitude (SRID 4326)
The key is identifying your dataset’s correct SRID before executing the transformation query.
