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; }
/** * Tests whether any representative point of the test Geometry intersects * the target geometry. * Only handles test geometries which are Puntal (dimension 0) * * @param geom a Puntal geometry to test * @return true if any point of the argument intersects the prepared geometry */ protected boolean isAnyTestPointInTarget(Geometry testGeom) { /** * This could be optimized by using the segment index on the lineal target. * However, it seems like the L/P case would be pretty rare in practice. */ PointLocator locator = new PointLocator(); List coords = ComponentCoordinateExtracter.getCoordinates(testGeom); for (Iterator i = coords.iterator(); i.hasNext(); ) { Coordinate p = (Coordinate) i.next(); if (locator.intersects(p, prepLine.getGeometry())) return true; } return false; }
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; }
/** * Tests whether any representative point of the test Geometry intersects * the target geometry. * Only handles test geometries which are Puntal (dimension 0) * * @param geom a Puntal geometry to test * @return true if any point of the argument intersects the prepared geometry */ protected boolean isAnyTestPointInTarget(Geometry testGeom) { /** * This could be optimized by using the segment index on the lineal target. * However, it seems like the L/P case would be pretty rare in practice. */ PointLocator locator = new PointLocator(); List coords = ComponentCoordinateExtracter.getCoordinates(testGeom); for (Iterator i = coords.iterator(); i.hasNext(); ) { Coordinate p = (Coordinate) i.next(); if (locator.intersects(p, prepLine.getGeometry())) return true; } return false; }