use of org.opengis.geometry.Geometry in project ddf by codice.
the class CopyFilterDelegateTest method testSpatialDWithin.
@Test
public void testSpatialDWithin() {
Geometry polygonGeometry = wktToGeometry(POLYGON_WKT);
assertFilterEquals(FF.dwithin(TEST_PROPERTY_VALUE, polygonGeometry, DISTANCE_10, UomOgcMapping.METRE.name()));
}
use of org.opengis.geometry.Geometry in project ddf by codice.
the class CopyFilterDelegateTest method testSpatialBeyond.
@Test
public void testSpatialBeyond() {
Geometry polygonGeometry = wktToGeometry(POLYGON_WKT);
assertFilterEquals(FF.beyond(TEST_PROPERTY_VALUE, polygonGeometry, DISTANCE_10, UomOgcMapping.METRE.name()));
}
use of org.opengis.geometry.Geometry in project ddf by codice.
the class FilterBuilderTest method withinGeoTest.
/**
*
*/
@Test
public void withinGeoTest() {
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(Metacard.GEOGRAPHY).within().wkt(POINT_WKT);
filter.accept(new DefaultFilterVisitor() {
@Override
public Object visit(Within filter, Object data) {
Literal literalWrapper = (Literal) filter.getExpression2();
Geometry geometry = (Geometry) literalWrapper.evaluate(null);
geometry.getCentroid().getCoordinate();
return super.visit(filter, data);
}
}, null);
}
use of org.opengis.geometry.Geometry in project ddf by codice.
the class FilterAdapterTest method testSpatialWrappedGeometry.
@Test
public void testSpatialWrappedGeometry() throws com.vividsolutions.jts.io.ParseException {
WKTReader reader = new WKTReader();
com.vividsolutions.jts.geom.Geometry geo = reader.read(MULTIPOLYGON_WKT);
Geometry geometry = new JTSGeometryWrapper(geo);
assertFilterEquals("beyond(Test,wkt(" + MULTIPOLYGON_WKT + "),10.0)", FF.beyond(TEST_PROPERTY_VALUE, geometry, DISTANCE_10, UomOgcMapping.METRE.name()));
assertFilterEquals("contains(Test,wkt(" + MULTIPOLYGON_WKT + "))", FF.contains(TEST_PROPERTY_VALUE, geometry));
assertFilterEquals("dwithin(Test,wkt(" + MULTIPOLYGON_WKT + "),10.0)", FF.dwithin(TEST_PROPERTY_VALUE, geometry, DISTANCE_10, UomOgcMapping.METRE.name()));
assertFilterEquals("intersects(Test,wkt(" + MULTIPOLYGON_WKT + "))", FF.intersects(TEST_PROPERTY_VALUE, geometry));
assertFilterEquals("within(Test,wkt(" + MULTIPOLYGON_WKT + "))", FF.within(TEST_PROPERTY_VALUE, geometry));
}
use of org.opengis.geometry.Geometry in project ddf by codice.
the class FilterAdapterTest method testSpatialContainsFilter.
@Test
public void testSpatialContainsFilter() {
Geometry polygonGeometry = wktToGeometry(POLYGON_WKT);
assertFilterEquals("contains(Test,wkt(" + POLYGON_WKT + "))", FF.contains(TEST_PROPERTY_VALUE, polygonGeometry));
}
Aggregations