Created
October 26, 2012 21:55
-
-
Save andrewxhill/3961805 to your computer and use it in GitHub Desktop.
parenthesis enclosed NYC open data lat/lon to the_geom
This file contains hidden or 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
| --replace table_1 with your table name | |
| --replace both instances of column_name with your column, often it is called 'shape' | |
| UPDATE | |
| table_1 | |
| SET | |
| the_geom = ST_SetSRID( | |
| ST_MakePoint( | |
| (string_to_array( | |
| replace( | |
| replace(column_name,'(',''), | |
| ')','' | |
| ), | |
| ',' | |
| ))[2]::float, | |
| (string_to_array(replace(replace(column_name,'(',''),')',''),','))[1]::float),4326) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment