GeoTiffWriter

Cross-platform TIFF writer for the engine's elevation cache. Produces a minimal but spec-compliant baseline TIFF: little-endian header, single strip, uncompressed, BlackIsZero photometric, single sample per pixel, 32-bit IEEE float values. Reads back cleanly through GeoTiffReader and any standard TIFF library.

Replaces the JVM-only mil.nga.tiff.TiffWriter path that previously serialised GeoPackage cache tiles - now the same code produces tiles on every KMP target.

Functions

Link copied to clipboard
fun writeFloatGrayscaleTiff(pixels: FloatArray, width: Int, height: Int): ByteArray

Encode a width × height grid of float elevation samples (row-major, top-row first) into a TIFF byte array. The Float.MAX_VALUE null-data sentinel that the reader recognises is written through unchanged.

Link copied to clipboard
fun writeUint16GrayscaleTiff(pixels: IntArray, width: Int, height: Int): ByteArray

Encode a width × height grid of 16-bit-unsigned elevation samples (row-major, top-row first) into a TIFF byte array. Codes are 0..65535. Used by the cross-platform elevation cache to store Int16-shaped tiles on JS / iOS, where PNG-16 isn't cross-platform available.