Package org.opengis.filter

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


        Geometry[] geometries = {point};
        GeometryCollection geometry = new GeometryCollection(geometries, factory );

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);

        PropertyName geomName = ff.property(aname("geo"));
        Literal lit = ff.literal(geometry);
       
        DWithin dwithinGeomFilter  = ((FilterFactory2) ff).dwithin(geomName, lit, distance, unit);
        Query query = new Query(tname("geopoint"), dwithinGeomFilter);
        SimpleFeatureCollection features = dataStore.getFeatureSource(tname("geopoint")).getFeatures(query);
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("mincircle", ff.property("geom"));
        SimpleFeatureIterator iter = featureCollection.features();
        while (iter.hasNext()) {
            SimpleFeature feature = iter.next();
            Geometry geom = (Geometry) feature.getDefaultGeometry();
            Geometry circle = new MinimumBoundingCircle(geom).getCircle();
View Full Code Here

        m.put(WFSDataStoreFactory.TIMEOUT.key, new Integer(100000));
        WFS_1_0_0_DataStore wfs = (WFS_1_0_0_DataStore) (new WFSDataStoreFactory())
                .createDataStore(m);
        FilterFactory2 fac = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());

        Filter filter = fac.equals(fac.property("NAME"), fac.literal("E 58th St"));

        Query query = new Query("tiger:tiger_roads", filter);
        FeatureReader<SimpleFeatureType, SimpleFeature> reader = wfs.getFeatureReader(query,
                new DefaultTransaction());
        int expected = 0;
View Full Code Here

                            new Coordinate(-90.638329, 42.509361),
                            new Coordinate(-89.834618, 42.50346),
                            new Coordinate(-88.071564, 37.51099) }), new LinearRing[] {}) });
            mp.setUserData("http://www.opengis.net/gml/srs/epsg.xml#" + EPSG_CODE);

            PropertyName geometryAttributeExpression = filterFac.property(ft
                    .getGeometryDescriptor().getLocalName());
            PropertyIsNull geomNullCheck = filterFac.isNull(geometryAttributeExpression);
            Query query = new Query(typename, filterFac.not(geomNullCheck), 1,
                    Query.ALL_NAMES, null);
            SimpleFeatureIterator inStore = fs.getFeatures(query).features();
View Full Code Here

        WFSFeatureSource fs = wfs.getFeatureSource("topp:states");
       
        // build a filter with bits that cannot be encoded in OGC filter, but can be simplified
        // to one that can
        Filter f = ff.or(Arrays.asList(Filter.EXCLUDE, ff.and(Filter.INCLUDE, ff.greater(ff.property("PERSONS"), ff.literal(10000000)))));
        SimpleFeatureCollection fc = fs.getFeatures(f);
       
        // force calling a HITS query, it used to throw an exception
        int size = fc.size();
       
View Full Code Here

        List<PropertyName> properties = new ArrayList<PropertyName>();
       
        NamespaceSupport nsContext = new NamespaceSupport();
        nsContext.declarePrefix("foo", "FooNamespace");
       
        PropertyName fooProp = ff.property("foo", nsContext);
        PropertyName barProp = ff.property("bar", nsContext);
        properties.add(fooProp);
        properties.add(barProp);
       
        query.setProperties(properties);
View Full Code Here

       
        NamespaceSupport nsContext = new NamespaceSupport();
        nsContext.declarePrefix("foo", "FooNamespace");
       
        PropertyName fooProp = ff.property("foo", nsContext);
        PropertyName barProp = ff.property("bar", nsContext);
        properties.add(fooProp);
        properties.add(barProp);
       
        query.setProperties(properties);
       
View Full Code Here

                System.out.println();
            }
            if (ed.getName().contains("qed"))
                continue;
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
            Filter filter = ff.equal(ff.property("CITY"), ff.literal("Trento"), true);
            Query query = new Query("locations", filter);
            fts = source.getFeatures(query);
            System.out.println(fts.size());
            System.out.println(fts.features().next());
        }
View Full Code Here

   
    // TODO test or ( null, and( fidFilter, null ) ) filter
    public void testStrictHintComplexFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
       
        PropertyIsNull null1=ff.isNull( ff.property("name") );
        PropertyIsNull null2=ff.isNull( ff.property("geom") );
       
        HashSet<FeatureId> set = new HashSet<FeatureId>();
        set.add( ff.featureId("FID.1"));       
        Filter filter=ff.or( null2, ff.and( null1,  ff.id( set ) ) );
View Full Code Here

    // TODO test or ( null, and( fidFilter, null ) ) filter
    public void testStrictHintComplexFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
       
        PropertyIsNull null1=ff.isNull( ff.property("name") );
        PropertyIsNull null2=ff.isNull( ff.property("geom") );
       
        HashSet<FeatureId> set = new HashSet<FeatureId>();
        set.add( ff.featureId("FID.1"));       
        Filter filter=ff.or( null2, ff.and( null1,  ff.id( set ) ) );
       
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.