2 releases
Uses new Rust 2024
| new 0.0.3 | Dec 5, 2025 |
|---|---|
| 0.0.2 | Dec 5, 2025 |
#237 in Geospatial
205KB
4.5K
SLoC
cogrs
Pure Rust COG (Cloud Optimized GeoTIFF) reader library.
Usage
use cogrs::CogReader;
let reader = CogReader::open("path/to/file.tif")?;
License
MIT
lib.rs:
cogrs - Pure Rust COG (Cloud Optimized GeoTIFF) Reader
A high-performance library for reading Cloud Optimized GeoTIFFs without GDAL.
Features
- Metadata-only initialization: Reads only IFD headers (~16KB) on open
- Range requests: Efficient partial reads from local files, HTTP, or S3
- Streaming: Never loads entire file into memory
- Compression: Supports DEFLATE, LZW, ZSTD, and uncompressed
- Overviews: Automatic pyramid level selection with data density validation
- Coordinate transforms: Built-in proj support for CRS transformations
Example
use cogrs::CogReader;
let reader = CogReader::open("path/to/file.tif")?;
let tile_data = reader.read_tile(10, 512, 384)?;
Architecture
The library is organized into several modules:
cog_reader: Core COG metadata parsing and tile reading- [
cog]: High-level processing pipeline with caching range_reader: Abstraction for reading byte ranges from various sources- [
s3]: S3-compatible storage backend tile_cache: LRU cache for decompressed tilesraster: Raster data abstraction trait
Dependencies
~41–57MB
~731K SLoC