I Have a table named geofences
which stores geometry of Polygon type in column named geometry
. I to update the Polygon by removing only one point from the exsisting geometry. For this I Have used the query:
UPDATE gfe_geofences
SET geometry = ST_RemovePoint(geometry, ST_NPoints(ST_GeomFromText(
'POINT(23.1446787840563 96.002746420167)', 0) ) - 1)
WHERE is_active = true
AND ST_IsClosed(the_geom) = true;
But it gives me the error:
ERROR: lwline_deserialize: attempt to deserialize a line which is really a Invalid type
Can you please help me in updating the geometry.
Thanks In Advance.
ST_RemovePoint will only work with linestrings ( see http://postgis.refractions.net/docs/ST_RemovePoint.html. What I would do, use ST_Boundary to get the boundary of your polygon, call ST_RemovePoint on that, then use ST_MakePolygon to construct a new polygon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With