use of ogc.schema.opengis.gml.v_2_1_2.CoordinatesType in project ddf by codice.
the class WfsFilterDelegate method createLineString.
private JAXBElement<LineStringType> createLineString(Geometry geometry) {
LineStringType lineStringType = gmlObjectFactory.createLineStringType();
String coordinatesValue = coordinateStrategy.toString(geometry.getCoordinates());
CoordinatesType coordinatesType = gmlObjectFactory.createCoordinatesType();
coordinatesType.setValue(coordinatesValue);
coordinatesType.setDecimal(".");
coordinatesType.setCs(",");
coordinatesType.setTs(" ");
lineStringType.setCoordinates(coordinatesType);
return gmlObjectFactory.createLineString(lineStringType);
}
use of ogc.schema.opengis.gml.v_2_1_2.CoordinatesType in project ddf by codice.
the class WfsFilterDelegate method createCoordinates.
private CoordinatesType createCoordinates(Geometry geometry) {
CoordinatesType coords = gml320ObjectFactory.createCoordinatesType();
Coordinate[] coordinates = geometry.getCoordinates();
if (coordinates != null && coordinates.length > 0) {
StringBuffer coordString = new StringBuffer();
for (Coordinate coordinate : coordinates) {
coordString.append(coordinate.x).append(",").append(coordinate.y).append(" ");
}
coords.setValue(coordString.toString());
coords.setDecimal(".");
coords.setCs(",");
coords.setTs(" ");
coords.setValue(coordString.toString());
return coords;
} else {
throw new IllegalArgumentException("Unable to parse Geometry coordinates from WKT String");
}
}
use of ogc.schema.opengis.gml.v_2_1_2.CoordinatesType in project ddf by codice.
the class WfsFilterDelegate method createPoint.
private JAXBElement<AbstractGeometryType> createPoint(String wkt) {
Coordinate[] coordinates = getCoordinatesFromWkt(wkt);
if (coordinates != null && coordinates.length > 0) {
CoordinatesType coordinatesType = new CoordinatesType();
String coordinateString = coordinateStrategy.toString(coordinates[0]);
coordinatesType.setValue(coordinateString);
PointType point = new PointType();
point.setCoordinates(coordinatesType);
return gmlObjectFactory.createGeometry(point);
} else {
throw new IllegalArgumentException("Unable to parse Point coordinates from WKT String");
}
}
use of ogc.schema.opengis.gml.v_2_1_2.CoordinatesType in project ddf by codice.
the class WfsFilterDelegate method createPolygon.
private PolygonType createPolygon(Coordinate[] coordinates) {
if (coordinates != null && coordinates.length > 0) {
PolygonType polygon = new PolygonType();
LinearRingType linearRing = new LinearRingType();
String coordinateString = coordinateStrategy.toString(coordinates);
CoordinatesType coordinatesType = new CoordinatesType();
coordinatesType.setValue(coordinateString);
coordinatesType.setDecimal(".");
coordinatesType.setCs(",");
coordinatesType.setTs(" ");
linearRing.setCoordinates(coordinatesType);
AbstractRingPropertyType abstractRingPropertyType = gmlObjectFactory.createAbstractRingPropertyType();
abstractRingPropertyType.setRing(gmlObjectFactory.createLinearRing(linearRing));
polygon.setExterior(gmlObjectFactory.createExterior(abstractRingPropertyType));
return polygon;
} else {
throw new IllegalArgumentException("Unable to parse Polygon coordinates from WKT String");
}
}
use of ogc.schema.opengis.gml.v_2_1_2.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");
}
}
Aggregations