Search in sources :

Example 1 with PolygonPropertyType

use of net.opengis.gml.v_3_1_1.PolygonPropertyType in project ddf by codice.

the class WfsFilterDelegate method createMultiPolygon.

private JAXBElement<MultiPolygonType> createMultiPolygon(Geometry geometry) {
    MultiPolygonType multiPolygon = new MultiPolygonType();
    if (geometry.getNumGeometries() > 0) {
        List<PolygonPropertyType> geometryMembers = multiPolygon.getPolygonMember();
        for (int i = 0; i < geometry.getNumGeometries(); i++) {
            Geometry currentGeo = geometry.getGeometryN(i);
            PolygonType currentPolygon = createPolygon(currentGeo.getCoordinates());
            PolygonPropertyType member = new PolygonPropertyType();
            member.setPolygon(currentPolygon);
            geometryMembers.add(member);
        }
        return gmlObjectFactory.createMultiPolygon(multiPolygon);
    } else {
        throw new IllegalArgumentException("Unable to parse Polygon coordinates from WKT String");
    }
}
Also used : Geometry(org.locationtech.jts.geom.Geometry) PolygonPropertyType(net.opengis.gml.v_3_1_1.PolygonPropertyType) MultiPolygonType(net.opengis.gml.v_3_1_1.MultiPolygonType) PolygonType(net.opengis.gml.v_3_1_1.PolygonType) MultiPolygonType(net.opengis.gml.v_3_1_1.MultiPolygonType) Point(org.locationtech.jts.geom.Point)

Aggregations

MultiPolygonType (net.opengis.gml.v_3_1_1.MultiPolygonType)1 PolygonPropertyType (net.opengis.gml.v_3_1_1.PolygonPropertyType)1 PolygonType (net.opengis.gml.v_3_1_1.PolygonType)1 Geometry (org.locationtech.jts.geom.Geometry)1 Point (org.locationtech.jts.geom.Point)1