Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory2.intersects()


        geometryFilter = ff.intersects(ff.literal(geometry
            .getEnvelope()), geometryPropertyName);
      } else if (spatialFilterType
          .equals(SpatialFilterType.INDEX_INTERSECTS)) {
        // TODO
        geometryFilter = ff.intersects(ff.literal(geometry),
            geometryPropertyName);
      } else if (spatialFilterType.equals(SpatialFilterType.OVERLAPS)) {
        geometryFilter = ff.overlaps(ff.literal(geometry),
            geometryPropertyName);
      } else if (spatialFilterType.equals(SpatialFilterType.TOUCHES)) {
View Full Code Here


        String geomtryField = featureSource.getSchema()
            .getGeometryDescriptor().getLocalName();
        PropertyName geometryPropertyName = ff.property(geomtryField);
        if (spatialFilterType.equals(SpatialFilterType.INTERSECTS)) {
          geometryFilter = ff.intersects(ff.literal(geometry),
              geometryPropertyName);
        } else if (spatialFilterType.equals(SpatialFilterType.CONTAINS)) {
          geometryFilter = ff.contains(ff.literal(geometry),
              geometryPropertyName);
        } else if (spatialFilterType.equals(SpatialFilterType.CROSSES)) {
View Full Code Here

        } else if (spatialFilterType.equals(SpatialFilterType.CROSSES)) {
          geometryFilter = ff.crosses(ff.literal(geometry),
              geometryPropertyName);
        } else if (spatialFilterType
            .equals(SpatialFilterType.ENVELOPE_INTERSECTS)) {
          geometryFilter = ff.intersects(ff.literal(geometry
              .getEnvelope()), geometryPropertyName);
        } else if (spatialFilterType
            .equals(SpatialFilterType.INDEX_INTERSECTS)) {
          // TODO
          // It is from ArcGIS, but not clear what means
View Full Code Here

              .getEnvelope()), geometryPropertyName);
        } else if (spatialFilterType
            .equals(SpatialFilterType.INDEX_INTERSECTS)) {
          // TODO
          // It is from ArcGIS, but not clear what means
          geometryFilter = ff.intersects(ff.literal(geometry),
              geometryPropertyName);
        } else if (spatialFilterType.equals(SpatialFilterType.OVERLAPS)) {
          geometryFilter = ff.overlaps(ff.literal(geometry),
              geometryPropertyName);
        } else if (spatialFilterType.equals(SpatialFilterType.TOUCHES)) {
View Full Code Here

                case FilterType.GEOMETRY_DISJOINT:
                    return factory.disjoint(geometry1, geometry2);

                case FilterType.GEOMETRY_INTERSECTS:
                    return factory.intersects(geometry1, geometry2);

                case FilterType.GEOMETRY_CROSSES:
                    return factory.crosses(geometry1, geometry2);

                case FilterType.GEOMETRY_WITHIN:
View Full Code Here

        Expression property = this.resultStack.popExpression();

        FilterFactory2 ff = (FilterFactory2) filterFactory; // TODO this cast must be removed. It depends of Geometry implementation

        return ff.intersects(property, geom);
    }

  public PropertyIsEqualTo buildSpatialRelateFilter() throws CQLException {

    Literal pattern = this.resultStack.popLiteral();
View Full Code Here

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        Polygon ls = gf.createPolygon(sf.create(new double[] { 6, 6, 7, 6, 7, 7, 6, 7, 6, 6 }, 2));
        Intersects f = ff.intersects(ff.property("geo"), ff.literal(ls));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(1, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "not-active.13");
View Full Code Here

        }

        private SimpleFeatureCollection filteredCollection(Geometry currentGeom,
                SimpleFeatureCollection subFeatureCollection) {
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
            Filter intersectFilter = ff.intersects(ff.property(dataGeomName),
                    ff.literal(currentGeom));
            SimpleFeatureCollection subFeatureCollectionIntersection = this.subFeatureCollection
                    .subCollection(intersectFilter);
            if (subFeatureCollectionIntersection.size() == 0) {
                subFeatureCollectionIntersection = subFeatureCollection;
View Full Code Here

        Coordinate[] coordinates = { new Coordinate(39, -107), new Coordinate(38, -107),
                new Coordinate(38, -104), new Coordinate(39, -104), new Coordinate(39, -107) };
        LinearRing shell = gf.createLinearRing(coordinates);
        Polygon polygon = gf.createPolygon(shell, null);
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.intersects(ff.property(defaultGeometryName), ff.literal(polygon));
        // System.out.println(filter);
        query.setFilter(filter);

        SimpleFeatureCollection features;
        features = featureSource.getFeatures(query);
View Full Code Here

        caps.addName(BBOX.NAME);
        caps.addName(Crosses.NAME);

        final Geometry geom = new GeometryFactory().createPoint(new Coordinate(0, 0));
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter intersects = ff.intersects(ff.property("geom"), ff.literal(geom));
        Filter bbox = ff.bbox(ff.property("geom"), 0, 0, 1, 1, "EPSG:4326");
        Filter crosses = ff.crosses(ff.property("geom"), ff.literal(geom));
        Filter disjoint = ff.disjoint(ff.property("geom"), ff.literal(geom));
        Filter nonSpatial = ff.equals(ff.property("name"), ff.literal("test"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.