I have a few original MultiPolygons that contain holes...I would like to extract the Polygons and recreate them WOTHOUT the holes. how is this done?
Original MultiPolygon.
https://gist.github.com/boundaries-io/978eaa4a10df9467638a5eb9259c84e6
when breaking up the Multipolygon
org.geojson.MultiPolygon reCreateMultiPolygon = new org.geojson.MultiPolygon();
for (List<List<LngLatAlt>> polygonPoints : multiPolygon.getCoordinates()) {
for (List<LngLatAlt> point : polygonPoints) {
Polygon p = new Polygon(point);
reCreateMultiPolygon.add(p);
}
}
String fileName2 = saveToFileSystem(reCreateMultiPolygon);
The this is treating each polygon as its own polygon...I am unclear how to recreate this with the holes intact...not treat them as normal polygons.
results:/
Incorrect recreated MultiPolygon https://gist.github.com/boundaries-io/89e51458e9f5509b5457f9033474bc2d
my end goal is to create a convert that does a org.geojson.MultiPolygon to rg.springframework.data.mongodb.core.geo.GeoJsonMultiPolygon to save in Mongodb via spring data mongodb. if this can be done via JTS,geotools,etc. thats fine...