1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! # wbgeotiff
//!
//! `wbgeotiff` is the shared low-level GeoTIFF engine used by Whitebox Rust crates.
//! It provides pure-Rust read/write support for GeoTIFF, BigTIFF, and COG.
//!
//! ## Feature Summary
//!
//! | Feature | API |
//! |---|---|
//! | Read GeoTIFF/BigTIFF | [`GeoTiff`] |
//! | Write stripped/tiled GeoTIFF | [`GeoTiffWriter`] + [`WriteLayout`] |
//! | Write COG | [`CogWriter`] |
//! | Compression selection | [`Compression`] |
//! | Georeferencing | [`GeoTransform`] + GeoKeys |
//!
//! ## Reading
//! ```rust,ignore
//! use wbgeotiff::GeoTiff;
//! let tiff = GeoTiff::open("dem.tif").unwrap();
//! println!("{}x{} BigTIFF={}", tiff.width(), tiff.height(), tiff.is_bigtiff);
//! let data: Vec<f32> = tiff.read_band_f32(0).unwrap();
//! ```
//!
//! ## Writing (tiled + BigTIFF)
//! ```rust,ignore
//! use wbgeotiff::{Compression, GeoTiffWriter, GeoTransform, SampleFormat, WriteLayout};
//! GeoTiffWriter::new(8192, 8192, 1)
//! .layout(WriteLayout::Tiled { tile_width: 512, tile_height: 512 })
//! .compression(Compression::Deflate)
//! .sample_format(SampleFormat::IeeeFloat)
//! .bigtiff(true)
//! .geo_transform(GeoTransform::north_up(0.0, 0.001, 8.192, -0.001))
//! .epsg(4326)
//! .write_f32("large.tif", &vec![0.0f32; 8192 * 8192])
//! .unwrap();
//! ```
//!
//! ## Cloud Optimized GeoTIFF
//! ```rust,ignore
//! use wbgeotiff::{CogWriter, Compression, GeoTransform, Resampling};
//! CogWriter::new(4096, 4096, 1)
//! .compression(Compression::Deflate)
//! .tile_size(512)
//! .resampling(Resampling::Average)
//! .geo_transform(GeoTransform::north_up(-180.0, 0.0879, 90.0, -0.0879))
//! .epsg(4326)
//! .write_f32("output.cog.tif", &vec![0.0f32; 4096 * 4096])
//! .unwrap();
//! ```
pub use ;
pub use Compression;
pub use ;
pub use ;
pub use TiffVariant;
pub use ;
pub use ;
pub use GeoTransform;
pub use ;