A Cloud Optimized GeoTIFF library for Rust
- COG focused
- Fast
- Robust reader
- Correct writer
- Pure Rust
- TIFF decoding without extracting
- Tile extraction and decompression
- Georeferencing from tags (proj4rs)
- Tile rerendering (WMTS)
- Encoding
- Integration with S3 & HTTP
- Predictor only supports None or Horizontal 8bit
- Decompression only supports None or Lzw or Deflate
use cloudtiff::CloudTiff;
use image::DynamicImage;
use std::fs::File;
use std::io::BufReader;
fn save_preview(file: File) {
let reader = &mut BufReader::new(file);
let cog = CloudTiff::open(reader).unwrap();
let preview = cog.render_image_with_mp_limit(reader, 1.0).unwrap();
let img: DynamicImage = preview.try_into().unwrap();
img.save("preview.jpg").unwrap();
}
Get sample data:
mkdir data
aws s3 cp --no-sign-request s3://sentinel-cogs/sentinel-s2-l2a-cogs/9/U/WA/2024/8/S2A_9UWA_20240806_0_L2A/TCI.tif data/sample.tif
Run the example:
cargo run --example wmts
- Integration agnostic library. Encode and decode, don't read and write.
- Examples show integration specific usage
- Async and multithreading are optional features
- Focus on COG, don't implement the entire GeoTIFF or TIFF formats.
- No bloat, dependencies must also be focused
- Rust only dependencies
TIFF 6.0 spec
BigTIFF spec
OGC GeoTIFF standard
GeoTIFF paper
Cloud Optimized GeoTIFF spec
COG spec article
COG introduction article
COG use article
COG on AWS article
AWS Sentinel-2
NASA EarthData
rio-tiler
OpenAerialMap
cog3pio (Read only)
tiff (Decoding not optimal for COG)
geo (Coordinate transformation and projection)
geotiff (Decoding not optimal for COG)
geotiff-rs
gdal (Rust bindings for GDAL)