use of org.codice.ddf.opensearch.endpoint.query.filter.PolygonSpatialFilter in project ddf by codice.
the class OpenSearchQueryTest method testPolygonSpatialFilterWktConversion.
@Test
public void testPolygonSpatialFilterWktConversion() {
// 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);
}
use of org.codice.ddf.opensearch.endpoint.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);
}
Aggregations