Package org.opengis.filter

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


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

        Filter filter = ff.and(Arrays.asList(new Filter[] { intersects, bbox, crosses, disjoint,
View Full Code Here


    CoordinateReferenceSystem targetCRS = schema.getGeometryDescriptor()
            .getCoordinateReferenceSystem();
   
    ReferencedEnvelope bbox = new ReferencedEnvelope(x1, y1, x2, y2, targetCRS);
   
    Filter filter = ff.bbox(ff.property(geometryPropertyName), bbox);
    return featureSource.getFeatures(filter);
}

// grabFeaturesInBoundingBox end
View Full Code Here

    // will result in a polygon matching the original click
    Polygon clickPolygon = JTS.toGeometry(bbox, null, 10);
    MathTransform transform = CRS.findMathTransform(worldCRS, targetCRS);
    Polygon polygon = (Polygon) JTS.transform(clickPolygon, transform);
   
    Filter filter1 = ff.bbox(ff.property(geometryPropertyName), bbox);
    Filter filter2 = ff.intersects(ff.property(geometryPropertyName), ff.literal(polygon));
   
    Filter filter = ff.and(filter1, filter2);
   
    return featureSource.getFeatures(filter);
View Full Code Here

    ReferencedEnvelope bbox = worldBBox.transform(targetCRS, true, 10);
   
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();

    // Option 1 BBOX
    Filter filter = ff.bbox(ff.property(geometryAttributeName), bbox);
   
    // Option 2 Intersects
    // Filter filter = ff.intersects(ff.property(geometryAttributeName), ff.literal(bbox));
   
    return featureSource.getFeatures(filter);
View Full Code Here

    SimpleFeatureIterator it = polygonCollection.features();
    try {
        while (it.hasNext()) {
            feature = it.next();
            BoundingBox bounds = feature.getBounds();
            boundsCheck = ff.bbox(ff.property("the_geom"), bounds);
           
            Geometry geom = (Geometry) feature.getDefaultGeometry();
            polyCheck = ff.intersects(ff.property("the_geom"), ff.literal(geom));
           
            andFil = ff.and(boundsCheck, polyCheck);
View Full Code Here

    double y2 = 0;
   
    // bbox start
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    ReferencedEnvelope bbox = new ReferencedEnvelope(x1, x2, y1, y2, DefaultGeographicCRS.WGS84 );
    Filter filter = ff.bbox(ff.property("the_geom"), bbox);
    // bbox end
}
}
View Full Code Here

       
        Feature f1 = SimpleFeatureBuilder.build(type, new Object[] { "testFeature1", gf.createPoint(new Coordinate(10, 20, 30)) }, null);
        Feature f2 = SimpleFeatureBuilder.build(type, new Object[] { "testFeature2", gf.createPoint(new Coordinate(10, 10, 60)) }, null);
       
        BoundingBox3D envelope1 = new ReferencedEnvelope3D( 0, 50, 0, 50, 0, 50, null);
        Filter bbox1 = ff.bbox(ff.property("geom"), envelope1);
        BoundingBox3D envelope2 = new ReferencedEnvelope3D( 0, 50, 0, 50, 50, 100, null);
        Filter bbox2 = ff.bbox(ff.property("geom"), envelope2);
       
        assertTrue(bbox1.evaluate(f1));
        assertFalse(bbox1.evaluate(f2));
View Full Code Here

        Feature f2 = SimpleFeatureBuilder.build(type, new Object[] { "testFeature2", gf.createPoint(new Coordinate(10, 10, 60)) }, null);
       
        BoundingBox3D envelope1 = new ReferencedEnvelope3D( 0, 50, 0, 50, 0, 50, null);
        Filter bbox1 = ff.bbox(ff.property("geom"), envelope1);
        BoundingBox3D envelope2 = new ReferencedEnvelope3D( 0, 50, 0, 50, 50, 100, null);
        Filter bbox2 = ff.bbox(ff.property("geom"), envelope2);
       
        assertTrue(bbox1.evaluate(f1));
        assertFalse(bbox1.evaluate(f2));
        assertFalse(bbox2.evaluate(f1));
        assertTrue(bbox2.evaluate(f2));
View Full Code Here

        wfs.setAxisOrderOverride(WFSDataStoreFactory.AXIS_ORDER_COMPLIANT, WFSDataStoreFactory.AXIS_ORDER_NORTH_EAST);
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Set<FeatureId> fids = new HashSet<FeatureId>();
        fids.add(new FeatureIdImpl("comuni11.2671"));
        Query query = new Query(typeName, ff.bbox("the_geom", 4623055.0, 815134.0, 4629904.0, 820740.0, "EPSG:3857"));
       
        SimpleFeatureSource source = ds.getFeatureSource(typeName);
        source.getFeatures(query).features();
        BBOX filter = (BBOX)wfs.getRequest().getFilter();
       
View Full Code Here

        wfs.setAxisOrderOverride(WFSDataStoreFactory.AXIS_ORDER_COMPLIANT, WFSDataStoreFactory.AXIS_ORDER_EAST_NORTH);
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Set<FeatureId> fids = new HashSet<FeatureId>();
        fids.add(new FeatureIdImpl("comuni11.2671"));
        Query query = new Query(typeName, ff.bbox("the_geom", 4623055.0, 815134.0, 4629904.0, 820740.0, "EPSG:3857"));
       
        SimpleFeatureSource source = ds.getFeatureSource(typeName);
        source.getFeatures(query).features();
        BBOX filter = (BBOX)wfs.getRequest().getFilter();
       
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.