public Point getInteriorPoint() { return polygon.getInteriorPoint(); }
/** * Splits a Polygon using a LineString. * * @param polygon * @param lineString * @return */ public static Collection<Polygon> polygonWithLineSplitter(Polygon polygon, LineString lineString) { Collection<Polygon> polygons = splitPolygonizer(polygon, lineString); if (polygons != null && polygons.size() > 1) { List<Polygon> pols = new ArrayList<Polygon>(); for (Polygon pol : polygons) { if (polygon.contains(pol.getInteriorPoint())) { pols.add(pol); } } return pols; } return null; }
/** * Splits a Polygon using a LineString. * * @param polygon * @param lineString * @return */ private static Collection<Polygon> polygonWithLineSplitter(Polygon polygon, LineString lineString) throws SQLException { Collection<Polygon> polygons = splitPolygonizer(polygon, lineString); if (polygons != null && polygons.size() > 1) { List<Polygon> pols = new ArrayList<Polygon>(); for (Polygon pol : polygons) { if (polygon.contains(pol.getInteriorPoint())) { pols.add(pol); } } return pols; } return null; }
/** * Splits a Polygon using a LineString. * * @param polygon * @param lineString * @return */ private static Collection<Polygon> polygonWithLineSplitter(Polygon polygon, LineString lineString) throws SQLException { Collection<Polygon> polygons = splitPolygonizer(polygon, lineString); if (polygons != null && polygons.size() > 1) { List<Polygon> pols = new ArrayList<Polygon>(); for (Polygon pol : polygons) { if (polygon.contains(pol.getInteriorPoint())) { pols.add(pol); } } return pols; } return null; }
/** * Returns a location that is the closest point within the polygon to the centroid. The function * delegates to the Geometry class which delegates to the InteriorPointPoint class. You can see * the javadocs in the link below. <a href= * "http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/algorithm/InteriorPointPoint"> * http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/algorithm/InteriorPointPoint * </a> .html * * @return location that is the closest point within the polygon to the centroid */ public Location interiorCenter() { final Point point = JTS_POLYGON_CONVERTER.convert(this).getInteriorPoint(); return new JtsLocationConverter().backwardConvert(point.getCoordinate()); }
if (polygon.contains(p.getInteriorPoint())) output.add(p);
for (Object object : polygonizer.getPolygons()) { Polygon polygon = (Polygon) object; Coordinate p = polygon.getInteriorPoint().getCoordinate(); int location = RayCrossingCounter.locatePointInRing(p, ring.getCoordinateSequence()); if (location == Location.INTERIOR) {
for (Object object : polygonizer.getPolygons()) { Polygon polygon = (Polygon) object; Coordinate p = polygon.getInteriorPoint().getCoordinate(); int location = RayCrossingCounter.locatePointInRing(p, ring.getCoordinateSequence()); if (location == Location.INTERIOR) {