Package org.opengis.filter

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


                switch (type) {
                case FilterType.GEOMETRY_EQUALS:
                    return factory.equal(geometry1, geometry2);

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

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

                case FilterType.GEOMETRY_CROSSES:
View Full Code Here


                        Geometry geometry = (Geometry) literal;
                        Envelope env = geometry.getEnvelopeInternal();
                        return factory.bbox(geometry1, env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), null );
                    }
                }
                Disjoint disjoint = factory.disjoint(geometry1, geometry2);
                return factory.not( disjoint );
               
            } catch (ClassCastException wrong) {
                throw new SAXException("ogc:propertyName or gml:box required for bbox filter",
                        wrong);
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.disjoint(property, geom);
    }

    public BinarySpatialOperator buildSpatialIntersectsFilter() throws CQLException {
       
        Literal geom = this.resultStack.popLiteral();
View Full Code Here

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        Point ls = gf.createPoint(sf.create(new double[] { 0, 0 }, 2));
        Disjoint f = ff.disjoint(ff.property("geo"), ff.literal(ls));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(2, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "not-active.12");
View Full Code Here

        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"));

        Filter filter = ff.and(Arrays.asList(new Filter[] { intersects, bbox, crosses, disjoint,
                nonSpatial }));
        Filter[] splitted = strategy.splitFilters(caps, filter);
View Full Code Here

 
  private Filter filterBBox(ReferencedEnvelope bBox, SimpleFeatureType ft)
    throws FactoryRegistryException, IllegalFilterException
  {
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
    Disjoint filter = ff.disjoint(ff.property(ft.getGeometryDescriptor().getLocalName()),
            ff.literal(JTS.toGeometry((BoundingBox) bBox)));
    return filter;
  }
}
View Full Code Here

        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LinearRing shell = gf.createLinearRing(sf.create(new double[] { 4, -1, 4, 5, 6, 5, 6, -1,
                4, -1 }, 2));
        Polygon polygon = gf.createPolygon(shell, null);
        Disjoint dj = ff.disjoint(ff.property(aname("geom")), ff.literal(polygon));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(dj);
        checkSingleResult(features, "r2");
    }

    public void testEqualsFilter() throws Exception {
View Full Code Here

      return Filter.INCLUDE;
    }
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
    PropertyName geomExpr = ff.property(ft.getGeometryDescriptor().getLocalName());
    Literal bboxExpr = ff.literal(JTS.toGeometry(bBox));
    Disjoint disjointFilter = ff.disjoint(geomExpr, bboxExpr);
   
    return ff.not(disjointFilter);
  }
}
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.