Class GeoparquetDataStore
- Object
-
- ForwardingDataStore<JDBCDataStore>
-
- GeoparquetDataStore
-
- All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>
,DataStore
public class GeoparquetDataStore extends ForwardingDataStore<JDBCDataStore> implements DataStore
A GeoParquet DataStore implementation that decorates a JDBCDataStore.This implementation uses lazy initialization for performance, delaying the creation of database views until they are needed. This improves response time when working with large datasets, especially over remote connections.
The class overrides key methods from DataStore to intercept calls that require schema information, ensuring that the necessary database views are created before the underlying JDBC store handles the request.
-
-
Field Summary
-
Fields inherited from class ForwardingDataStore
delegate
-
-
Constructor Summary
Constructors Constructor Description GeoparquetDataStore(JDBCDataStore delegate)
Creates a new GeoParquet datastore that delegates to the provided JDBC datastore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFeatureSource
getFeatureSource(String typeName)
Returns a feature source for the given type name.SimpleFeatureSource
getFeatureSource(Name typeName)
Returns a feature source for the given qualified name.List<Name>
getNames()
Returns a list of qualified names for all feature types in this datastore.SimpleFeatureType
getSchema(String typeName)
Returns the feature type schema for the given type name.SimpleFeatureType
getSchema(Name name)
Returns the feature type schema for the given name.String[]
getTypeNames()
Returns the names of all feature types available in this datastore.-
Methods inherited from class ForwardingDataStore
createSchema, dispose, getFeatureReader, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getInfo, getLockingManager, removeSchema, removeSchema, updateSchema, updateSchema
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface DataAccess
createSchema, dispose, getInfo, removeSchema, updateSchema
-
Methods inherited from interface DataStore
getFeatureReader, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, removeSchema, updateSchema
-
-
-
-
Constructor Detail
-
GeoparquetDataStore
public GeoparquetDataStore(JDBCDataStore delegate)
Creates a new GeoParquet datastore that delegates to the provided JDBC datastore.- Parameters:
delegate
- The JDBC datastore to delegate operations to
-
-
Method Detail
-
getTypeNames
public String[] getTypeNames() throws IOException
Returns the names of all feature types available in this datastore.This implementation retrieves type names directly from the GeoParquet dialect, which maintains a mapping of available GeoParquet datasets.
- Specified by:
getTypeNames
in interfaceDataStore
- Overrides:
getTypeNames
in classForwardingDataStore<JDBCDataStore>
- Returns:
- An array of type names
- Throws:
IOException
- If there is a problem retrieving the type names
-
getNames
public List<Name> getNames() throws IOException
Returns a list of qualified names for all feature types in this datastore.This implementation creates proper Name objects for each type name, using the datastore's namespace if available.
- Specified by:
getNames
in interfaceDataAccess<SimpleFeatureType,SimpleFeature>
- Overrides:
getNames
in classForwardingDataStore<JDBCDataStore>
- Returns:
- A list of qualified names
- Throws:
IOException
- If there is a problem retrieving the names
-
getSchema
public SimpleFeatureType getSchema(String typeName) throws IOException
Returns the feature type schema for the given type name.This implementation ensures the database view exists for the requested schema before delegating to the JDBC datastore.
- Specified by:
getSchema
in interfaceDataStore
- Overrides:
getSchema
in classForwardingDataStore<JDBCDataStore>
- Parameters:
typeName
- The name of the feature type- Returns:
- The feature type schema
- Throws:
IOException
- If there is a problem retrieving the schema
-
getFeatureSource
public SimpleFeatureSource getFeatureSource(String typeName) throws IOException
Returns a feature source for the given type name.This implementation ensures the database view exists for the requested feature source before delegating to the JDBC datastore.
- Specified by:
getFeatureSource
in interfaceDataStore
- Overrides:
getFeatureSource
in classForwardingDataStore<JDBCDataStore>
- Parameters:
typeName
- The name of the feature type- Returns:
- A feature source for reading features
- Throws:
IOException
- If there is a problem creating the feature source- See Also:
SimpleFeatureSource
,SimpleFeatureStore
-
getSchema
public SimpleFeatureType getSchema(Name name) throws IOException
Returns the feature type schema for the given name.This implementation ensures the database view exists for the requested schema before delegating to the JDBC datastore. It sets the CURRENT_TYPENAME thread-local variable to provide context for geometry type handling during the operation.
- Specified by:
getSchema
in interfaceDataAccess<SimpleFeatureType,SimpleFeature>
- Overrides:
getSchema
in classForwardingDataStore<JDBCDataStore>
- Parameters:
name
- The qualified name of the feature type- Returns:
- The feature type schema with correct geometry types
- Throws:
IOException
- If there is a problem retrieving the schema
-
getFeatureSource
public SimpleFeatureSource getFeatureSource(Name typeName) throws IOException
Returns a feature source for the given qualified name.This implementation ensures the database view exists for the requested feature source before delegating to the JDBC datastore. It sets the CURRENT_TYPENAME thread-local variable to provide context for geometry type handling during the operation and wraps the result in an OverridingFeatureSource that provides the correct geometry types.
- Specified by:
getFeatureSource
in interfaceDataAccess<SimpleFeatureType,SimpleFeature>
- Specified by:
getFeatureSource
in interfaceDataStore
- Overrides:
getFeatureSource
in classForwardingDataStore<JDBCDataStore>
- Parameters:
typeName
- The qualified name of the feature type- Returns:
- A feature source for reading features with correct geometry types
- Throws:
IOException
- If there is a problem creating the feature source- See Also:
DataStore.getFeatureSource(String)
,SimpleFeatureSource
,SimpleFeatureStore
-
-