Search in sources :

Example 6 with CoordinatesType

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

the class WfsFilterDelegate method createPoint.

private JAXBElement<PointType> createPoint(Geometry geometry) {
    Coordinate[] coordinates = geometry.getCoordinates();
    if (coordinates != null && coordinates.length > 0) {
        StringBuilder coordString = new StringBuilder();
        coordString.append(coordinates[0].x).append(",").append(coordinates[0].y);
        CoordinatesType coordinatesType = new CoordinatesType();
        coordinatesType.setValue(coordString.toString());
        PointType point = new PointType();
        point.setSrsName(srsName);
        point.setCoordinates(coordinatesType);
        return gml320ObjectFactory.createPoint(point);
    } else {
        throw new IllegalArgumentException("Unable to parse Point coordinates from WKT String");
    }
}
Also used : Coordinate(com.vividsolutions.jts.geom.Coordinate) PointType(net.opengis.gml.v_3_2_1.PointType) CoordinatesType(net.opengis.gml.v_3_2_1.CoordinatesType)

Aggregations

Coordinate (com.vividsolutions.jts.geom.Coordinate)5 CoordinatesType (net.opengis.gml.v_3_2_1.CoordinatesType)3 CoordinatesType (ogc.schema.opengis.gml.v_2_1_2.CoordinatesType)3 Envelope (com.vividsolutions.jts.geom.Envelope)1 LineString (com.vividsolutions.jts.geom.LineString)1 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)1 MultiPoint (com.vividsolutions.jts.geom.MultiPoint)1 Point (com.vividsolutions.jts.geom.Point)1 LineStringType (net.opengis.gml.v_3_2_1.LineStringType)1 PointType (net.opengis.gml.v_3_2_1.PointType)1 LinearRingMemberType (ogc.schema.opengis.gml.v_2_1_2.LinearRingMemberType)1 LinearRingType (ogc.schema.opengis.gml.v_2_1_2.LinearRingType)1 MultiPointType (ogc.schema.opengis.gml.v_2_1_2.MultiPointType)1 MultiPolygonType (ogc.schema.opengis.gml.v_2_1_2.MultiPolygonType)1 PointType (ogc.schema.opengis.gml.v_2_1_2.PointType)1 PolygonType (ogc.schema.opengis.gml.v_2_1_2.PolygonType)1