Created
August 9, 2018 03:28
-
-
Save statguy/54d459c2a21d64dfaa9008434b744871 to your computer and use it in GitHub Desktop.
Inserting data to geometry column in PostGIS directly, enforcing SRID
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
DROP TABLE IF EXISTS temp; | |
CREATE TABLE temp ( | |
id INT, | |
geom GEOMETRY(POINT, 4326) | |
); | |
-- \d temp | |
INSERT INTO temp VALUES (1, 'SRID=4326;0000000001C051C3DC37A3DB3C4048374D37C1376D'); | |
INSERT INTO temp VALUES (2, 'SRID=4326;POINT(-71.060316 48.432044)'); | |
SELECT id, ST_X(geom), ST_Y(geom), geom FROM temp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment