TerrainTileStore

class TerrainTileStore(fileSystem: FileSystem, baseDir: Path)(source)

Raw Terrarium WebP tiles as a plain file hierarchy under baseDir: <baseDir>/<source>/<zoom>/<x>/<y>.webp.

Plain files, not a SQLite archive (unlike the base offline layer's Google-only archive): this store also has to work on Desktop, and Okio's FileSystem is genuinely multiplatform where Android's SQLite APIs aren't. One instance is scoped to one region's own terrain directory — callers own deciding where that directory lives.

Constructors

Link copied to clipboard
constructor(fileSystem: FileSystem, baseDir: Path)

Functions

Link copied to clipboard
fun deleteAll()

Deletes every tile this store owns — the whole baseDir, both sources.

Link copied to clipboard
fun hasTile(source: TerrainSource, tile: TileIndex): Boolean
Link copied to clipboard
Link copied to clipboard

Total bytes on disk under baseDir — both TerrainSource.GLOBAL and TerrainSource.REGIONAL, if present.

Link copied to clipboard
fun writeTile(source: TerrainSource, tile: TileIndex, webpBytes: ByteArray)