Search in sources :

Example 1 with MultiGeometryType

use of net.opengis.gml.v_3_2_1.MultiGeometryType in project ddf by codice.

the class Wfs20JTStoGML321Converter method createGeometryPropertyType.

private static GeometryPropertyType createGeometryPropertyType(Geometry geometry, String srsName) {
    final GeometryPropertyType geometryPropertyType = GML320_OBJECT_FACTORY.createGeometryPropertyType();
    if (geometry instanceof Point) {
        PointType pointType = convertToPointType((Point) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertPointTypeToJAXB(pointType));
    } else if (geometry instanceof LineString) {
        LineStringType lineStringType = convertToLineStringType((LineString) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertLineStringTypeToJAXB(lineStringType));
    } else if (geometry instanceof Polygon) {
        PolygonType polygonType = convertToPolygonType((Polygon) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertPolygonTypeToJAXB(polygonType));
    } else if (geometry instanceof MultiPoint) {
        MultiPointType multiPointType = convertToMultiPointType((MultiPoint) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertMultiPointTypeToJAXB(multiPointType));
    } else if (geometry instanceof MultiLineString) {
        MultiCurveType multiCurveType = convertToMultiLineStringType((MultiLineString) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertMultiCurveTypeToJAXB(multiCurveType));
    } else if (geometry instanceof MultiPolygon) {
        MultiSurfaceType multiSurfaceType = convertToMultiSurfaceType((MultiPolygon) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertMultiSurfaceTypeToJAXB(multiSurfaceType));
    } else if (geometry instanceof GeometryCollection) {
        MultiGeometryType multiGeometryType = convertToMultiGeometryType((GeometryCollection) geometry, srsName);
        geometryPropertyType.setAbstractGeometry(convertMultiGeometryTypeToJAXB(multiGeometryType));
    } else {
        throw new IllegalArgumentException();
    }
    return geometryPropertyType;
}
Also used : MultiPoint(org.locationtech.jts.geom.MultiPoint) MultiLineString(org.locationtech.jts.geom.MultiLineString) MultiCurveType(net.opengis.gml.v_3_2_1.MultiCurveType) MultiGeometryType(net.opengis.gml.v_3_2_1.MultiGeometryType) PolygonType(net.opengis.gml.v_3_2_1.PolygonType) Point(org.locationtech.jts.geom.Point) MultiPoint(org.locationtech.jts.geom.MultiPoint) LineStringType(net.opengis.gml.v_3_2_1.LineStringType) MultiPointType(net.opengis.gml.v_3_2_1.MultiPointType) GeometryCollection(org.locationtech.jts.geom.GeometryCollection) MultiSurfaceType(net.opengis.gml.v_3_2_1.MultiSurfaceType) MultiLineString(org.locationtech.jts.geom.MultiLineString) LineString(org.locationtech.jts.geom.LineString) MultiPolygon(org.locationtech.jts.geom.MultiPolygon) PointType(net.opengis.gml.v_3_2_1.PointType) MultiPointType(net.opengis.gml.v_3_2_1.MultiPointType) Polygon(org.locationtech.jts.geom.Polygon) MultiPolygon(org.locationtech.jts.geom.MultiPolygon) GeometryPropertyType(net.opengis.gml.v_3_2_1.GeometryPropertyType)

Example 2 with MultiGeometryType

use of net.opengis.gml.v_3_2_1.MultiGeometryType in project ddf by codice.

the class Wfs20JTStoGML321Converter method convertToMultiGeometryType.

public static MultiGeometryType convertToMultiGeometryType(GeometryCollection multiGeometry, String srsName) {
    final MultiGeometryType multiGeometryType = GML320_OBJECT_FACTORY.createMultiGeometryType();
    for (int index = 0; index < multiGeometry.getNumGeometries(); index++) {
        final Geometry geometry = multiGeometry.getGeometryN(index);
        multiGeometryType.getGeometryMember().add(createGeometryPropertyType(geometry, srsName));
    }
    return multiGeometryType;
}
Also used : Geometry(org.locationtech.jts.geom.Geometry) MultiGeometryType(net.opengis.gml.v_3_2_1.MultiGeometryType) Point(org.locationtech.jts.geom.Point) MultiPoint(org.locationtech.jts.geom.MultiPoint)

Aggregations

MultiGeometryType (net.opengis.gml.v_3_2_1.MultiGeometryType)2 MultiPoint (org.locationtech.jts.geom.MultiPoint)2 Point (org.locationtech.jts.geom.Point)2 GeometryPropertyType (net.opengis.gml.v_3_2_1.GeometryPropertyType)1 LineStringType (net.opengis.gml.v_3_2_1.LineStringType)1 MultiCurveType (net.opengis.gml.v_3_2_1.MultiCurveType)1 MultiPointType (net.opengis.gml.v_3_2_1.MultiPointType)1 MultiSurfaceType (net.opengis.gml.v_3_2_1.MultiSurfaceType)1 PointType (net.opengis.gml.v_3_2_1.PointType)1 PolygonType (net.opengis.gml.v_3_2_1.PolygonType)1 Geometry (org.locationtech.jts.geom.Geometry)1 GeometryCollection (org.locationtech.jts.geom.GeometryCollection)1 LineString (org.locationtech.jts.geom.LineString)1 MultiLineString (org.locationtech.jts.geom.MultiLineString)1 MultiPolygon (org.locationtech.jts.geom.MultiPolygon)1 Polygon (org.locationtech.jts.geom.Polygon)1