use of org.codice.ddf.opensearch.query.filter.PolygonSpatialFilter in project ddf by codice.
the class OpenSearchQuery method addPolygonSpatialFilter.
public void addPolygonSpatialFilter(String polygon) {
PolygonSpatialFilter polygonFilter = new PolygonSpatialFilter(polygon);
addSpatialFilter(polygonFilter);
}
use of org.codice.ddf.opensearch.query.filter.PolygonSpatialFilter in project ddf by codice.
the class OpenSearchQueryTest method testPolygonSpatialFilterWktConversion.
@Test
public void testPolygonSpatialFilterWktConversion() throws Exception {
// WKT is lon/lat, polygon is lat/lon
String expectedGeometryWkt = "POLYGON((10 0,30 0,30 20,10 20,10 0))";
String latLon = "0,10,0,30,20,30,20,10,0,10";
PolygonSpatialFilter term = new PolygonSpatialFilter(latLon);
String geometryWkt = term.getGeometryWkt();
LOGGER.debug("geometryWkt = {}", geometryWkt);
assertEquals(expectedGeometryWkt, geometryWkt);
}
Aggregations