geocog/
lib.rs

1//! # geocog - Pure Rust COG (Cloud Optimized GeoTIFF) Reader
2//!
3//! A high-performance library for reading Cloud Optimized GeoTIFFs without GDAL.
4//!
5//! ## Features
6//!
7//! - **Metadata-only initialization**: Reads only IFD headers (~16KB) on open
8//! - **Range requests**: Efficient partial reads from local files, HTTP, or S3
9//! - **Streaming**: Never loads entire file into memory
10//! - **Compression**: Supports DEFLATE, LZW, ZSTD, and uncompressed
11//! - **Overviews**: Automatic pyramid level selection with data density validation
12//! - **Coordinate transforms**: Built-in proj support for CRS transformations
13//!
14//! ## Example
15//!
16//! ```rust,ignore
17//! use geocog::CogReader;
18//!
19//! let reader = CogReader::open("path/to/file.tif")?;
20//! let tile_data = reader.read_tile(10, 512, 384)?;
21//! ```
22//!
23//! ## Architecture
24//!
25//! The library is organized into several modules:
26//!
27//! - [`cog_reader`]: Core COG metadata parsing and tile reading
28//! - [`cog`]: High-level processing pipeline with caching
29//! - [`range_reader`]: Abstraction for reading byte ranges from various sources
30//! - [`s3`]: S3-compatible storage backend
31//! - [`tile_cache`]: LRU cache for decompressed tiles
32//! - [`raster`]: Raster data abstraction trait
33
34pub mod cog_reader;
35pub mod geometry;
36pub mod lzw_fallback;
37pub mod range_reader;
38pub mod raster;
39pub mod s3;
40pub mod tiff_chunked;
41pub mod tiff_utils;
42pub mod tile_cache;
43
44// Re-export main types
45pub use cog_reader::{CogReader, CogMetadata, CogDataType, Compression, GeoTransform, OverviewMetadata};
46pub use range_reader::RangeReader;
47pub use raster::RasterSource;
48pub use s3::{S3Config, S3RangeReaderAsync, S3RangeReaderSync};
49pub use tile_cache::TileCache;