use of net.opengis.gml.v_3_2_1.MultiSurfaceType 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;
}
use of net.opengis.gml.v_3_2_1.MultiSurfaceType in project ddf by codice.
the class Wfs20JTStoGML321Converter method convertToMultiSurfaceType.
/**
* Converts a @link com.vividsolutions.jts.geom.MultiPolygon to a @link net.opengis.gml.v_3_2_1.MultiSurfaceType
* Note: MultiPolygon maps to gml MultiSurfaceType
*
* @param multiPolygon
* @return MultiSurfaceType
*/
public static MultiSurfaceType convertToMultiSurfaceType(MultiPolygon multiPolygon, String srsName) {
MultiSurfaceType multiSurfaceType = GML320_OBJECT_FACTORY.createMultiSurfaceType();
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Polygon poly = (Polygon) multiPolygon.getGeometryN(i);
PolygonType polygonType = convertToPolygonType(poly, srsName);
JAXBElement<PolygonType> polygonTypeJAXBElement = GML320_OBJECT_FACTORY.createPolygon(polygonType);
SurfacePropertyType surfacePropertyType = GML320_OBJECT_FACTORY.createSurfacePropertyType();
surfacePropertyType.setAbstractSurface(polygonTypeJAXBElement);
multiSurfaceType.getSurfaceMember().add(surfacePropertyType);
}
multiSurfaceType.setSrsName(srsName);
return multiSurfaceType;
}
Aggregations