Search in sources :

Example 6 with FeatureStore

use of org.geotoolkit.storage.feature.FeatureStore in project geotoolkit by Geomatys.

the class DefaultFolderFeatureStore method updateFeatures.

/**
 * {@inheritDoc}
 */
@Override
public void updateFeatures(final String groupName, final Filter filter, final Map<String, ?> values) throws DataStoreException {
    typeCheck(groupName);
    final FeatureStore store = stores.get(this, groupName);
    store.updateFeatures(groupName, filter, values);
}
Also used : FeatureStore(org.geotoolkit.storage.feature.FeatureStore) AbstractFeatureStore(org.geotoolkit.storage.feature.AbstractFeatureStore)

Example 7 with FeatureStore

use of org.geotoolkit.storage.feature.FeatureStore in project geotoolkit by Geomatys.

the class DefaultFolderFeatureStore method getFeatureWriter.

/**
 * {@inheritDoc}
 */
@Override
public FeatureWriter getFeatureWriter(Query query) throws DataStoreException {
    if (!(query instanceof org.geotoolkit.storage.feature.query.Query))
        throw new UnsupportedQueryException();
    final org.geotoolkit.storage.feature.query.Query gquery = (org.geotoolkit.storage.feature.query.Query) query;
    final String typeName = gquery.getTypeName();
    typeCheck(typeName);
    final FeatureStore store = stores.get(this, typeName);
    return store.getFeatureWriter(query);
}
Also used : Query(org.apache.sis.storage.Query) UnsupportedQueryException(org.apache.sis.storage.UnsupportedQueryException) FeatureStore(org.geotoolkit.storage.feature.FeatureStore) AbstractFeatureStore(org.geotoolkit.storage.feature.AbstractFeatureStore)

Example 8 with FeatureStore

use of org.geotoolkit.storage.feature.FeatureStore in project geotoolkit by Geomatys.

the class DefaultFolderFeatureStore method getFeatureReader.

/**
 * {@inheritDoc}
 */
@Override
public FeatureReader getFeatureReader(final Query query) throws DataStoreException {
    if (!(query instanceof org.geotoolkit.storage.feature.query.Query))
        throw new UnsupportedQueryException();
    final org.geotoolkit.storage.feature.query.Query gquery = (org.geotoolkit.storage.feature.query.Query) query;
    final String name = gquery.getTypeName();
    typeCheck(name);
    final FeatureStore store = stores.get(this, name);
    return store.getFeatureReader(query);
}
Also used : Query(org.apache.sis.storage.Query) UnsupportedQueryException(org.apache.sis.storage.UnsupportedQueryException) FeatureStore(org.geotoolkit.storage.feature.FeatureStore) AbstractFeatureStore(org.geotoolkit.storage.feature.AbstractFeatureStore)

Example 9 with FeatureStore

use of org.geotoolkit.storage.feature.FeatureStore in project geotoolkit by Geomatys.

the class DefaultFolderFeatureStore method testFile.

private void testFile(Path file) throws IOException {
    if (Files.isHidden(file) || Files.isSymbolicLink(file)) {
        // skip hidden and sym link files
        return;
    }
    final Parameters params = singleFileDefaultParameters.clone();
    params.getOrCreate(ShapefileProvider.PATH).setValue(file.toUri());
    if (singleFileFactory.canProcess(params)) {
        try {
            final FeatureStore fileDS = (FeatureStore) singleFileFactory.open(params);
            fileDS.addListener(StoreEvent.class, subListener);
            stores.add(this, fileDS.getNames().iterator().next(), fileDS);
        } catch (DataStoreException ex) {
            getLogger().log(Level.WARNING, ex.getLocalizedMessage(), ex);
        }
    }
}
Also used : DataStoreException(org.apache.sis.storage.DataStoreException) Parameters(org.apache.sis.parameter.Parameters) FeatureStore(org.geotoolkit.storage.feature.FeatureStore) AbstractFeatureStore(org.geotoolkit.storage.feature.AbstractFeatureStore)

Example 10 with FeatureStore

use of org.geotoolkit.storage.feature.FeatureStore in project geotoolkit by Geomatys.

the class DefaultFolderFeatureStore method getFeatureType.

/**
 * {@inheritDoc}
 */
@Override
public FeatureType getFeatureType(final String typeName) throws DataStoreException {
    typeCheck(typeName);
    final FeatureStore store = stores.get(this, typeName);
    return store.getFeatureType(typeName);
}
Also used : FeatureStore(org.geotoolkit.storage.feature.FeatureStore) AbstractFeatureStore(org.geotoolkit.storage.feature.AbstractFeatureStore)

Aggregations

FeatureStore (org.geotoolkit.storage.feature.FeatureStore)28 GenericName (org.opengis.util.GenericName)11 AbstractFeatureStore (org.geotoolkit.storage.feature.AbstractFeatureStore)10 Query (org.geotoolkit.storage.feature.query.Query)9 DataStoreException (org.apache.sis.storage.DataStoreException)8 FeatureCollection (org.geotoolkit.storage.feature.FeatureCollection)6 Test (org.junit.Test)6 FeatureType (org.opengis.feature.FeatureType)6 Session (org.geotoolkit.storage.feature.session.Session)5 Serializable (java.io.Serializable)4 HashMap (java.util.HashMap)4 FeatureTypeBuilder (org.apache.sis.feature.builder.FeatureTypeBuilder)3 Parameters (org.apache.sis.parameter.Parameters)3 ShapefileProvider (org.geotoolkit.data.shapefile.ShapefileProvider)3 Feature (org.opengis.feature.Feature)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 MapLayer (org.apache.sis.portrayal.MapLayer)2 MapLayers (org.apache.sis.portrayal.MapLayers)2