1 Answer 1
Update
This is no longer required there is now a native cast from gemoetry to native Point and vise-versa:
SELECT ST_MakePoint(0,0)::Point;
SELECT ST_AsText( Point(0,0)::geometry );
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[0],p[1])
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[0] FROM t retrieves the X coordinate and UPDATE t SET p[1] = ... 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.
-
you can wrap an ST_SetSRID around the ST_MakePoint and you'll have a proper coordinate system assigned to your geometry...Inactivated Account– Inactivated Account2017年06月12日 21:26:45 +00:00Commented Jun 12, 2017 at 21:26
Explore related questions
See similar questions with these tags.