Search code examples
pythonpostgisprojection

EPSG:900913 to WGS 84 projection


I currently have a postgis database which uses a EPSG:900913 projection, how can I convert this to WGS 84, which I believe is the format used by Google Maps and OSM.

The DB was made with osm2pgsql, and I would like to be able to project the coordinates in python or by postgis.

Thanks for your time.


Solution

  • Just transform your geometries using ST_Transform (https://postgis.net/docs/ST_Transform.html)

     ST_Transform(geom,4326)
    

    If you want to transfrom a whole table do:

     UPDATE table_name SET geom_column = ST_Transform(geom_column,4326)