<div dir="ltr">There may be a further performance improvement available for PreparedGeometry predicates, for situations where a test geometry is wholly inside or outside the prepared target.  This situation would seem to be relatively common - an example would be checking small parcel polygons against much larger jurisdiction boundaries.<div><br></div><div>The optimization is in the segment-intersection phase of the test chain.  It's possible to first test the *envelope* of the test (B) geometry against the target (A) segment index, to see if the envelope intersects any segment.  If no segment-envelope intersection is found, this provides a fast negative result for intersects, and a fast positive result for contains and covers.</div><div><br></div><div>I'll put this in the queue to prototype and metric in JTS.  I'm putting it out here in case someone wants to try this out in GEOS/PostGIS to test it against some real-world workloads.</div><div><br></div><div>My current thinking for implementation is to enhance FastSegmentSetIntersectionFinder to provide a boolean intersects(Envelope) method.  In turn this requires extensions to MonotoneChainOverlapAction and possibly some other classes.   </div><div><br></div><div>Feedback welcome.  </div></div>