GeoTiffDataset

A tiled GeoTIFF opened for pyramid access: the resolution ladder (full-resolution image plus every overview IFD), the georeference, and the sampling used to resample an arbitrary geographic sector into one engine tile.

The file is never read whole. Opening parses tags only; each rendered tile picks the overview closest to its own resolution and decodes just the blocks it lands on, so a multi-gigabyte orthophoto costs the same per tile as a small one.

A file without overviews still works, but every zoomed-out tile has to decimate the full-resolution raster — the open call logs a warning suggesting gdaladdo / COG conversion, which is the fix.

Instances are safe to sample from multiple coroutines: sampling holds no shared mutable state (block caching is per call) and TiffDataSource implementations serialize reads.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether the file holds a picture or a height field, inferred from its tags, with the evidence attached. Resource managers filing an imported file under "maps" or "terrain" want this; see probeContent for the GeoTiffContent.AMBIGUOUS case.

Link copied to clipboard

Native resolution in degrees of latitude per pixel — the finest detail the file holds.

Link copied to clipboard
Link copied to clipboard

True unless the tags say the raster is a picture. Deliberately includes GeoTiffContent.AMBIGUOUS, so a caller that asked for terrain gets it; a caller deciding which category a file belongs to should read contentHint instead.

Link copied to clipboard

Resolution ladder, finest first: index 0 is the full-resolution raster.

Link copied to clipboard

Full-resolution raster.

Link copied to clipboard

Geographic bounds of the raster.

Functions

Link copied to clipboard
fun close()

Release the underlying source.

Link copied to clipboard

Resolution of ladder entry index in degrees of latitude per pixel.

Link copied to clipboard

Settle GeoTiffContent.AMBIGUOUS from the pixels, returning contentHint unchanged for files the tags already decided.

Link copied to clipboard
fun sampleArgb(sector: Sector, width: Int, height: Int): IntArray?

Resample sector into a width × height grid of 0xAARRGGBB pixels. Pixels with no source coverage (outside the raster, nodata, or an undecodable block) are fully transparent, so a tile that only partly overlaps the image composites correctly over whatever is beneath it.

Link copied to clipboard
fun sampleElevation(sector: Sector, width: Int, height: Int): ShortArray?

Resample sector into a width × height grid of 16-bit elevations, north-up and row-major with the engine's texel-centre convention. Missing posts — outside the raster, GDAL_NODATA, or an undecodable block — come back as Short.MIN_VALUE, which is the engine's own missing-data sentinel.

Link copied to clipboard
fun selectLevel(degreesPerTexel: Double): Int

Index of the ladder entry to sample for a tile of degreesPerTexel resolution — the coarsest overview that still resolves the tile, so zoomed-out tiles read a small overview instead of decimating the full-resolution raster.