If I have a
How do I go from that to a PostGIS point?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
There is no implicit conversion or casting from a PostgreSQL native point type to a PostGIS geometry, and a PostGIS POINT has a Spatial Reference System attached to it. ST_MakePoint will create the point geometry, but it'll be apart from any system that maps it to Earth,
SELECT ST_MakePoint(p,p) FROM ( VALUES (point(-71.1043443253471,42.3150676015829)) ) AS t(p);
We're accessing the point type with the array syntax,
It is possible to access the two component numbers of a point as though the point were an array with indexes 0 and 1. For example, if t.p is a point column then SELECT p FROM t retrieves the X coordinate and UPDATE t SET p = ... changes the Y coordinate. In the same way, a value of type box or lseg can be treated as an array of two point values.