Class VectorTilesDataStore
- All Implemented Interfaces:
DataAccess<SimpleFeatureType,
,SimpleFeature> DataStore
- Direct Known Subclasses:
PMTilesDataStore
This class provides the foundation for creating GeoTools DataStores that read vector tiles from tile archives like
PMTiles or other tiled formats. It bridges between the Tileverse VectorTileStore
abstraction and GeoTools'
ContentDataStore
architecture.
Architecture:
- Wraps a
VectorTileStore
that provides access to the underlying tile data - Creates one
VectorTilesFeatureSource
per vector layer in the tile metadata - Automatically derives
SimpleFeatureType
from layer metadata - Supports spatial filtering, CRS transformation, and zoom level optimization
Features:
- Automatic feature type discovery from TileJSON metadata
- Spatial query optimization using tile extent calculations
- Automatic zoom level selection based on query resolution hints
- CRS transformation support
- Thread-safe concurrent access
Subclass Implementation: Concrete subclasses must provide a VectorTileStore
instance through the
constructor. The store handles all tile-specific logic (reading, caching, spatial indexing), while this class handles
GeoTools integration.
Feature Type Mapping: Each vector layer in the tile metadata becomes a feature type. The schema is derived from the layer's field definitions in the TileJSON metadata, with geometry attributes added automatically.
- See Also:
-
VectorTileStore
VectorTilesFeatureSource
PMTilesDataStore
- TileJSON Specification
-
Field Summary
FieldsFields inherited from class ContentDataStore
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, JOINED_FEATURE_TYPE, lockingManager, namespaceURI, typeFactory, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
VectorTilesDataStore
(DataStoreFactorySpi factory, VectorTileStore tileStore) Creates a new vector tiles datastore. -
Method Summary
Modifier and TypeMethodDescriptionprotected VectorTilesFeatureSource
createFeatureSource
(ContentEntry entry) Creates a feature source for a specific vector layer.Creates the list of feature type names available in this datastore.VectorTileStore
Returns the underlyingVectorTileStore
that provides access to the tile data.Methods inherited from class ContentDataStore
createContentState, createSchema, dispose, ensureEntry, ensureFeatureStore, entry, getDataStoreFactory, getEntry, getFeatureFactory, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureTypeFactory, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFilterFactory, getGeometryFactory, getInfo, getLockingManager, getLogger, getNames, getNamespaceURI, getSchema, getSchema, getTypeNames, name, removeEntry, removeSchema, removeSchema, setDataStoreFactory, setFeatureFactory, setFeatureTypeFactory, setFilterFactory, setGeometryFactory, setNamespaceURI, updateSchema, updateSchema
-
Field Details
-
DEFAULT_GEOMETRY_FACTORY
-
-
Constructor Details
-
VectorTilesDataStore
protected VectorTilesDataStore(DataStoreFactorySpi factory, VectorTileStore tileStore) throws IOException Creates a new vector tiles datastore.- Parameters:
factory
- the factory that created this datastoretileStore
- the underlying tile store providing access to vector tiles- Throws:
IOException
- if the tile store cannot be initialized or metadata cannot be read
-
-
Method Details
-
getTileStore
public VectorTileStore getTileStore()Returns the underlyingVectorTileStore
that provides access to the tile data.- Returns:
- the vector tile store
-
createTypeNames
Creates the list of feature type names available in this datastore.Each vector layer in the tile metadata becomes a feature type. The names are derived from the layer IDs in the TileJSON metadata.
- Specified by:
createTypeNames
in classContentDataStore
- Returns:
- list of feature type names
-
createFeatureSource
Creates a feature source for a specific vector layer.- Specified by:
createFeatureSource
in classContentDataStore
- Parameters:
entry
- the content entry for the feature type- Returns:
- a new
VectorTilesFeatureSource
for the layer - Throws:
IOException
- if the layer does not exist or cannot be accessed
-