Examples of bbox()


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

            String geomName = schema.getGeometryDescriptor().getName().getLocalPart();
           
            Query query = new Query(schema.getTypeName());
            query.setPropertyNames(Query.ALL_NAMES);           
            ReferencedEnvelope bounds = features.getBounds();
            query.setFilter(ff.bbox(ff.property(geomName), bounds));

            features = featureSource.getFeatures(query);
            // check SimpleFeatureCollection size
            assertEquals(count, features.size());
            assertFalse(features.isEmpty());
View Full Code Here

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

           
            // execute Query that doesn't return any feature
           
            bounds = new ReferencedEnvelope(bounds.getMaxX() + 1, bounds.getMaxX() + 2,
                    bounds.getMaxY() + 1, bounds.getMaxY() + 2, bounds.getCoordinateReferenceSystem());
            query.setFilter(ff.bbox(ff.property(geomName), bounds));           

            features = featureSource.getFeatures(query);
            // check SimpleFeatureCollection size
            assertEquals(0, features.size());
            assertTrue(features.isEmpty());
View Full Code Here

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

        Query query = new Query( schema.getTypeName() );
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        String geomName = schema.getGeometryDescriptor().getName().getLocalPart();
        ReferencedEnvelope bounds = featureSource.getBounds();
        bounds.expandBy(-bounds.getWidth() / 2, -bounds.getHeight() / 2);
        query.setFilter( ff.bbox( ff.property(geomName), bounds) );
        SimpleFeatureCollection features = featureSource.getFeatures( query );
        SimpleFeatureIterator iterator = features.features();
        try {
            iterator.next();
        } finally {
View Full Code Here

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

        final WFS_1_0_0_DataStore wfs = WFSDataStoreReadTest.getDataStore(url);
        final SimpleFeatureType ft = wfs.getSchema(TO_EDIT_TYPE);
        final ReferencedEnvelope bounds = wfs.getFeatureSource(TO_EDIT_TYPE).getBounds();
       
        final FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
        final BBOX bbox = ff.bbox("the_geom", bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY(), null);
       
        /**
         * This one does not implement the deprecated geotools filter interfaces
         */
        final BBOX strictBBox = new BBOX() {
View Full Code Here

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

        GeometryDescriptor gd = schema.getGeometryDescriptor();
        assertNotNull(gd);
        assertEquals("geo2", gd.getLocalName());

        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        BBOX bbox = ff.bbox("", 6.5, 23.5, 7.5, 24.5, "EPSG:4326");
        SimpleFeatureCollection features = featureSource.getFeatures(bbox);
        assertEquals(1, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "active.9");
View Full Code Here

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

    @Test
    public void testBBoxQuery() throws Exception {
        ContentFeatureSource featureSource = store.getFeatureSource("gttestdb.counties");
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // pueblo county
        BBOX bbox = ff.bbox("geometry", -105.050678,37.734704,-104.053921,38.522548,null);
       
        Query query = new Query("geometry", bbox);
        assertEquals(1, featureSource.getCount(query));
       
        FeatureReader<SimpleFeatureType, SimpleFeature> reader = featureSource.getReader(query);
View Full Code Here

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

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
       
        String attName = ds.getSchema(TYPE_NAME).getGeometryDescriptor().getLocalName();
        ReferencedEnvelope bounds = ds.getBounds(new Query(TYPE_NAME));
       
        BBOX filter = ff.bbox(ff.property(attName),bounds);
       
       
       
        Query query=new Query(TYPE_NAME, filter);
       
View Full Code Here

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

       
        // take atleast attributeType 3 to avoid the undeclared one .. inherited optional attrs
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Query query = new Query(featureType.getTypeName());
        PropertyName theGeom = ff.property( featureType.getGeometryDescriptor().getName() );
        Filter filter = ff.bbox( theGeom, bbox.getMinX(), bbox.getMinY(), bbox.getMaxX(), bbox.getMaxY(), "EPSG:4326" );
               
        query.setFilter( filter );
        //query.setMaxFeatures(3);
        if(get){
            //  get
View Full Code Here

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

        // if the filter is an Or we can't know
        Filter filter = ff.or(intersects, bbox);
        Filter[] splitted = strategy.splitFilters(caps, filter);
        Filter supported = splitted[0];
View Full Code Here

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

        ds.setAxisOrder(WFSDataStore.AXIS_ORDER_COMPLIANT, WFSDataStore.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
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.