Search in sources :

Example 1 with DistanceType

use of net.opengis.filter.v_1_1_0.DistanceType in project ddf by codice.

the class CswQueryFactoryTest method createDistanceBufferType.

private DistanceBufferType createDistanceBufferType() {
    DistanceBufferType distanceBuffer = new DistanceBufferType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(SPATIAL_TEST_ATTRIBUTE);
    distanceBuffer.setPropertyName(propName);
    DistanceType distance = filterObjectFactory.createDistanceType();
    distance.setUnits(REL_GEO_UNITS);
    distance.setContent(Double.toString(REL_GEO_DISTANCE));
    distanceBuffer.setDistance(distance);
    distanceBuffer.setGeometry(createPolygon());
    return distanceBuffer;
}
Also used : DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) DistanceType(net.opengis.filter.v_1_1_0.DistanceType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 2 with DistanceType

use of net.opengis.filter.v_1_1_0.DistanceType in project ddf by codice.

the class CswFilterFactory method createDistanceBufferType.

@SuppressWarnings("unchecked")
private DistanceBufferType createDistanceBufferType(PropertyNameType propertyName, JAXBElement<? extends AbstractGeometryType> geometry, DistanceType distance) {
    DistanceBufferType distanceBuffer = new DistanceBufferType();
    distanceBuffer.setDistance(distance);
    distanceBuffer.setGeometry((JAXBElement<AbstractGeometryType>) geometry);
    distanceBuffer.setPropertyName(propertyName);
    return distanceBuffer;
}
Also used : AbstractGeometryType(net.opengis.gml.v_3_1_1.AbstractGeometryType) DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType)

Example 3 with DistanceType

use of net.opengis.filter.v_1_1_0.DistanceType in project ddf by codice.

the class WfsFilterDelegate method buildDistanceBufferType.

private JAXBElement<DistanceBufferType> buildDistanceBufferType(JAXBElement<DistanceBufferType> dbt, String propertyName, String wkt, double distance) {
    DistanceType distanceType = new DistanceType();
    distanceType.setContent(Double.toString(distance));
    // the filter adapter normalizes all distances to meters
    distanceType.setUnits(WfsConstants.METERS);
    dbt.getValue().setDistance(distanceType);
    dbt.getValue().setGeometry(createPoint(wkt));
    dbt.getValue().setPropertyName(createPropertyNameType(propertyName).getValue());
    return dbt;
}
Also used : DistanceType(ogc.schema.opengis.filter.v_1_0_0.DistanceType)

Example 4 with DistanceType

use of net.opengis.filter.v_1_1_0.DistanceType in project ddf by codice.

the class CswFilterFactory method createBeyondType.

private JAXBElement<DistanceBufferType> createBeyondType(String propertyName, String wkt, double distance) {
    wkt = convertWktToLatLonOrdering(wkt);
    Geometry geometry = getGeometryFromWkt(wkt);
    JAXBElement<? extends AbstractGeometryType> geometryJaxbElement = convertGeometry(geometry);
    PropertyNameType propertyNameType = createPropertyNameType(propertyName);
    DistanceType distanceType = createDistanceType(distance, CswConstants.METERS);
    DistanceBufferType distanceBufferType = createDistanceBufferType(propertyNameType, geometryJaxbElement, distanceType);
    return filterObjectFactory.createBeyond(distanceBufferType);
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) DistanceType(net.opengis.filter.v_1_1_0.DistanceType) DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 5 with DistanceType

use of net.opengis.filter.v_1_1_0.DistanceType in project ddf by codice.

the class CswFilterFactory method createDWithinType.

private JAXBElement<DistanceBufferType> createDWithinType(String propertyName, String wkt, double distance) {
    wkt = convertWktToLatLonOrdering(wkt);
    Geometry geometry = getGeometryFromWkt(wkt);
    JAXBElement<? extends AbstractGeometryType> geometryJaxbElement = convertGeometry(geometry);
    PropertyNameType propertyNameType = createPropertyNameType(propertyName);
    DistanceType distanceType = createDistanceType(distance, CswConstants.METERS);
    DistanceBufferType distanceBufferType = createDistanceBufferType(propertyNameType, geometryJaxbElement, distanceType);
    return filterObjectFactory.createDWithin(distanceBufferType);
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) DistanceType(net.opengis.filter.v_1_1_0.DistanceType) DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Aggregations

DistanceBufferType (net.opengis.filter.v_1_1_0.DistanceBufferType)4 DistanceType (net.opengis.filter.v_1_1_0.DistanceType)4 PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)3 Geometry (com.vividsolutions.jts.geom.Geometry)2 AbstractGeometryType (net.opengis.gml.v_3_1_1.AbstractGeometryType)1 DistanceType (ogc.schema.opengis.filter.v_1_0_0.DistanceType)1