0

I'm finding a hard time storing a point coordinate as the location to a PostgreSQL using PostGIS:

I found this query, but I'm unable to understand what the SRID and CRS values specified in this answer refers to.

UPDATE table_name SET geom = ST_Transform(ST_SetSRID(ST_MakePoint(longitude, latitude), 4326),26913);
1
  • The SRID of 26913 refers to NAD83 UTM Zone 13N. Is your question about SRIDs in general, or about the specific choice of the OP in that question?
    – Vince
    Apr 9 '20 at 5:08
3

In that example, the TYPE is Geometry which is a Point type and the SRID of the geom column is set as >> geom GEOMETRY(POINT, 26913).

So.....

ST_MakePoint(longitude, latitude) makes the point with the lat, long provided.

ST_SetSRID(XXXXXXX, 4326) sets the projection of the lat, long provided 4326 (WGS84).

ST_Transform(XXXXXXX,26913) transforms the projection to 26913. Which the geom column is set in.

More information can be found here. https://postgis.net/docs/ST_MakePoint.html

Work these out from inside out and try to test it as a Select statement before commiting to the table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.