Last active
August 2, 2016 06:12
-
-
Save rbanick/1810588a089dd835f554d5c0737b6f2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- You update the SRID for your table first. Then you reverse that update within a SQL query so you can transform the actual coordinates to their new EPSG. | |
-- Otherwise you'll have Lat/Long coordinates for a metric projection or vice-versa. | |
SELECT Updategeometry_columnetrySRID('table','geometry_column',new_EPSG); | |
ALTER TABLE table | |
ALTER COLUMN geometry_column TYPE geometry(geometry_type,new_EPSG) USING ST_Transform(ST_SetSRID(geometry_column,old_EPSG),new_EPSG); | |
SELECT ST_AsText(geometry_column) FROM table; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment