Search in sources :

Example 1 with DirectPositionType

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;
}
Also used : DirectPositionType(net.opengis.gml.v_3_1_1.DirectPositionType) ArrayList(java.util.ArrayList)

Example 2 with 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;
}
Also used : DirectPositionType(net.opengis.gml.v_3_1_1.DirectPositionType) PointType(net.opengis.gml.v_3_1_1.PointType) BigInteger(java.math.BigInteger)

Example 3 with DirectPositionType

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);
}
Also used : EnvelopeType(net.opengis.gml.v_3_2_1.EnvelopeType) DirectPositionType(net.opengis.gml.v_3_2_1.DirectPositionType) Envelope(com.vividsolutions.jts.geom.Envelope)

Example 4 with DirectPositionType

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;
}
Also used : DirectPositionType(net.opengis.gml.v_3_2_1.DirectPositionType)

Example 5 with DirectPositionType

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;
}
Also used : DirectPositionType(net.opengis.gml.v_3_2_1.DirectPositionType) LineStringType(net.opengis.gml.v_3_2_1.LineStringType)

Aggregations

DirectPositionType (net.opengis.gml.v_3_1_1.DirectPositionType)5 DirectPositionType (net.opengis.gml.v_3_2_1.DirectPositionType)4 ArrayList (java.util.ArrayList)3 PointType (net.opengis.gml.v_3_1_1.PointType)3 BigInteger (java.math.BigInteger)2 AnyValueType (net.opengis.cat.wrs.v_1_0_2.AnyValueType)2 EnvelopeType (net.opengis.gml.v_3_1_1.EnvelopeType)2 SlotType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1)2 Envelope (com.vividsolutions.jts.geom.Envelope)1 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1 ValueListType (net.opengis.cat.wrs.v_1_0_2.ValueListType)1 EnvelopeType (net.opengis.gml.v_3_2_1.EnvelopeType)1 LineStringType (net.opengis.gml.v_3_2_1.LineStringType)1 ClassificationType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ClassificationType)1 ExtrinsicObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType)1