org.opengis.filter.spatial.Overlaps Java Examples

The following examples show how to use org.opengis.filter.spatial.Overlaps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StyleConverterServiceTest.java    From geomajas-project-server with GNU Affero General Public License v3.0 6 votes vote down vote up
@Test
public void testFilters() throws LayerException {
	Style style = styleConverterService.convert(layerBeansMixedGeometryStyleInfoSld.getUserStyle());
	List<Rule> rules = style.featureTypeStyles().get(0).rules();
	assertThat(rules.get(0).getFilter()).isInstanceOf(BBOX.class);
	assertThat(rules.get(1).getFilter()).isInstanceOf(Contains.class);
	assertThat(rules.get(2).getFilter()).isInstanceOf(Crosses.class);
	assertThat(rules.get(3).getFilter()).isInstanceOf(Disjoint.class);
	assertThat(rules.get(4).getFilter()).isInstanceOf(Equals.class);
	assertThat(rules.get(5).getFilter()).isInstanceOf(Intersects.class);
	assertThat(rules.get(6).getFilter()).isInstanceOf(Overlaps.class);
	assertThat(rules.get(7).getFilter()).isInstanceOf(Touches.class);
	assertThat(rules.get(8).getFilter()).isInstanceOf(Within.class);
	NamedStyleInfo namedStyleInfo = styleConverterService.convert(
			layerBeansMixedGeometryStyleInfoSld.getUserStyle(), featureInfo);
	Assert.assertEquals(9, namedStyleInfo.getFeatureStyles().size());
}
 
Example #2
Source File: ElasticGeometryFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testOverlapsFilter() throws Exception {
    init("not-active","geo3");
    FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
    GeometryFactory gf = new GeometryFactory();
    PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
    Polygon ls = gf.createPolygon(sf.create(
            new double[] { 5.5, 6, 7, 6, 7, 7, 5.5, 7, 5.5, 6 }, 2));
    Overlaps f = ff.overlaps(ff.property("geo3"), ff.literal(ls));
    SimpleFeatureCollection features = featureSource.getFeatures(f);
    assertEquals(1, features.size());
    SimpleFeatureIterator fsi = features.features();
    assertTrue(fsi.hasNext());
    assertEquals(fsi.next().getID(), "active.13");
}
 
Example #3
Source File: PropertyIgnoringFilterVisitor.java    From geowave with Apache License 2.0 5 votes vote down vote up
@Override
public Object visit(final Overlaps filter, final Object extraData) {
  if (!usesProperty(filter)) {
    return Filter.INCLUDE;
  }
  return super.visit(filter, extraData);
}
 
Example #4
Source File: PropertyIgnoringFilterVisitor.java    From geowave with Apache License 2.0 5 votes vote down vote up
@Override
public Object visit(final Overlaps filter, final Object extraData) {
  if (!usesProperty(filter)) {
    return Filter.INCLUDE;
  }
  return super.visit(filter, extraData);
}
 
Example #5
Source File: ExtractGeometryFilterVisitor.java    From geowave with Apache License 2.0 5 votes vote down vote up
@Override
public Object visit(final Overlaps filter, Object data) {
  if (!attributeOfInterest.equals(filter.getExpression1().toString())) {
    return new ExtractGeometryFilterVisitorResult(infinity(), null);
  }
  data = filter.getExpression2().accept(this, data);

  return new ExtractGeometryFilterVisitorResult((Geometry) data, CompareOperation.OVERLAPS);
}
 
Example #6
Source File: FilterToElastic.java    From elasticgeo with GNU General Public License v3.0 4 votes vote down vote up
public Object visit(Overlaps filter, Object extraData) {
    return visitBinarySpatialOperator(filter, extraData);
}
 
Example #7
Source File: ExtractTimeFilterVisitor.java    From geowave with Apache License 2.0 4 votes vote down vote up
@Override
public Object visit(final Overlaps filter, final Object data) {
  return new TemporalConstraints();
}
 
Example #8
Source File: CriteriaVisitor.java    From geomajas-project-server with GNU Affero General Public License v3.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public Object visit(Overlaps filter, Object userData) {
	String finalName = parsePropertyName(geomName, userData);
	return SpatialRestrictions.overlaps(finalName, asGeometry(getLiteralValue(filter.getExpression2())));
}