8000 GitHub - craigosborn/cloudtiff: A Cloud Optimized GeoTIFF library for Rust
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

craigosborn/cloudtiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudtiff

A Cloud Optimized GeoTIFF library for Rust

Goals

  • COG focused
  • Fast
  • Robust reader
  • Correct writer
  • Pure Rust

Features

  • TIFF decoding without extracting
  • Tile extraction and decompression
  • Georeferencing from tags (proj4rs)
  • Tile rerendering (WMTS)
  • Encoding
  • Integration with S3 & HTTP

Limitations

  • Predictor only supports None or Horizontal 8bit
  • Decompression only supports None or Lzw or Deflate

Use

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();
}

Dev

Setup

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

Design Principle

  • 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

References

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

Sample Data

AWS Sentinel-2
NASA EarthData
rio-tiler
OpenAerialMap

Related Libraries

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)

Tools

QGIS
GDAL
rio-cogeo
rio-tiler

About

A Cloud Optimized GeoTIFF library for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0