Search in sources :

Example 6 with SpatialFilter

use of ddf.catalog.impl.filter.SpatialFilter in project ddf by codice.

the class TestOpenSearchSiteUtil method populatePolyGeospatial.

@Test
public void populatePolyGeospatial() throws Exception {
    String wktPolygon = "POLYGON((1 1,5 1,5 5,1 5,1 1))";
    String expectedStr = "1,1,1,5,5,5,5,1,1,1";
    SpatialFilter spatial = new SpatialFilter(wktPolygon);
    WebClient webClient = WebClient.create(url.toString());
    OpenSearchSiteUtil.populateGeospatial(webClient, spatial, false, Arrays.asList("q,src,mr,start,count,mt,dn,lat,lon,radius,bbox,polygon,dtstart,dtend,dateName,filter,sort".split(",")));
    String urlStr = webClient.getCurrentURI().toString();
    assertTrue(urlStr.indexOf(expectedStr) != -1);
    assertTrue(urlStr.indexOf(OpenSearchSiteUtil.GEO_POLY) != -1);
}
Also used : SpatialFilter(ddf.catalog.impl.filter.SpatialFilter) Matchers.containsString(org.hamcrest.Matchers.containsString) WebClient(org.apache.cxf.jaxrs.client.WebClient) Test(org.junit.Test)

Example 7 with SpatialFilter

use of ddf.catalog.impl.filter.SpatialFilter in project ddf by codice.

the class OpenSearchQuery method addGeometrySpatialFilter.

public void addGeometrySpatialFilter(String geometryWkt) {
    SpatialFilter spatialFilter = new SpatialFilter(geometryWkt);
    addSpatialFilter(spatialFilter);
}
Also used : SpatialFilter(ddf.catalog.impl.filter.SpatialFilter) PolygonSpatialFilter(org.codice.ddf.opensearch.query.filter.PolygonSpatialFilter) BBoxSpatialFilter(org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter)

Aggregations

SpatialFilter (ddf.catalog.impl.filter.SpatialFilter)7 SpatialDistanceFilter (ddf.catalog.impl.filter.SpatialDistanceFilter)3 TemporalFilter (ddf.catalog.impl.filter.TemporalFilter)3 Coordinate (com.vividsolutions.jts.geom.Coordinate)2 PropertyIsEqualToLiteral (ddf.catalog.filter.impl.PropertyIsEqualToLiteral)2 BBoxSpatialFilter (org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter)2 PolygonSpatialFilter (org.codice.ddf.opensearch.query.filter.PolygonSpatialFilter)2 SurfaceImpl (org.geotools.geometry.jts.spatialschema.geometry.primitive.SurfaceImpl)2 Filter (org.opengis.filter.Filter)2 Literal (org.opengis.filter.expression.Literal)2 Geometry (org.opengis.geometry.Geometry)2 UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)1 WebClient (org.apache.cxf.jaxrs.client.WebClient)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1