use of net.opengis.gml.v_3_1_1.PointType in project ddf by codice.
the class SlotTypeConverter method getWrsValueList.
private Optional<net.opengis.cat.wrs.v_1_0_2.ValueListType> getWrsValueList(Map<String, Object> map) {
Optional<net.opengis.cat.wrs.v_1_0_2.ValueListType> optionalValueList = Optional.empty();
if (MapUtils.isEmpty(map) || !map.containsKey(VALUE)) {
return optionalValueList;
}
Map<String, Object> valueMap = (Map<String, Object>) map.get(VALUE);
if (valueMap.containsKey(POINT_KEY)) {
Optional<PointType> optionalPoint = getPoint((Map<String, Object>) valueMap.get(POINT_KEY));
if (optionalPoint.isPresent()) {
AnyValueType anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createPoint(optionalPoint.get()));
net.opengis.cat.wrs.v_1_0_2.ValueListType valueList = WRS_FACTORY.createValueListType();
valueList.getAnyValue().add(anyValue);
if (!optionalValueList.isPresent()) {
optionalValueList = Optional.of(WRS_FACTORY.createValueListType());
}
optionalValueList.get().getAnyValue().add(anyValue);
}
} else if (valueMap.containsKey(ENVELOPE_KEY)) {
Optional<EnvelopeType> optionalEnvelope = getEnvelope((Map<String, Object>) valueMap.get(ENVELOPE_KEY));
if (optionalEnvelope.isPresent()) {
AnyValueType anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createEnvelope(optionalEnvelope.get()));
net.opengis.cat.wrs.v_1_0_2.ValueListType valueList = WRS_FACTORY.createValueListType();
valueList.getAnyValue().add(anyValue);
if (!optionalValueList.isPresent()) {
optionalValueList = Optional.of(WRS_FACTORY.createValueListType());
}
optionalValueList.get().getAnyValue().add(anyValue);
}
}
return optionalValueList;
}
use of net.opengis.gml.v_3_1_1.PointType 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