use of net.opengis.gml.v_3_2_1.DirectPositionType in project ddf by codice.
the class CswFilterFactory method createDirectPositionType.
private DirectPositionType createDirectPositionType(Double x, Double y) {
DirectPositionType directPositionType = new DirectPositionType();
List<Double> coord = new ArrayList<Double>(2);
coord.add(x);
coord.add(y);
directPositionType.setValue(coord);
LOGGER.debug("Created direct position type ({}, {})", x, y);
return directPositionType;
}
use of net.opengis.gml.v_3_2_1.DirectPositionType in project ddf by codice.
the class SlotTypeConverter method getPoint.
private Optional<PointType> getPoint(Map<String, Object> pointMap) {
Optional<PointType> optionalPoint = Optional.empty();
if (MapUtils.isEmpty(pointMap)) {
return optionalPoint;
}
BigInteger dimension = getBigIntFromMap(SRS_DIMENSION, pointMap);
if (dimension != null) {
if (!optionalPoint.isPresent()) {
optionalPoint = Optional.of(GML_FACTORY.createPointType());
}
optionalPoint.get().setSrsDimension(dimension);
}
String valueToPopulate = MapUtils.getString(pointMap, SRS_NAME);
if (StringUtils.isNotBlank(valueToPopulate)) {
if (!optionalPoint.isPresent()) {
optionalPoint = Optional.of(GML_FACTORY.createPointType());
}
optionalPoint.get().setSrsName(valueToPopulate);
}
valueToPopulate = MapUtils.getString(pointMap, POSITION);
if (StringUtils.isNotBlank(valueToPopulate)) {
String[] values = StringUtils.split(valueToPopulate);
DirectPositionType directPosition = GML_FACTORY.createDirectPositionType();
for (String value : values) {
directPosition.getValue().add(Double.valueOf(value));
}
if (!optionalPoint.isPresent()) {
optionalPoint = Optional.of(GML_FACTORY.createPointType());
}
optionalPoint.get().setPos(directPosition);
}
return optionalPoint;
}
use of net.opengis.gml.v_3_2_1.DirectPositionType in project ddf by codice.
the class WfsFilterDelegate method createEnvelope.
private JAXBElement<EnvelopeType> createEnvelope(Geometry geometry) {
EnvelopeType envelopeType = gml320ObjectFactory.createEnvelopeType();
envelopeType.setSrsName(GeospatialUtil.EPSG_4326_URN);
Envelope envelope = geometry.getEnvelopeInternal();
DirectPositionType lowerCorner = gml320ObjectFactory.createDirectPositionType();
lowerCorner.getValue().add(envelope.getMinX());
lowerCorner.getValue().add(envelope.getMinY());
envelopeType.setLowerCorner(lowerCorner);
DirectPositionType upperCorner = gml320ObjectFactory.createDirectPositionType();
upperCorner.getValue().add(envelope.getMaxX());
upperCorner.getValue().add(envelope.getMaxY());
envelopeType.setUpperCorner(upperCorner);
return gml320ObjectFactory.createEnvelope(envelopeType);
}
use of net.opengis.gml.v_3_2_1.DirectPositionType in project ddf by codice.
the class Wfs20JTStoGML321Converter method convertCoordinateToDirectPositionType.
public static DirectPositionType convertCoordinateToDirectPositionType(Coordinate coordinate) {
final DirectPositionType directPosition = GML320_OBJECT_FACTORY.createDirectPositionType();
directPosition.getValue().add(coordinate.x);
directPosition.getValue().add(coordinate.y);
if (!Double.isNaN(coordinate.z)) {
directPosition.getValue().add(coordinate.z);
}
return directPosition;
}
use of net.opengis.gml.v_3_2_1.DirectPositionType in project ddf by codice.
the class Wfs20JTStoGML321Converter method convertGeometryType.
private static LineStringType convertGeometryType(LineString lineString) {
final LineStringType resultLineString = GML320_OBJECT_FACTORY.createLineStringType();
for (DirectPositionType directPosition : convertCoordinates(lineString.getCoordinates())) {
final JAXBElement<DirectPositionType> pos = GML320_OBJECT_FACTORY.createPos(directPosition);
resultLineString.getPosOrPointPropertyOrPointRep().add(pos);
}
return resultLineString;
}
Aggregations