I am using JTS and I have one big Multypolygon with seperated Areas. How can I get a List of Polygons representing these seperated areas.
Thanks in Advance Lukas
I am using JTS and I have one big Multypolygon with seperated Areas. How can I get a List of Polygons representing these seperated areas.
Thanks in Advance Lukas
This is fairly simple, given a MultiPolygon p
:
ArrayList<Polygon> polygons = new ArrayList<>();
for (int i = 0; i < p.getNumGeometries(); i++) {
Polygon polygon = (Polygon)p.getGeometryN(i);
polygons.add(polygon)
}