Examples of FeatureStore


Examples of org.ff4j.core.FeatureStore

    private final FeatureCacheManager cache = new FeatureCacheProviderEhCache();

    /** {@inheritDoc} */
    @Override
    public FeatureStore initStore() {
        FeatureStore store = new InMemoryFeatureStore("test-ehcacheProvider.xml");
        return new FeatureStoreCacheProxy(store, cache);
    }
View Full Code Here

Examples of org.ff4j.core.FeatureStore

      
        // Initializing cache manager
        FeatureCacheManager cache = new FeatureCacheProviderRedis();

        // Initializing Features for test
        FeatureStore store = new InMemoryFeatureStore(TEST_FEATURES_FILE);
        Feature fold = store.read(F4);
       
        // Put in Cache
        cache.put(fold);
       
        // Retrieve object
View Full Code Here

Examples of org.geotools.data.FeatureStore

            selectedLayers = new ArrayList<FeatureStore>();
            for( String name : itemNames ) {
                ILayer tmpLayer = itemsMap.get(name);
                if (tmpLayer != null) {
                    try {
                        FeatureStore tmpStore = tmpLayer.getResource(FeatureStore.class, null);
                        if (tmpStore != null)
                            selectedLayers.add(tmpStore);
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
View Full Code Here

Examples of org.geotools.data.FeatureStore

    public void refreshEditFeature() {
        Layer editLayer = getEditLayerInternal();
        try {
            FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools
                    .getDefaultHints());
            FeatureStore resource = editLayer.getResource(FeatureStore.class, null);
            Set<Identifier> fids = FeatureUtils.stringToId(filterFactory, getEditFeature().getID());
            Id filter = filterFactory.id(fids);
            FeatureIterator<SimpleFeature> features = resource.getFeatures(filter).features();
            if (features.hasNext()) {
                SimpleFeature feature = features.next();
                setEditFeature(feature, editLayer);
            } else {
                setEditFeature(null, editLayer);
View Full Code Here

Examples of org.geotools.data.FeatureStore

    params.put( "url", file.toURL() );
    ShapefileDataStore dataStore =
        (ShapefileDataStore) factory.createNewDataStore( params );   
    dataStore.createSchema( featureType );
   
    FeatureStore store = (FeatureStore) dataStore.getFeatureSource();
    store.addFeatures( source.getFeatures() );
    dataStore.forceSchemaCRS( crs );
}
View Full Code Here

Examples of org.geotools.data.FeatureStore

            catch( Exception e2 ) {
                throw e;
            }
           
            //delete all features
            FeatureStore store = (FeatureStore) dataStore.getFeatureSource( schema.getName() );
            store.removeFeatures(Filter.INCLUDE);
        }
       
        return dataStore.getFeatureWriterAppend( schema.getTypeName(), Transaction.AUTO_COMMIT );
    }
View Full Code Here

Examples of org.geotools.data.FeatureStore

    }

    protected LayerInfo buildLayer(String name, WorkspaceInfo ws,
            Class<? extends ResourceInfo> resourceClass) throws Exception {
       
        FeatureStore fs = createNiceMock(FeatureStore.class);
        replay(fs);
       
        DataStore dstore = createNiceMock(DataStore.class);
        replay(dstore);
       
View Full Code Here

Examples of org.geotools.data.FeatureStore

    }

    public void testFullAccess() throws Exception {
        FeatureSource source = getFeatureSource(MockData.LINES);
        FeatureCollection fc = source.getFeatures();
        FeatureStore store = (FeatureStore) source;
        store.removeFeatures(Filter.INCLUDE);
    }
View Full Code Here

Examples of org.geotools.data.FeatureStore

            // fine, we should not be able to get to the feature source
        }
    }

    public void testCannotWrite() throws Exception {
        FeatureStore fs = (FeatureStore) getFeatureSource(MockData.DELETES);
               
        try {
            fs.removeFeatures(Filter.INCLUDE);
            fail("This should have failed with a security exception!");
        } catch (AcegiSecurityException e) {
            // fine, we should not be able to get to the feature source
        }
    }
View Full Code Here

Examples of org.geotools.data.FeatureStore

    public void testReadOnlyFeatureStore() throws Exception {
        // build up the mock
        SimpleFeatureType schema = createNiceMock(SimpleFeatureType.class);
        expect(schema.getName()).andReturn(new NameImpl("testFT"));
        replay(schema);
        FeatureStore fs = createNiceMock(FeatureStore.class);
        expect(fs.getSchema()).andReturn(schema);
        replay(fs);
       
        ReadOnlyFeatureStore ro = new ReadOnlyFeatureStore(fs, WrapperPolicy.RO_CHALLENGE);
        try {
            ro.addFeatures(createNiceMock(FeatureCollection.class));
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.