Search in sources :

Example 6 with EnvelopeType

use of net.opengis.swe.x101.EnvelopeType in project ddf by codice.

the class CswFilterFactory method createEnvelopeType.

private JAXBElement<EnvelopeType> createEnvelopeType(String wkt) {
    EnvelopeType envelopeType = new EnvelopeType();
    wkt = convertWktToLatLonOrdering(wkt);
    Envelope envelope = getEnvelopeFromWkt(wkt);
    if (envelope != null) {
        envelopeType.setLowerCorner(createDirectPositionType(envelope.getMinX(), envelope.getMinY()));
        envelopeType.setUpperCorner(createDirectPositionType(envelope.getMaxX(), envelope.getMaxY()));
    }
    return this.gmlObjectFactory.createEnvelope(envelopeType);
}
Also used : EnvelopeType(net.opengis.gml.v_3_1_1.EnvelopeType) Envelope(com.vividsolutions.jts.geom.Envelope)

Example 7 with EnvelopeType

use of net.opengis.swe.x101.EnvelopeType in project ddf by codice.

the class CswFilterFactory method createBinarySpatialOpType.

private BinarySpatialOpType createBinarySpatialOpType(PropertyNameType propertyName, String wkt, BinarySpatialOperand geometryOrEnvelope) {
    BinarySpatialOpType binarySpatialOpType = null;
    if (geometryOrEnvelope == BinarySpatialOperand.GEOMETRY) {
        wkt = convertWktToLatLonOrdering(wkt);
        Geometry geometry = getGeometryFromWkt(wkt);
        JAXBElement<? extends AbstractGeometryType> geometryJaxbElement = convertGeometry(geometry);
        binarySpatialOpType = createBinarySpatialOpTypeUsingGeometry(propertyName, geometryJaxbElement);
    } else {
        JAXBElement<EnvelopeType> envelopeJaxbElement = createEnvelopeType(wkt);
        binarySpatialOpType = createBinarySpatialOpTypeUsingEnvelope(propertyName, envelopeJaxbElement);
    }
    return binarySpatialOpType;
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) EnvelopeType(net.opengis.gml.v_3_1_1.EnvelopeType) BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType)

Example 8 with EnvelopeType

use of net.opengis.swe.x101.EnvelopeType in project ddf by codice.

the class CswFilterFactory method createBBoxType.

private JAXBElement<BBOXType> createBBoxType(String propertyName, String wkt) {
    BBOXType bboxType = new BBOXType();
    JAXBElement<EnvelopeType> envelope = createEnvelopeType(wkt);
    bboxType.setEnvelope(envelope);
    bboxType.setPropertyName(createPropertyNameType(propertyName));
    return filterObjectFactory.createBBOX(bboxType);
}
Also used : EnvelopeType(net.opengis.gml.v_3_1_1.EnvelopeType) BBOXType(net.opengis.filter.v_1_1_0.BBOXType)

Example 9 with EnvelopeType

use of net.opengis.swe.x101.EnvelopeType in project arctic-sea by 52North.

the class GmlEncoderv321 method createEnvelope.

private XmlObject createEnvelope(ReferencedEnvelope sosEnvelope) {
    int srid = sosEnvelope.getSrid();
    EnvelopeType envelopeType = EnvelopeType.Factory.newInstance();
    MinMax<String> minmax = sosEnvelope.getMinMaxFromEnvelope();
    envelopeType.addNewLowerCorner().setStringValue(minmax.getMinimum());
    envelopeType.addNewUpperCorner().setStringValue(minmax.getMaximum());
    envelopeType.setSrsName(getSrsName(srid));
    return envelopeType;
}
Also used : EnvelopeType(net.opengis.gml.x32.EnvelopeType) MultiLineString(org.locationtech.jts.geom.MultiLineString) LineString(org.locationtech.jts.geom.LineString) MultiPoint(org.locationtech.jts.geom.MultiPoint) Point(org.locationtech.jts.geom.Point)

Example 10 with EnvelopeType

use of net.opengis.swe.x101.EnvelopeType in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createField.

private DataComponentPropertyType createField(SweField sweField) throws EncodingException {
    SweAbstractDataComponent sosElement = sweField.getElement();
    DataComponentPropertyType xbField = DataComponentPropertyType.Factory.newInstance(getXmlOptions());
    if (sweField.isSetName()) {
        xbField.setName(sweField.getName().getValue());
    }
    if (sosElement instanceof SweBoolean) {
        xbField.addNewBoolean().set(createSimpleType((SweBoolean) sosElement));
    } else if (sosElement instanceof SweCategory) {
        xbField.addNewCategory().set(createSimpleType((SweCategory) sosElement));
    } else if (sosElement instanceof SweCount) {
        xbField.addNewCount().set(createSimpleType((SweCount) sosElement));
    } else if (sosElement instanceof SweCountRange) {
        xbField.addNewCount().set(createSimpleType((SweCountRange) sosElement));
    } else if (sosElement instanceof SweQuantity) {
        xbField.addNewQuantity().set(createSimpleType((SweQuantity) sosElement));
    } else if (sosElement instanceof SweQuantityRange) {
        xbField.addNewQuantity().set(createSimpleType((SweQuantityRange) sosElement));
    } else if (sosElement instanceof SweText) {
        xbField.addNewText().set(createSimpleType((SweText) sosElement));
    } else if (sosElement instanceof SweTimeRange) {
        xbField.addNewTimeRange().set(createSimpleType((SweTimeRange) sosElement));
    } else if (sosElement instanceof SweTime) {
        xbField.addNewTime().set(createSimpleType((SweTime) sosElement));
    } else if (sosElement instanceof SweEnvelope) {
        EnvelopeType xbEnvelope = (EnvelopeType) xbField.addNewAbstractDataRecord().substitute(SweConstants.QN_ENVELOPE_SWE_101, EnvelopeType.type);
        xbEnvelope.set(createEnvelope((SweEnvelope) sosElement));
    } else if (sosElement instanceof SweDataRecord) {
        DataRecordType xbEnvelope = (DataRecordType) xbField.addNewAbstractDataRecord().substitute(SweConstants.QN_DATA_RECORD_SWE_101, DataRecordType.type);
        xbEnvelope.set(createDataRecord((SweDataRecord) sosElement));
    } else if (sosElement instanceof SweDataArray) {
        DataArrayType xbEnvelope = (DataArrayType) xbField.addNewAbstractDataRecord().substitute(SweConstants.QN_DATA_RECORD_SWE_101, DataArrayType.type);
        xbEnvelope.set(createDataArray((SweDataArray) sosElement).getDataArray1());
    } else {
        throw new EncodingException("The element type '%s' of the received '%s' is not supported by this encoder '%s'.", new Object[] { sosElement != null ? sosElement.getClass().getName() : null, sweField.getClass().getName(), getClass().getName() });
    }
    return xbField;
}
Also used : SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity) DataRecordType(net.opengis.swe.x101.DataRecordType) SimpleDataRecordType(net.opengis.swe.x101.SimpleDataRecordType) SweText(org.n52.shetland.ogc.swe.simpleType.SweText) SweTime(org.n52.shetland.ogc.swe.simpleType.SweTime) EnvelopeType(net.opengis.swe.x101.EnvelopeType) EncodingException(org.n52.svalbard.encode.exception.EncodingException) NotYetSupportedEncodingException(org.n52.svalbard.encode.exception.NotYetSupportedEncodingException) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent) SweCountRange(org.n52.shetland.ogc.swe.simpleType.SweCountRange) SweCount(org.n52.shetland.ogc.swe.simpleType.SweCount) SweTimeRange(org.n52.shetland.ogc.swe.simpleType.SweTimeRange) SweDataArray(org.n52.shetland.ogc.swe.SweDataArray) SweBoolean(org.n52.shetland.ogc.swe.simpleType.SweBoolean) SweQuantityRange(org.n52.shetland.ogc.swe.simpleType.SweQuantityRange) SweEnvelope(org.n52.shetland.ogc.swe.SweEnvelope) SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) SweCategory(org.n52.shetland.ogc.swe.simpleType.SweCategory) DataComponentPropertyType(net.opengis.swe.x101.DataComponentPropertyType) XmlObject(org.apache.xmlbeans.XmlObject) DataArrayType(net.opengis.swe.x101.DataArrayType)

Aggregations

EnvelopeType (net.opengis.gml.v_3_1_1.EnvelopeType)6 AnyValueType (net.opengis.cat.wrs.v_1_0_2.AnyValueType)3 DirectPositionType (net.opengis.gml.v_3_1_1.DirectPositionType)3 PointType (net.opengis.gml.v_3_1_1.PointType)3 EnvelopeType (net.opengis.swe.x101.EnvelopeType)3 SlotType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1)3 Envelope (com.vividsolutions.jts.geom.Envelope)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2 ValueListType (net.opengis.cat.wrs.v_1_0_2.ValueListType)2 MapUtils (org.apache.commons.collections.MapUtils)2 StringUtils (org.apache.commons.lang.StringUtils)2 XmlObject (org.apache.xmlbeans.XmlObject)2 RegistryConstants (org.codice.ddf.registry.common.RegistryConstants)2 WebMapHelper (org.codice.ddf.registry.schemabindings.helper.WebMapHelper)2 Geometry (com.vividsolutions.jts.geom.Geometry)1 BigInteger (java.math.BigInteger)1 Arrays (java.util.Arrays)1