Package org.opengis.filter.spatial

Examples of org.opengis.filter.spatial.BBOX


        if (!isGeographySupportAvailable()) {
            return;
        }

        // should match only "r2"
        BBOX bbox = ff.bbox(aname("geo"), -120, 25, -100, 40, "EPSG:4326");
        FeatureCollection features = dataStore.getFeatureSource(tname("geopoint"))
                .getFeatures(bbox);
        assertEquals(2, features.size());
    }
View Full Code Here


    private static final FilterFactory2 FF = CommonFactoryFinder.getFilterFactory2(null);

    public void testBBOX() throws Exception {
        StringBuilder builder = new StringBuilder(URL_LAYER_ASIA);
        SFSFilterVisitor visitor = new SFSFilterVisitor(true);
        BBOX bbox = FF.bbox("prop0", 0, 0, 10, 10, "EPSG:4326");
        visitor.visit(bbox, null);
        visitor.finish(builder, false);
        assertEquals(URL_LAYER_ASIA + "?bbox=0.0,0.0,10.0,10.0", URLDecoder.decode(builder.toString(),"UTF-8"));
    }
View Full Code Here

    private static final FilterFactory2 FF = CommonFactoryFinder.getFilterFactory2(null);

    public void testBBOX() throws Exception {
        StringBuilder builder = new StringBuilder(URL);
        GeoRestFilterVisitor visitor = new GeoRestFilterVisitor(true);
        BBOX bbox = FF.bbox("prop0", 0, 0, 10, 10, "EPSG:4326");
        visitor.visit(bbox, null);
        visitor.finish(builder, false);
        Assert.assertEquals(URL + "?bbox=0.0,0.0,10.0,10.0", builder.toString());
    }
View Full Code Here

    protected abstract JDBCDataStoreAPITestSetup createTestSetup();

    public void testBboxFilter() throws Exception {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        // should match only "r2"
        BBOX bbox = ff.bbox(aname("geom"), 2, 3, 4, 5, "EPSG:4326");
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(bbox);
        checkSingleResult(features, "r2");
    }
View Full Code Here

    }
   
    public void testBboxFilterDefault() throws Exception {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        // should match only "r2"
        BBOX bbox = ff.bbox("", 2, 3, 4, 5, "EPSG:4326");
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(bbox);
        checkSingleResult(features, "r2");
    }
View Full Code Here

    }
   
    public void testGetFeaturesWithLogicFilter() throws Exception {
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo property = ff.equals(ff.property(aname("stringProperty")), ff.literal("one"));
        BBOX bbox = ff.bbox(aname("geometry"), -20, -20, 20, 20, "EPSG:4326");
        And filter = ff.and(property, bbox);

        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(1, features.size());
View Full Code Here

        FeatureSource fs = featureType.getFeatureSource(null, null);
       
        // build the bbox filter
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
       
        BBOX filter = ff.bbox(geom.getLocalName(), nativeEnv.getMinX(),
                nativeEnv.getMinY(), nativeEnv.getMaxX(), nativeEnv.getMaxY(), null);

        // build an optimized query (only the necessary attributes
        Query q = new Query();
        q.setFilter(filter);
View Full Code Here

                if (reproject) {
                    aoi = aoi.transform(sourceCrs, true);
                }
              // apply filters.
                // 1) bbox filter
                BBOX bboxFilter = filterFactory.bbox(schema.getGeometryDescriptor().getLocalName(),
                        aoi.getMinX() , aoi.getMinY(), aoi.getMaxX(), aoi.getMaxY(), null);
                Query q = new Query(schema.getTypeName(), bboxFilter);
               
                String mapId = null;              
View Full Code Here

            ReferencedEnvelope renderingBBOX = new ReferencedEnvelope(expanded, getMap.getCrs());
            ReferencedEnvelope queryBBOX = renderingBBOX.transform(fs.getSchema().getCoordinateReferenceSystem(), true);
           
            // setup the query
            Query query = layer.getQuery();
            BBOX bbox = FF.bbox(FF.property(""), queryBBOX);
            if(query.getFilter() == null || query.getFilter() == Filter.INCLUDE) {
                query.setFilter(bbox);
            } else {
                Filter and = FF.and(query.getFilter(), bbox);
                query.setFilter(and);
View Full Code Here

        FeatureSource fs = featureType.getFeatureSource(null, null);
       
        // build the bbox filter
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
       
        BBOX filter = ff.bbox(geom.getLocalName(), nativeEnv.getMinX(),
                nativeEnv.getMinY(), nativeEnv.getMaxX(), nativeEnv.getMaxY(), null);

        // build an optimized query (only the necessary attributes
        Query q = new Query();
        q.setFilter(filter);
View Full Code Here

TOP

Related Classes of org.opengis.filter.spatial.BBOX

Copyright © 2018 www.massapicom. 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.