/** * Computes the full topological <tt>covers</tt> predicate. * Used when short-circuit tests are not conclusive. * * @param geom the test geometry * @return true if this prepared polygon covers the test geometry */ protected boolean fullTopologicalPredicate(Geometry geom) { boolean result = prepPoly.getGeometry().covers(geom); return result; }
public synchronized PointOnGeometryLocator getPointLocator() { if (pia == null) pia = new IndexedPointInAreaLocator(getGeometry()); return pia; }
public PreparedPolygon(Polygonal poly) { super((Geometry) poly); isRectangle = getGeometry().isRectangle(); }
/** * Computes the full topological <tt>contains</tt> predicate. * Used when short-circuit tests are not conclusive. * * @param geom the test geometry * @return true if this prepared polygon contains the test geometry */ protected boolean fullTopologicalPredicate(Geometry geom) { boolean isContained = prepPoly.getGeometry().contains(geom); return isContained; }
private boolean isProperIntersectionImpliesNotContainedSituation(Geometry testGeom) { /** * If the test geometry is polygonal we have the A/A situation. * In this case, a proper intersection indicates that * the Epsilon-Neighbourhood Exterior Intersection condition exists. * This condition means that in some small * area around the intersection point, there must exist a situation * where the interior of the test intersects the exterior of the target. * This implies the test is NOT contained in the target. */ if (testGeom instanceof Polygonal) return true; /** * A single shell with no holes allows concluding that * a proper intersection implies not contained * (due to the Epsilon-Neighbourhood Exterior Intersection condition) */ if (isSingleShell(prepPoly.getGeometry())) return true; return false; }
/** * Gets the indexed intersection finder for this geometry. * * @return the intersection finder */ public synchronized FastSegmentSetIntersectionFinder getIntersectionFinder() { /** * MD - Another option would be to use a simple scan for * segment testing for small geometries. * However, testing indicates that there is no particular advantage * to this approach. */ if (segIntFinder == null) segIntFinder = new FastSegmentSetIntersectionFinder(SegmentStringUtil.extractSegmentStrings(getGeometry())); return segIntFinder; }
public boolean intersects(Geometry g) { // envelope test if (! envelopesIntersect(g)) return false; // optimization for rectangles if (isRectangle) { return RectangleIntersects.intersects((Polygon) getGeometry(), g); } return PreparedPolygonIntersects.intersects(this, g); }
public boolean contains(Geometry g) { // short-circuit test if (! envelopeCovers(g)) return false; // optimization for rectangles if (isRectangle) { return RectangleContains.contains((Polygon) getGeometry(), g); } return PreparedPolygonContains.contains(this, g); }
/** * Gets polygon * @return {@link Polygon} shape of influence */ public Polygon getPolygon() { return (Polygon) this.preparedPolygon.getGeometry(); }
public synchronized PointOnGeometryLocator getPointLocator() { if (pia == null) pia = new IndexedPointInAreaLocator(getGeometry()); return pia; }
public PreparedPolygon(Polygonal poly) { super((Geometry) poly); isRectangle = getGeometry().isRectangle(); }
/** * Computes the full topological <tt>contains</tt> predicate. * Used when short-circuit tests are not conclusive. * * @param geom the test geometry * @return true if this prepared polygon contains the test geometry */ protected boolean fullTopologicalPredicate(Geometry geom) { boolean isContained = prepPoly.getGeometry().contains(geom); return isContained; }
/** * Computes the full topological <tt>covers</tt> predicate. * Used when short-circuit tests are not conclusive. * * @param geom the test geometry * @return true if this prepared polygon covers the test geometry */ protected boolean fullTopologicalPredicate(Geometry geom) { boolean result = prepPoly.getGeometry().covers(geom); return result; }
@Override public int hashCode(){ return this.preparedPolygon.getGeometry().hashCode()+(int)this.scalar; }
private boolean isProperIntersectionImpliesNotContainedSituation(Geometry testGeom) { /** * If the test geometry is polygonal we have the A/A situation. * In this case, a proper intersection indicates that * the Epsilon-Neighbourhood Exterior Intersection condition exists. * This condition means that in some small * area around the intersection point, there must exist a situation * where the interior of the test intersects the exterior of the target. * This implies the test is NOT contained in the target. */ if (testGeom instanceof Polygonal) return true; /** * A single shell with no holes allows concluding that * a proper intersection implies not contained * (due to the Epsilon-Neighbourhood Exterior Intersection condition) */ if (isSingleShell(prepPoly.getGeometry())) return true; return false; }
/** * Gets the indexed intersection finder for this geometry. * * @return the intersection finder */ public synchronized FastSegmentSetIntersectionFinder getIntersectionFinder() { /** * MD - Another option would be to use a simple scan for * segment testing for small geometries. * However, testing indicates that there is no particular advantage * to this approach. */ if (segIntFinder == null) segIntFinder = new FastSegmentSetIntersectionFinder(SegmentStringUtil.extractSegmentStrings(getGeometry())); return segIntFinder; }
public boolean intersects(Geometry g) { // envelope test if (! envelopesIntersect(g)) return false; // optimization for rectangles if (isRectangle) { return RectangleIntersects.intersects((Polygon) getGeometry(), g); } return PreparedPolygonIntersects.intersects(this, g); }
public boolean contains(Geometry g) { // short-circuit test if (! envelopeCovers(g)) return false; // optimization for rectangles if (isRectangle) { return RectangleContains.contains((Polygon) getGeometry(), g); } return PreparedPolygonContains.contains(this, g); }