use of ogc.schema.opengis.filter.v_1_0_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;
}
use of ogc.schema.opengis.filter.v_1_0_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;
}
use of ogc.schema.opengis.filter.v_1_0_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);
}
use of ogc.schema.opengis.filter.v_1_0_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);
}
use of ogc.schema.opengis.filter.v_1_0_0.DistanceType in project ddf by codice.
the class CswFilterFactory method createDistanceType.
private DistanceType createDistanceType(double distance, String units) {
DistanceType distanceType = new DistanceType();
distanceType.setUnits(units);
/**
* With the original filter-v_1_1_0-schema_1.1.0.jar, we were unable to set content (the
* actual distance value) on DistanceType. The attribute mixed="true" is missing from the
* complexType DistanceType in filter.xsd. This prevents Beyond and DWithin from working. To
* correct this, we fixed filter.xsd and rebuilt the JAXB bindings (see project
* ogc-filter-v_1_1_0-schema-bindings).
*/
distanceType.setContent(String.valueOf(distance));
return distanceType;
}
Aggregations