geotiff-rust
Pure-Rust, read-only decoders for TIFF/BigTIFF and GeoTIFF/COG. No C libraries, no build scripts, and no unsafe beyond memmap2.
Crates
| Crate | Description |
|---|---|
tiff-reader |
TIFF/BigTIFF decoder with random-access sources, strip/tile reads, and typed raster decode |
geotiff-reader |
GeoTIFF reader with CRS/transform extraction, overview discovery, and optional HTTP range-backed remote open |
Usage
use GeoTiffFile;
let file = open?;
println!;
println!;
println!;
println!;
Using tiff-reader directly:
use TiffFile;
let file = open?;
println!;
println!;
for i in 0..file.ifd_count
let pixels: ArrayD = file.read_image?;
Features
TIFF
- Classic TIFF and BigTIFF support
- Little-endian and big-endian byte orders
- IFD chain traversal (multi-page/multi-image)
- Random-access decode from mmap, in-memory bytes, or custom sources
- Strip and tile data access
- Compression: Deflate, LZW, PackBits, JPEG-in-TIFF compression 7 (optional), ZSTD (optional)
- Parallel strip/tile decompression via Rayon
- All standard tag types (BYTE through IFD8)
- Typed raster reads into
ndarray::ArrayD
GeoTIFF
- GeoKey directory parsing (tag 34735)
- CRS/EPSG extraction (ProjectedCSType, GeographicType)
- Model tiepoint and pixel scale (tags 33922, 33550)
- Model transformation matrix (tag 34264)
- Correct
PixelIsArea/PixelIsPointnormalization for affine bounds and transforms - Nodata from GDAL_NODATA tag (42113)
- Band interleaving detection
- Pixel-to-geographic coordinate transforms
- Overview discovery for reduced-resolution GeoTIFF IFDs
- Optional HTTP range-backed remote COG/GeoTIFF access
Feature flags
[]
= "0.1" # local file reading (default)
= { = "0.1", = ["cog"] } # + HTTP range-backed remote open
| Flag | Default | Description |
|---|---|---|
local |
yes | Local file reading via tiff-reader |
rayon |
yes | Parallel strip/tile decompression |
jpeg |
yes | JPEG-in-TIFF compression 7 support, including JPEGTables-backed abbreviated streams |
zstd |
yes | ZSTD compression support (tiff-reader) |
cog |
no | Enable HTTP range-backed remote GeoTIFF/COG open; implies local |
Testing
Real-world interoperability fixtures are checked in under testdata/interoperability and can be re-verified locally without network access:
Fuzzing uses that corpus as its seed set:
License
MIT OR Apache-2.0