Package org.opengis.filter

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


        assertEquals(1, fids.size());
       
        ContentFeatureCollection coll = store.getFeatures();
        assertEquals(4, coll.size());
              
        coll = store.getFeatures( new Query(simpleTypeName1.getLocalPart(), filterfac.equals(filterfac.property("NAME"), filterfac.literal("mypoint"))) );
        assertEquals(1, coll.size());
       
        SimpleFeature feature = coll.features().next();
        assertEquals(feat.getAttributes(), feature.getAttributes());       
    }
View Full Code Here


        while (it.hasNext()) {
            System.err.println(it.next());
        }
        assertEquals(3, coll.size());
              
        coll = store.getFeatures( new Query(simpleTypeName1.getLocalPart(), filterfac.equals(filterfac.property("NAME"), filterfac.literal("mypoint"))) );
        it= coll.features();
        while (it.hasNext()) {
            System.err.println(it.next());
        }
        assertEquals(1, coll.size());       
View Full Code Here

        }

        private SimpleFeatureCollection filteredCollection(Geometry currentGeom,
                SimpleFeatureCollection subFeatureCollection) {
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
            Filter intersectFilter = ff.intersects(ff.property(dataGeomName),
                    ff.literal(currentGeom));
            SimpleFeatureCollection subFeatureCollectionIntersection = this.subFeatureCollection
                    .subCollection(intersectFilter);
            if (subFeatureCollectionIntersection.size() == 0) {
                subFeatureCollectionIntersection = subFeatureCollection;
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[] { 1, 1 }, 2));
        Beyond f = ff.beyond(ff.property("geo"), ff.literal(ls), 1, SI.METRE.getSymbol());
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(1, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "not-active.13");
View Full Code Here

   
    @Test
    public void testFilter() throws Exception {
        ContentFeatureSource featureSource = store.getFeatureSource("gttestdb.counties");
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        PropertyIsEqualTo isPueblo = ff.equal(ff.property("Name"),ff.literal("Pueblo"),true);
        ContentFeatureCollection features = featureSource.getFeatures(isPueblo);
        assertEquals(1, count(features));
    }

    @Test
View Full Code Here

        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

        SimpleFeatureType featureType = wfs.getSchema(typeName);
       
        // 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){
View Full Code Here

        store.addFeatures(features);
        SimpleFeatureCollection featureCollection = store.getFeatureSource("polygons").getFeatures();

        // Test the Function
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
        Function exp = ff.function("octagonalenvelope", ff.property("geom"));
        SimpleFeatureIterator iter = featureCollection.features();
        while (iter.hasNext()) {
            SimpleFeature feature = iter.next();
            Geometry geom = (Geometry) feature.getDefaultGeometry();
            Geometry octagonalEnvelope = new OctagonalEnvelope(geom).toGeometry(geom.getFactory());
View Full Code Here

        caps.addName(BBOX.NAME);
        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);
View Full Code Here

        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

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.