Search in sources :

Example 26 with BinarySpatialOpType

use of net.opengis.fes._2.BinarySpatialOpType 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(org.locationtech.jts.geom.Geometry) EnvelopeType(net.opengis.gml.v_3_1_1.EnvelopeType) BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType)

Example 27 with BinarySpatialOpType

use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.

the class CswQueryFactoryTest method testPostGetRecordsSpatialTouchesOgcFilter.

@Test
public void testPostGetRecordsSpatialTouchesOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
    BinarySpatialOpType op = createBinarySpatialOpType();
    ogcSpatialQuery(Touches.class, filterObjectFactory.createTouches(op));
}
Also used : BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) Test(org.junit.Test)

Example 28 with BinarySpatialOpType

use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.

the class CswQueryFactoryTest method testPostGetRecordsSpatialWithinOgcFilter.

@Test
public void testPostGetRecordsSpatialWithinOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
    BinarySpatialOpType op = createBinarySpatialOpType();
    ogcSpatialQuery(Within.class, filterObjectFactory.createWithin(op));
}
Also used : BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) Test(org.junit.Test)

Example 29 with BinarySpatialOpType

use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.

the class CswQueryFactoryTest method testPostGetRecordsSpatialIntersectsOgcFilter.

@Test
public void testPostGetRecordsSpatialIntersectsOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
    BinarySpatialOpType op = createBinarySpatialOpType();
    ogcSpatialQuery(Intersects.class, filterObjectFactory.createIntersects(op));
}
Also used : BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) Test(org.junit.Test)

Example 30 with BinarySpatialOpType

use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.

the class CswQueryFactoryTest method createBinarySpatialOpType.

private BinarySpatialOpType createBinarySpatialOpType() {
    BinarySpatialOpType binarySpatialOps = new BinarySpatialOpType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(SPATIAL_TEST_ATTRIBUTE);
    binarySpatialOps.getPropertyName().add(propName);
    binarySpatialOps.setGeometry(createPolygon());
    return binarySpatialOps;
}
Also used : BinarySpatialOpType(net.opengis.filter.v_1_1_0.BinarySpatialOpType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Aggregations

Test (org.junit.Test)34 BinarySpatialOpType (net.opengis.filter.v_1_1_0.BinarySpatialOpType)20 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)18 FilterType (net.opengis.filter.v_2_0_0.FilterType)18 FilterType (net.opengis.filter.v_1_1_0.FilterType)8 ArrayList (java.util.ArrayList)7 FilterCapabilities (net.opengis.filter.v_2_0_0.FilterCapabilities)6 SpatialOperatorType (net.opengis.filter.v_2_0_0.SpatialOperatorType)6 LinearRingType (net.opengis.gml.v_3_1_1.LinearRingType)6 MultiPolygonType (net.opengis.gml.v_3_1_1.MultiPolygonType)6 GeometryOperand (net.opengis.filter.v_2_0_0.GeometryOperandsType.GeometryOperand)4 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)4 PolygonType (net.opengis.gml.v_3_1_1.PolygonType)4 FeatureAttributeDescriptor (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureAttributeDescriptor)3 LineStringType (net.opengis.gml.v_3_1_1.LineStringType)2 JAXBElement (javax.xml.bind.JAXBElement)1 BBOXType (net.opengis.fes._2.BBOXType)1 BinarySpatialOpType (net.opengis.fes._2.BinarySpatialOpType)1 DistanceBufferType (net.opengis.fes._2.DistanceBufferType)1 BBOXType (net.opengis.fes.x20.BBOXType)1