Package org.opengis.filter

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


                Set featureIds = new HashSet();

                FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
                for (Iterator f = fids.iterator(); f.hasNext();) {
                    featureIds.add(ff.featureId((String) f.next()));
                }

                Id modified = ff.id(featureIds);

                FeatureCollection<SimpleFeatureType, SimpleFeature> changed = store.getFeatures(modified);
View Full Code Here


   
    FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() );
   
    // The filter factory requires the FID to be in a Set.
    Set<Identifier> featureIdSet = new HashSet<Identifier>( 1 );
    featureIdSet.add( filterFactory.featureId( featureId ) );
   
    Filter filter = filterFactory.id( featureIdSet );
   
    try
    {
View Full Code Here

        .getDefaultHints());

    Set<FeatureId> fids = new HashSet<FeatureId>();
    for (int i = 0, count = featureIds.length; i < count; i++) {
      String id = featureIds[i];
      FeatureId fid = ff.featureId(featureTypeName + "." + id);
      fids.add(fid);
    }
    Filter filter = ff.id(fids);

    return filter;
View Full Code Here

                                                           .toString(),
                        FeatureIdType.attrs[0].getName());
            }
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
            Set<FeatureId> fids = new HashSet<FeatureId>();
            fids.add( ff.featureId(fid) );
           
            return ff.id( fids );
            //FidFilter r = FilterFactoryFinder.createFilterFactory().createFidFilter(fid);
            //return r;
        }
View Full Code Here

        final String typeName = featureType.getTypeName();
        final BoundingBox bounds = addedFeature.getBounds();
        ReferencedEnvelope referencedEnvelope = ReferencedEnvelope.reference(bounds);
        String fid = addedFeature.getID();
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.id(Collections.singleton(ff.featureId(fid)));
        doFireFeaturesAdded(typeName, referencedEnvelope, filter);
    }

    private void fireChanged(final SimpleFeature changedFeature) {
        final String typeName = featureType.getTypeName();
View Full Code Here

        final String typeName = featureType.getTypeName();
        final BoundingBox bounds = changedFeature.getBounds();
        ReferencedEnvelope referencedEnvelope = ReferencedEnvelope.reference(bounds);
        String fid = changedFeature.getID();
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.id(Collections.singleton(ff.featureId(fid)));

        doFireFeaturesChanged(typeName, referencedEnvelope, filter);
    }

    private void fireRemoved(final SimpleFeature removedFeature) {
View Full Code Here

        String typeName = featureType.getTypeName();
        BoundingBox bounds = removedFeature.getBounds();
        ReferencedEnvelope referencedEnvelope = ReferencedEnvelope.reference(bounds);
        String fid = removedFeature.getID();
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filter = ff.id(Collections.singleton(ff.featureId(fid)));
        doFireFeaturesRemoved(typeName, referencedEnvelope, filter);
    }

    protected abstract void doFireFeaturesAdded(String typeName, ReferencedEnvelope bounds,
            Filter filter);
View Full Code Here

        assertEquals(1, fids.size());
        String featureId = fids.first();
        assertTrue(allFids.contains(featureId));

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Filter filterOne = ff.id(Collections.singleton(ff.featureId(featureId)));

        assertEquals("no events on AUTO_COMMIT", 0, listener.list.size());
        assertEquals("no events on transaction1", 0, listener1.list.size());
        assertEquals("no events on transaction2", 0, listener2.list.size());
        featureStore1.removeFeatures(filterOne);
View Full Code Here

        // assertTrue(String.valueOf(unsupportedFilter), unsupportedFilter instanceof
        // PropertyIsEqualTo);

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // @id = 'DELETEME.1' AND STRING_COL = 'test'
        filter = ff.and(ff.id(Collections.singleton(ff.featureId(typeName + ".1"))),
                ff.equals(ff.property("STRING_COL"), ff.literal("test")));

        filteringQuery = new Query(typeName, filter);
        // filteringQuery based on the above filter...
        sdeQuery = createFilteringQuery();
View Full Code Here

        assertTrue(String.valueOf(sqlFilter), sqlFilter instanceof And);
        Assert.assertEquals(Filter.INCLUDE, unsupportedFilter);

        // AND( @id = 'DELETEME.1' )
        List<Filter> singleAnded = Collections.singletonList((Filter) ff.id(Collections
                .singleton(ff.featureId(typeName + ".1"))));
        filter = ff.and(singleAnded);

        filteringQuery = new Query(typeName, filter);
        // filteringQuery based on the above filter...
        sdeQuery = createFilteringQuery();
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.