/** * Extracts the {@link Point} elements from a single {@link Geometry} * and adds them to the provided {@link List}. * * @param geom the geometry from which to extract * @param list the list to add the extracted elements to */ public static List getPoints(Geometry geom, List list) { if (geom instanceof Point) { list.add(geom); } else if (geom instanceof GeometryCollection) { geom.apply(new PointExtracter(list)); } // skip non-Polygonal elemental geometries return list; }
geom.apply(new PolygonExtracter(polys)); geom.apply(new LineStringExtracter(lines)); geom.apply(new PointExtracter(points)); geom = geom.getFactory().buildGeometry(polys); for (int i = 0; i < polygon.getNumInteriorRing(); i++) {