ElevationStoreBackend

Storage backend for one elevation coverage's encoded tiles + their per-tile ancillary (scale, offset) metadata. Per-platform implementations bind one contentKey to the underlying medium:

  • JS: IDB coverage_tiles blob store + coverage_ancillary keyed object store.

  • iOS: filesystem ${baseDirectory}/${contentKey}/${z}/${x}/${y}.bin blob + ${z}/${x}/${y}.ancillary sidecar.

The codec (ElevationStorageCodec) lives one level up — this interface is just "where do the bytes live" + "what's the per-tile scale/offset" so the cross-platform cached elevation factory (CachedElevationDataFactory) doesn't have to know about the backend medium.

Properties

Link copied to clipboard

Cache identity (contentKey + containing ContentManager path). Surfaced through CachedElevationSourceFactory.cacheInfo so layer-side extensions can return it.

Link copied to clipboard
abstract val isReadOnly: Boolean

When true, writeTile throws.

Functions

Link copied to clipboard
open suspend fun bumpValidatedAt(z: Int, x: Int, y: Int)

Refresh a tile's freshness timestamp WITHOUT rewriting its bytes — the conditional-GET 304 Not Modified path. Default no-op for backends that don't track freshness.

Link copied to clipboard
abstract suspend fun readTile(z: Int, x: Int, y: Int): CachedTile?

Read the encoded tile bytes + ancillary metadata for (z, x, y). Returns null when the tile isn't present in the cache (cache miss).

Link copied to clipboard
abstract suspend fun writeTile(z: Int, x: Int, y: Int, bytes: ByteArray, tileScale: Float, tileOffset: Float, etag: String? = null, lastModified: String? = null)

Persist the encoded tile bytes + ancillary metadata for (z, x, y), plus the network response's etag / lastModified validators so a later refresh can issue a conditional GET. Implementations should be idempotent — writing the same key twice replaces the prior row.