Search in sources :

Example 1 with BBoxSpatialFilter

use of org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter in project ddf by codice.

the class OpenSearchQuery method addBBoxSpatialFilter.

public void addBBoxSpatialFilter(String bbox) {
    BBoxSpatialFilter bboxFilter = new BBoxSpatialFilter(bbox);
    addSpatialFilter(bboxFilter);
}
Also used : BBoxSpatialFilter(org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter)

Example 2 with BBoxSpatialFilter

use of org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter in project ddf by codice.

the class OpenSearchQueryTest method testBboxSpatialFilterWktConversion.

@Test
public void testBboxSpatialFilterWktConversion() throws Exception {
    // NOTE: BBoxSpatialFilter converts bbox corners to doubles, hence the double values
    // in this expected WKT string
    String expectedGeometryWkt = "POLYGON((0.0 10.0,0.0 30.0,20.0 30.0,20.0 10.0,0.0 10.0))";
    String bboxCorners = "0,10,20,30";
    BBoxSpatialFilter term = new BBoxSpatialFilter(bboxCorners);
    String geometryWkt = term.getGeometryWkt();
    LOGGER.debug("geometryWkt = {}", geometryWkt);
    assertEquals(expectedGeometryWkt, geometryWkt);
}
Also used : BBoxSpatialFilter(org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter) Test(org.junit.Test)

Aggregations

BBoxSpatialFilter (org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter)2 Test (org.junit.Test)1