[postgis-users] ST_Within and GEOMETRYCOLLECTION

Martin Davis mtnclimb at telus.net
Mon May 7 17:36:04 PDT 2012


The problem case is where a line does not lie completely in either 
component, but does potentially lie in the union of the components.  See 
the attached image for a simple case.  Essentially this requires 
computing whether three line segments intersect in a point or which side 
of an intersection point a segment lies, both of which requires 
high-precision computation.

Trying to handle this would substantially complicate the current JTS 
algorithm, which is one reason it wasn't done originally.   Also, 
there's robustness issues both with trying to compute the correct answer 
with limited precision, and with overlaying polygons in general.

But it's definitely annoying that GCs are not handled by the 
predicates.  The intersects predicate as least could be fairly easily 
extended to handle GCs.



On 5/7/2012 12:33 PM, Paul Ramsey wrote:
> On Mon, May 7, 2012 at 4:41 PM, Martin Davis<mtnclimb at telus.net>  wrote:
>> It's because the underlying JTS/GEOS operation doesn't support
>> GeometryCollections.  And this in turn is because of the details of the
>> implementation - in particular, handling the situation where two polygons
>> overlap.  It would require computing the overlay of the polygons in order to
>> detect the within condition at the point of overlap.
> Why so? If you're in one component, does that end the test? The answer
> is 'true'.
> P.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geoms.png
Type: image/png
Size: 11124 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120507/86b07746/attachment.png>


More information about the postgis-users mailing list