use of org.opengis.filter.spatial.Intersects in project ddf by codice.
the class OpenSearchFilterVisitorTest method testIntersectsWithMultipolygonECQL.
@Test
public void testIntersectsWithMultipolygonECQL() throws CQLException {
Intersects multipolygonFilter = (Intersects) ECQL.toFilter(ECQL_MULTIPOLYGON);
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.OR);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(multipolygonFilter, openSearchFilterVisitorObject);
assertThat(result.getPointRadiusSearches(), is(empty()));
assertThat(result.getGeometrySearches(), contains(hasToString(is(WKT_MULTI_POLYGON))));
}
use of org.opengis.filter.spatial.Intersects in project ddf by codice.
the class OpenSearchFilterVisitorTest method testIntersectsWithCollection.
@Test
public void testIntersectsWithCollection() {
Intersects intersectsFilter = (Intersects) geotoolsFilterBuilder.attribute(SPATIAL_ATTRIBUTE_NAME).intersecting().wkt(WKT_GEO_COLLECTION);
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.OR);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(intersectsFilter, openSearchFilterVisitorObject);
assertThat(result.getPointRadiusSearches(), is(empty()));
assertThat(result.getGeometrySearches(), contains(hasToString(is(WKT_GEO_COLLECTION))));
}
use of org.opengis.filter.spatial.Intersects in project ddf by codice.
the class FilterBuilderTest method intersects.
@Test
public void intersects() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(Metacard.GEOGRAPHY).intersecting().wkt(POINT_WKT);
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(Intersects.class), any());
}
use of org.opengis.filter.spatial.Intersects in project ddf by codice.
the class OpenSearchFilterVisitorTest method testIntersectsOrNest.
@Test
public void testIntersectsOrNest() {
Intersects intersectsFilter = (Intersects) geotoolsFilterBuilder.attribute(SPATIAL_ATTRIBUTE_NAME).intersecting().wkt(WKT_POLYGON);
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.OR);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(intersectsFilter, openSearchFilterVisitorObject);
assertThat(result.getPointRadiusSearches(), is(empty()));
assertThat(result.getGeometrySearches(), contains(hasToString(is(WKT_POLYGON))));
}
use of org.opengis.filter.spatial.Intersects in project ddf by codice.
the class OpenSearchFilterVisitorTest method testIntersectsCqlFilter.
@Test
public void testIntersectsCqlFilter() throws CQLException {
Intersects intersectsFilter = (Intersects) ECQL.toFilter("(INTERSECTS(" + SPATIAL_ATTRIBUTE_NAME + ", " + WKT_POLYGON + "))");
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.AND);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(intersectsFilter, openSearchFilterVisitorObject);
assertThat(result.getGeometrySearches(), contains(hasToString(is(WKT_POLYGON))));
}
Aggregations