Class RangeReaderParams

Object
RangeReaderParams

public class RangeReaderParams extends Object
Bridges Tileverse Range Reader configuration to GeoTools DataStore parameters.

This class converts between:

  • StorageParameter - Tileverse Storage SPI configuration parameters
  • DataAccessFactory.Param - GeoTools DataStore factory parameters
  • Properties - Configuration properties for StorageFactory

Purpose: The Tileverse Storage library uses an SPI mechanism with StorageProviders that declare their configuration parameters. This class dynamically discovers all available providers and converts their parameters to GeoTools DataStore parameters, enabling seamless configuration through GeoServer or other GeoTools applications.

Supported Parameters:

  • General: Provider selection, caching configuration
  • AWS S3: Region, credentials, path style, credential profiles
  • Azure Blob: Blob name, account key, SAS token
  • Google Cloud Storage: Project ID, quota project, application credentials

Usage:


 // In PMTilesDataStoreFactory
 Map<String, Object> connectionParams = ...;
 Properties storageConfig = RangeReaderParams.toProperties(connectionParams);
 try (Storage storage = StorageFactory.open(parent, storageConfig);
         RangeReader reader = storage.openRangeReader(key)) { ... }
 
See Also:
  • Field Details

  • Method Details

    • appendAfter

      public static DataAccessFactory.Param[] appendAfter(DataAccessFactory.Param... dataStoreParams)
      Appends all storage configuration parameters after the specified datastore parameters.

      This method is used by PMTilesDataStoreFactory.getParametersInfo() to dynamically include all storage configuration parameters based on available providers.

      Parameters:
      dataStoreParams - the base datastore parameters (e.g., URI, namespace)
      Returns:
      array combining datastore parameters followed by all storage parameters
    • appendAfter

      public static DataAccessFactory.Param[] appendAfter(Predicate<DataAccessFactory.Param> filter, DataAccessFactory.Param... dataStoreParams)
      Appends storage configuration parameters after the specified datastore parameters.

      This method is used by PMTilesDataStoreFactory.getParametersInfo() to dynamically include all storage configuration parameters based on available providers.

      Parameters:
      filter - a filter predicate to apply in case some parameters need to be excluded
      dataStoreParams - the base datastore parameters (e.g., URI, namespace)
      Returns:
      array combining datastore parameters followed by all storage parameters
    • dataStoreParam

      public static DataAccessFactory.Param dataStoreParam(StorageParameter<?> param)
      Converts a StorageParameter to a GeoTools DataAccessFactory.Param.

      This conversion handles:

      • Key mapping from storage parameter keys
      • Type conversion to GeoTools-compatible types
      • Default values and sample values
      • Parameter groups (basic vs advanced)
      • Descriptions and titles for UI display
      Parameters:
      param - the storage parameter to convert
      Returns:
      the equivalent GeoTools Param
    • toProperties

      public static Properties toProperties(Map<String,?> connectionParams)
      Converts DataStore connection parameters to storage configuration properties.

      This method extracts all storage-related parameters from the DataStore connection parameters map and converts them to a Properties object suitable for passing to StorageFactory.open(java.net.URI, Properties).

      The conversion includes:

      • Provider selection parameters
      • Caching configuration
      • Cloud provider authentication parameters (S3, Azure, GCS)
      • Any other provider-specific parameters

      Forward-compatible storage.* keys (canonical in tileverse 2.x) are translated to the canonical io.tileverse.rangereader.* form via RangeReaderConfig#normalizeKeys(Map) before lookup, so DataStoreInfo entries persisted by a future tileverse 2.x consumer (e.g. GeoServer 3.1+) are read correctly here.

      Parameters:
      connectionParams - the DataStore connection parameters (from PMTilesDataStoreFactory.createDataStore(java.util.Map<java.lang.String, ?>))
      Returns:
      properties object suitable for StorageFactory.open(java.net.URI, Properties)
    • toStorageConfig

      public static StorageConfig toStorageConfig(URI uri, Map<String,?> params)
      Builds a StorageConfig addressing uri as the leaf object, with backend-specific tuning taken from GeoTools connection params. Pass the result to PMTilesReader.open(StorageConfig) or VersatilesReader.open(StorageConfig); the reader owns the resulting Storage and RangeReader and closes both.