getPoint2d_p(point->point, 0, &pt);
/* assume bbox short-circuit has already been attempted */
+ /* everything is outside of an empty polygon */
+ if ( polygon->nrings == 0 ) return -1;
+
ring = polygon->rings[0];
in_ring = point_in_ring(polygon->rings[0], &pt);
if ( in_ring == -1) /* outside the exterior ring */
{
LWPOLY *polygon = mpolygon->geoms[j];
+
+ /* everything is outside of an empty polygon */
+ if ( polygon->nrings == 0 ) continue;
+
ring = polygon->rings[0];
in_ring = point_in_ring(polygon->rings[0], &pt);
if ( in_ring == -1) /* outside the exterior ring */
::geometry as g )
select '#1543', st_astext(g), st_astext(st_buildarea(g)) from inp;
+-- #1578
+with inp as (
+ select ST_Collect('POLYGON EMPTY', 'POLYGON EMPTY') as mp,
+ 'POINT(0 0)'::geometry as p
+)
+select '#1578', _st_within(p, mp), _st_intersects(p, mp) FROM inp;
+
-- Clean up
DELETE FROM spatial_ref_sys;
#1398a|POINT(-119.093153 45.632669)
#1398b|POINT(-160.137654 77.091608)
#1543|MULTILINESTRING((0 0,10 0,10 10,0 0),(0 0))|POLYGON((0 0,10 10,10 0,0 0))
+#1578|f|f