Class VectorTilesDataStore

Object
ContentDataStore
VectorTilesDataStore
All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>, DataStore
Direct Known Subclasses:
PMTilesDataStore

public abstract class VectorTilesDataStore extends ContentDataStore
Abstract base GeoTools DataStore implementation for tiled vector data sources.

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:
  • Field Details

    • DEFAULT_GEOMETRY_FACTORY

      public static final GeometryFactory 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 datastore
      tileStore - 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 underlying VectorTileStore that provides access to the tile data.
      Returns:
      the vector tile store
    • createTypeNames

      protected List<Name> 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 class ContentDataStore
      Returns:
      list of feature type names
    • createFeatureSource

      protected VectorTilesFeatureSource createFeatureSource(ContentEntry entry) throws IOException
      Creates a feature source for a specific vector layer.
      Specified by:
      createFeatureSource in class ContentDataStore
      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