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);
}
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);
}
Aggregations