use of org.geotoolkit.gml.xml.PolygonProperty in project geotoolkit by Geomatys.
the class GeometryTransformer method convertMultiPolygon.
private MultiPolygon convertMultiPolygon(final org.geotoolkit.gml.xml.MultiPolygon mp) {
Polygon[] polys;
try {
polys = mp.getPolygonMember().stream().map(PolygonProperty::getPolygon).map(p -> new GeometryTransformer(p, this).get()).map(Polygon.class::cast).toArray(size -> new Polygon[size]);
} catch (ClassCastException e) {
throw new UnconvertibleObjectException("Cannot create a multi-polygon, because some of its components are not polygons", e);
}
final MultiPolygon result = GF.createMultiPolygon(polys);
applyCRS(result);
return result;
}
Aggregations