Search in sources :

Example 26 with Geometry

use of org.opengis.geometry.Geometry in project ddf by codice.

the class FilterAdapterTest method testSspatialCrossesFilter.

@Test
public void testSspatialCrossesFilter() {
    Geometry polygonGeometry = wktToGeometry(POLYGON_WKT);
    assertFilterEquals("crosses(Test,wkt(" + POLYGON_WKT + "))", FF.crosses(TEST_PROPERTY_VALUE, polygonGeometry));
}
Also used : Geometry(org.opengis.geometry.Geometry) Test(org.junit.Test)

Example 27 with Geometry

use of org.opengis.geometry.Geometry in project ddf by codice.

the class FilterAdapterTest method testSpatialBeyondFilter.

@Test
public void testSpatialBeyondFilter() {
    Geometry polygonGeometry = wktToGeometry(POLYGON_WKT);
    // meters
    assertFilterEquals("beyond(Test,wkt(" + POLYGON_WKT + "),10.0)", FF.beyond(TEST_PROPERTY_VALUE, polygonGeometry, DISTANCE_10, UomOgcMapping.METRE.name()));
    // feet
    assertFilterEquals("beyond(Test,wkt(" + POLYGON_WKT + "),3.048006096012192)", FF.beyond(TEST_PROPERTY_VALUE, polygonGeometry, DISTANCE_10, UomOgcMapping.FOOT.name()));
    // nearest neighbor
    assertFilterEquals("nn(Test,wkt(" + POLYGON_WKT + "))", FF.beyond(TEST_PROPERTY_VALUE, polygonGeometry, 0, UomOgcMapping.METRE.name()));
}
Also used : Geometry(org.opengis.geometry.Geometry) Test(org.junit.Test)

Example 28 with Geometry

use of org.opengis.geometry.Geometry in project ddf by codice.

the class FilterAdapterTest method testSpatialIntersectsFilter.

@Test
public void testSpatialIntersectsFilter() {
    Geometry polygonGeometry = wktToGeometry(POLYGON_WKT);
    assertFilterEquals("intersects(Test,wkt(" + POLYGON_WKT + "))", FF.intersects(TEST_PROPERTY_VALUE, polygonGeometry));
}
Also used : Geometry(org.opengis.geometry.Geometry) Test(org.junit.Test)

Aggregations

Geometry (org.opengis.geometry.Geometry)28 Test (org.junit.Test)22 Filter (org.opengis.filter.Filter)5 SpatialDistanceFilter (ddf.catalog.impl.filter.SpatialDistanceFilter)4 SpatialFilter (ddf.catalog.impl.filter.SpatialFilter)4 TemporalFilter (ddf.catalog.impl.filter.TemporalFilter)4 JTSGeometryWrapper (ddf.catalog.impl.filter.JTSGeometryWrapper)2 BBoxSpatialFilter (org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter)2 PolygonSpatialFilter (org.codice.ddf.opensearch.query.filter.PolygonSpatialFilter)2 GeometryBuilder (org.geotools.geometry.GeometryBuilder)2 PrimitiveFactoryImpl (org.geotools.geometry.jts.spatialschema.geometry.primitive.PrimitiveFactoryImpl)2 WKTParser (org.geotools.geometry.text.WKTParser)2 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)2 ParseException (com.vividsolutions.jts.io.ParseException)1 WKTReader (com.vividsolutions.jts.io.WKTReader)1 FilterBuilder (ddf.catalog.filter.FilterBuilder)1 GeotoolsFilterBuilder (ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder)1 ParseException (java.text.ParseException)1 DefaultFilterVisitor (org.geotools.filter.visitor.DefaultFilterVisitor)1 Ignore (org.junit.Ignore)1