Package org.opengis.filter

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


        String fid = features.next().getID();
        features.close();
       
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        String typeName = store.getSchema().getTypeName();
        Id id = ff.id(Collections.singleton(ff.featureId(fid)));
       
        assertEquals(-1, store.getCount(new Query(typeName, id)));
        assertEquals(1, count(ds, typeName, id, t));
       
        store.removeFeatures(id);
View Full Code Here


        SimpleFeatureStore road = (SimpleFeatureStore) dataStore.getFeatureSource(tname("road"));

        FilterFactory factory = CommonFactoryFinder.getFilterFactory(null);

        //td.rd1Filter = factory.createFidFilter(td.roadFeatures[0].getID());
        Filter rd1Filter = factory.id(Collections.singleton(factory.featureId(
                        td.roadFeatures[0].getID())));

        AttributeDescriptor name = td.roadType.getDescriptor(aname("name"));
        road.modifyFeatures(new AttributeDescriptor[] { name, }, new Object[] { "changed", },
            rd1Filter);
View Full Code Here

        query.getFunction().add(function1);
        query.getPropertyName().add("property2");
        query.getXlinkPropertyName().add(xlinkPropertyName2);
        query.getFunction().add(function2);

        query.setFilter(ff.id(Collections.singleton(ff.featureId("fid"))));
        query.getSortBy().add(ff.sort("sortProperty", SortOrder.DESCENDING));

        return query;
    }
}
View Full Code Here

        count(store, 2);
        FeatureId identifier = fid.iterator().next();
        String next = identifier.getID();
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
        Filter f = filterFactory.id(Collections.singleton(filterFactory.featureId(next)));
        store.removeFeatures(f);
       
        count(store, 1);
//        assertEquals("Number of known feature as obtained from getCount",3, store.getCount(Query.ALL));
    }
View Full Code Here

    protected Filter createFilter() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Set<FeatureId> featureIds = new HashSet<FeatureId>();
        for(Iterator<FeatureId> it = index.iterator(); it.hasNext();){
           FeatureId fid = it.next();
           featureIds.add(ff.featureId( fid.getID() ));
        }
        Id fids = ff.id(featureIds);
           
        return fids;
    }
View Full Code Here

        System.out.println("start              t2: "
                + DataUtilities.fidSet(featureStore2.getFeatures()));

        // select feature to remove
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Filter filter1 = ff.id(Collections.singleton(ff.featureId("fid1")));
        featureStore1.removeFeatures(filter1); // road1 removes fid1 on t1

        System.out.println();
        System.out.println("Step 2 transaction 1 removes feature 'fid1'");
        System.out.println("------");
View Full Code Here

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);

        //test that only the listener listening with the current transaction gets the event.
        final SimpleFeature feature = roadFeatures[0];
        Id fidFilter = ff.id(Collections.singleton(ff.featureId(feature.getID())));
       
        store1.removeFeatures(fidFilter);
       
        assertEquals(1, listener1.events.size());
        assertEquals(0, listener2.events.size());
View Full Code Here

    }

    public void testGetFeaturesWithIdFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        Id id = ff.id(new HashSet<FeatureId>(Arrays.asList(ff.featureId(this.layerName + ".1"),
                ff.featureId(this.layerName + ".7"))));
        SimpleFeatureCollection features = featureSource.getFeatures(id);
        assertEquals(2, features.size());
        SimpleFeatureIterator iterator = features.features();
        assertTrue(iterator.hasNext());
View Full Code Here

    public void testGetFeaturesWithIdFilter() throws Exception {
        init();
        FilterFactory ff = dataStore.getFilterFactory();
        Id id = ff.id(new HashSet<FeatureId>(Arrays.asList(ff.featureId(this.layerName + ".1"),
                ff.featureId(this.layerName + ".7"))));
        SimpleFeatureCollection features = featureSource.getFeatures(id);
        assertEquals(2, features.size());
        SimpleFeatureIterator iterator = features.features();
        assertTrue(iterator.hasNext());
        SimpleFeature f = iterator.next();
View Full Code Here

      String[] fids = ts.getFids(ft.getTypeName());
      assertNotNull(fids);
     
        Set ids = new HashSet();
        for(int i=0;i<fids.length;i++){
        ids.add(fac.featureId(fids[i]));
        }
        Id ff = fac.id(ids);
      return ff;
    }
   
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.