Package org.opengis.filter

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


        int versionSeparatorIdx = rid.indexOf(FeatureId.VERSION_SEPARATOR);
        if (-1 != versionSeparatorIdx) {
            fid = rid.substring(0, versionSeparatorIdx);
            featureVersion = rid.substring(versionSeparatorIdx + 1);
        }
        FeatureId featureId = ff.featureId(fid, featureVersion);
        return featureId;
    }

    public void watch(WFSContentState localState) {
        Name typeName = localState.getEntry().getName();
View Full Code Here


        DataStore store = DataStoreFinder.getDataStore(params);

        FilterFactory ff = CommonFactoryFinder.getFilterFactory();

        Set<FeatureId> selection = new HashSet<FeatureId>();
        selection.add(ff.featureId("fid1"));

        Filter filter = ff.id(selection);
        Query query = new Query("example", filter);

        FeatureReader<SimpleFeatureType, SimpleFeature> reader = store
View Full Code Here

    Transaction transaction = new DefaultTransaction("removeExample");
    SimpleFeatureStore store = (SimpleFeatureStore) dataStore.getFeatureSource(typeName);
    store.setTransaction(transaction);
   
    FilterFactory ff = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    Filter filter = ff.id(Collections.singleton(ff.featureId("fred")));
    try {
        store.removeFeatures(filter);
        transaction.commit();
    } catch (Exception eek) {
        transaction.rollback();
View Full Code Here

    Transaction transaction = new DefaultTransaction("removeExample");
    SimpleFeatureStore store = (SimpleFeatureStore) dataStore.getFeatureSource(typeName);
    store.setTransaction(transaction);
   
    FilterFactory ff = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    Filter filter = ff.id(Collections.singleton(ff.featureId("fred")));
    try {
        final Set<FeatureId> removed = new HashSet<FeatureId>();
        SimpleFeatureCollection collection = store.getFeatures( new Query( typeName, filter, Query.NO_NAMES ));
        collection.accepts( new FeatureVisitor(){
            public void visit(Feature feature) {
View Full Code Here

                new Coordinate(20, 1)}));
        writer.write();
        writer.close();
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
        Id filter = filterFactory.id(Collections
                .singleton(filterFactory.featureId(feature.getID())));

        reader = data.getFeatureReader(new DefaultQuery("road", filter), t1);
        geom1 = (Geometry) reader.next().getDefaultGeometry();
        reader.close();
        assertEquals(new Coordinate(20, 0), geom1.getCoordinates()[0]);
View Full Code Here

        store2.addFeatureListener(listener2);
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(null);

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

        System.out.println("start              t1: "+DataUtilities.fidSet(featureStore1.getFeatures()) );
        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

        riverBounds = new ReferencedEnvelope(CRS.decode("EPSG:4326"));
        riverBounds.expandToInclude(ReferencedEnvelope.reference(riverFeatures[0].getBounds()));
        riverBounds.expandToInclude(ReferencedEnvelope.reference(riverFeatures[1].getBounds()));

        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        rv1Filter = ff.id(Collections.singleton(ff.featureId(RIVER + ".rv1")));

        //  9,5   11,5  
        //   +-----+
        //     rv3  \
        //           + 13,3
View Full Code Here

        PrimaryKeyColumn col = pk.getColumns().get(0);
        assertEquals(aname("id"), col.getName());
        assertTrue(Number.class.isAssignableFrom(col.getType()));
       
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Id filter = ff.id(Collections.singleton(ff.featureId("riverReducedPk.0")));
       
        assertEquals(1, fsView.getCount(new Query(null, filter)));
    }
   
    public void testWhereParam() throws Exception {
View Full Code Here

        store.setTransaction( tx );
        store.setFeatureLock(lock);
        tx.addAuthorization(lock.getAuthorization());
       
        FilterFactory ff = dataStore.getFilterFactory();
        Filter f1 = ff.id( Collections.singleton( ff.featureId( tname("ft1")+".1")));
       
        assertEquals( 1, store.lockFeatures(f1) );
       
        Transaction tx1 = new DefaultTransaction();
        store.setTransaction( tx1 );
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.