Package org.opengis.filter

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


    }
   
    //Ensure that we exercise the composite primary index with bbox sql
    public void testIt() throws Exception {
        FilterFactory ff = dataStore.getFilterFactory();
        Filter bbox = ff.bbox("geometry", 0, 0, 10, 10, "4326");
        Filter filter = ff.and(bbox,
        ff.and(
                ff.equals(ff.literal("intProperty"), ff.literal(5)),
                ff.equals(ff.literal("doubleProperty"), ff.literal(5))
                ));
View Full Code Here


    }

    public void testEnvelopeBboxFilter() throws Exception {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        // should match only "r2"
        BBOX bbox = ff.bbox(aname("geom"), 2, 3, 4, 5, "EPSG:4326");
        ReferencedEnvelope bounds = dataStore.getFeatureSource(tname("road")).getBounds(
                new Query(null, bbox));
        assertEquals(3, bounds.getMinX(), 1e-3d);
        assertEquals(3, bounds.getMaxX(), 1e-3d);
        assertEquals(0, bounds.getMinY(), 1e-3d);
View Full Code Here

    }

    public void testCountBboxFilter() throws Exception {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        // should match only "r2"
        BBOX bbox = ff.bbox(aname("geom"), 2, 3, 4, 5, "EPSG:4326");
        int count = dataStore.getFeatureSource(tname("road")).getCount(new Query(null, bbox));
        assertEquals(1, count);
    }
}
View Full Code Here

public class SolrGeometryTest extends SolrTestSupport {
    public void testBBOXLimitSplittedFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        BBOX bbox = ff.bbox("geo", -185, -98, 185, 98, "EPSG:" + SOURCE_SRID);
        SimpleFeatureCollection features = featureSource.getFeatures(bbox);
        assertEquals(11, features.size());
    }
    public void testPolygonLimitSplittedFilter() throws Exception {
        init();
View Full Code Here

    public void testClipToWorldFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
                ff.literal("IEEE 802.11b"));
        BBOX bbox = ff.bbox("geo", -190, -190, 190, 190, "EPSG:" + SOURCE_SRID);
        And filter = ff.and(property, bbox);
        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(7, features.size());
    }
    public void testCrossesFilter() throws Exception {
View Full Code Here

    public void testGetFeaturesWithAndLogicFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
                ff.literal("IEEE 802.11b"));
        BBOX bbox = ff.bbox("geo", -1, -1, 10, 10, "EPSG:" + SOURCE_SRID);
        And filter = ff.and(property, bbox);
        SimpleFeatureCollection features = featureSource.getFeatures(filter);
        assertEquals(3, features.size());
    }
View Full Code Here

                    }

                    if( bbox==null ){
                        query2=query;
                    }else{
                        BBOX newFilter = fac.bbox(attName, bbox.getMinX(), bbox.getMinY(),
                                bbox.getMaxX(), bbox.getMaxY(), "EPSG:4326");
                       
                        query2 = new Query(query);
                        query2.setFilter(newFilter);
                    }
View Full Code Here

        OGRDataStore s = new OGRDataStore(getAbsolutePath(STATE_POP), null, null);
        FeatureSource fs = s.getFeatureSource(s.getTypeNames()[0]);
       
        // from one of the GeoServer demo requests
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Filter f = ff.bbox("the_geom", -75.102613, 40.212597, -72.361859,41.512517, null);
        assertEquals(4, fs.getFeatures(f).size());
       
        // mix in an attribute filter
        f = ff.and(f, ff.greater(ff.property("PERSONS"), ff.literal("10000000")));
        assertEquals(6, fs.getFeatures(f).size());  
View Full Code Here

        if (!isGeographySupportAvailable()) {
            return;
        }

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        BBOX bbox = ff.bbox("", -200, -200, 200, 200, "EPSG:4326");
        // should select everything without bombing out
        Query q = new Query(tname("geopoint"));
        q.setFilter(bbox);
        FeatureReader r = dataStore.getFeatureReader(q, Transaction.AUTO_COMMIT);
        assertTrue(r.hasNext());
View Full Code Here

        if (!isGeographySupportAvailable()) {
            return;
        }

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        BBOX bbox = ff.bbox("", -300, -40, -200, 40, "EPSG:4326");
        // should select everything without bombing out
        Query q = new Query(tname("geopoint"));
        q.setFilter(bbox);
        FeatureReader r = dataStore.getFeatureReader(q, Transaction.AUTO_COMMIT);
        assertFalse(r.hasNext());
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.