[postgis-users] ST_Contains(a.coordinates::::geometry, b.coordinates::::geometry)

Antonio Rodriges antonio.rrz at gmail.com
Fri Aug 12 04:27:30 PDT 2011


Sandro,

when I use ST_MakePolygon
I get error
ERROR: lwpoly_from_lwlines: shell must be closed
Does this mean that my polygons are not closed?

I am sure I have closed polygons: the start point is equal to end point

I verified my assumption with
select a.id, ST_AsText(a.coordinates)
from contours a
where a.time = '2002-12-31 16:00:00'

the query was
select a.id, b.id, ST_Contains(ST_MakePolygon(a.coordinates::geometry),
ST_MakePolygon(b.coordinates::geometry)) AS result
from contours a CROSS JOIN contours b
where a.time = '2002-12-31 16:00:00' and b.time = '2002-12-31 16:00:00'

do I need to add some code to close polygons (maybe PostGIS treats
them still as not closed?)



More information about the postgis-users mailing list