Skip to content

Acknowledgements

terrio stands on the work of many projects and their authors. Thank you to all of them.

terrio is released under the MIT License, but much of it is ported or adapted from these projects, and the copyright in that code and data remains with their authors: Frank Warmerdam, Even Rouault and the GDAL contributors; Gerald Evenden, Frank Warmerdam, Even Rouault and the PROJ contributors; Hobu, Inc. and the PDAL contributors; and the authors of the other projects below. NOTICE lists each of them with their licenses.

Disclaimer

terrio is primarily built with Claude Opus 5.5, an AI model by Anthropic, working under human direction and review. Its results are tested against GDAL, PROJ and PDAL, but check them for your own use, and please report anything that looks wrong.

Whitebox

terrio began on the pure-Rust format libraries of whitebox_next_gen by John Lindsay: wbraster, wbvector and wbprojection. They still read and write many of the formats terrio supports, and they made a C-free geospatial library in Rust a realistic goal.

GDAL

terrio owes its design to GDAL: to Frank Warmerdam, who started it in 1998, to Even Rouault, its long-time lead maintainer, and to the hundreds of developers who have built it since, with the organizations that fund their work. terrio's command names and options, the meaning of those options, the behavior of its drivers and many of its algorithms come from more than twenty-five years of their work. GDAL is also the reference terrio is tested against, and an optional backend for the formats terrio cannot read itself.

Several parts of terrio are ports of GDAL code, under GDAL's MIT licence except where the code GDAL includes has other terms (the public-domain degrib and g2clib of the GRIB driver), each attributed in NOTICE with its source files and copyright holders:

  • contour generation, from GDAL's marching squares implementation (Oslandia)
  • nodata filling (alg/rasterfill.cpp), gridding (alg/gdalgrid.cpp) and pixel interpolation (alg/gdal_interpolateatpoint.cpp and the resampling kernels)
  • overview generation (gcore/overview.cpp) and GeoTIFF update rules
  • weighted Brovey pansharpening, VRT kernel filters and focal statistics, nearblack, enhance, blend, unscale, reclassify, nodata-to-alpha and as-features
  • median-cut palette quantization and integer error diffusion (alg/gdalmediancut.cpp, alg/gdaldither.cpp), following Frank Warmerdam and Even Rouault
  • the edge-mode height recurrence of the viewshed (Tamas Szekeres)
  • segmentize, geometry type conversion, combine, Hilbert sort and linear referencing (OGR)
  • the vector dataset commands concat, partition, set-field-type, make-point, create, export-schema, rename-layer, edit and update
  • raster compare, pixel-info and gdal2xyz output
  • GDAL Cloud Optimized GeoTIFF validation and compressed-block layout checks (Even Rouault)
  • the SRTMHGT driver rules, and the GRIB driver with its degrib and g2clib rules and the GRIB tables GDAL distributes; small GRIB files of GDAL's test suite are among terrio's test files
  • the EPSG table, with the coordinate operations GDAL uses for each CRS, generated with GDAL and PROJ by scripts/gen_epsg_table.py

Where terrio's results differ from GDAL's, Conformance lists the cases and tolerances. If terrio is useful to you, please consider sponsoring GDAL, whose work it builds on.

PROJ and PDAL

PROJ and PDAL are, with GDAL, the reference terrio measures itself against: its point cloud commands and filters follow PDAL's, and its tests compare its coordinates and point clouds with theirs.

  • The map projections in crates/terrio-crs/src/ are ported from PROJ (MIT licence). The ellipsoidal gnomonic, as PROJ's, uses Charles Karney's geodesic algorithms, from geographiclib-rs (MIT licence), a port of GeographicLib.
  • The ESRI table, from PROJ's ESRI authority, is generated by scripts/gen_esri_table.py, and the datum names by scripts/gen_datum_names.py.
  • Many point cloud filters are ports of PDAL's (BSD-3-Clause): filters.smrf, filters.pmf, filters.elm, filters.outlier, filters.sample, the voxel filters, filters.hag_nn, filters.normal, filters.covariancefeatures, filters.lof, filters.chipper, filters.hexbin and others, with the k-d tree of the nanoflann copy PDAL vendors (BSD-2-Clause). Each file's header and NOTICE name the PDAL source files and their authors, most of them Bradley J. Chambers. The cloth simulation filter is a port of the CSF code PDAL vendors (Apache-2.0, copyright the State Key Laboratory of Remote Sensing Science, Beijing Normal University), after Zhang et al. (2016), An Easy-to-Use Airborne LiDAR Data Filtering Method Based on Cloth Simulation.

GEOS, JTS and GeoRust

JTS Topology Suite 1.20.0 (Martin Davis and other contributors) supplies the source algorithms for topology-preserving simplification, convex and concave hulls, their triangulations, integer tile validity, spatial packing and robust clipping envelopes. These ports use JTS's Eclipse Distribution License 1.0; the exact revisions, copyrights and adaptations are recorded in NOTICE and the JTS provenance record.

GEOS, the geometry engine GDAL uses, is an executable behavioral reference for these operations. The tile writer's polygon repair (tiles/repair/) was independently implemented from observed behavior in an isolated process; its record preserves the design, information boundary, import hashes and validation limits. It is separate from the JTS ports and from the public geometry-repair command.

The tile writer's pre-quantization clipping-failure predictor remains a heuristic: its original probes agreed with GEOS 3.14 on about 97% of random self-crossing polygons and rectangles (and 97% of overlapping parts). Quantized repair can also enumerate equivalent rings differently. These limits are documented in the provenance records rather than claimed as universal reference equivalence.

The buffer, overlay, dissolve and validity commands are built on GeoRust's geo crate (MIT/Apache-2.0), with rstar R-trees. GDAL-style vector gridding uses spade triangulations.

Polygon coverage checking also ports JTS's CoverageValidator, CoveragePolygonValidator, CoverageRing, InvalidSegmentDetector and their point/segment helpers, pinned to commit 3460207216f3091cd7f72d48d6ddd1b561b2b8fd, under the Eclipse Distribution License 1.0 (BSD-3-Clause). The file headers and NOTICE name the source files and retain their copyright notices.

The EPSG dataset and Esri's projection data

terrio's EPSG table and datum names (crates/terrio-crs/data/epsg.tsv.zst and datums.tsv.zst) are derived from the EPSG Geodetic Parameter Dataset, copyright the International Association of Oil & Gas Producers (IOGP), whose terms of use permit their redistribution with this attribution.

Its ESRI table (crates/terrio-crs/data/esri.tsv.zst) and the ESRI datum names are derived, through PROJ's database, from Esri's projection engine data, copyright Esri, under the Apache License 2.0.

Python APIs

terrio's Python package borrows its shape from rasterio, xarray and rioxarray, so that code written for them carries over. terrio.rio follows rasterio's API and several of its algorithms (BSD-3-Clause, copyright Mapbox), and terrio.xarray is adapted from rioxarray (Apache-2.0).

Pure-Rust codecs and format crates

terrio reads and writes its formats with these crates, among others:

Crate For
tiff, png, image-webp, weezl (image-rs) TIFF, PNG and WebP, LZW
jpeg-decoder, jpeg-encoder JPEG
openjp2 JPEG 2000, a port of OpenJPEG
rusty_av1d AVIF, a port of dav1d
jxl-oxide, zune-jpegxl JPEG XL
lerc-reader, lerc-writer LERC
flate2, ruzstd, zstd, lz4_flex, lzma-rust2, zip Compression and archives
flatgeobuf FlatGeobuf
Apache Arrow and Parquet GeoParquet and Arrow
netcdf-reader, hdf5-reader netCDF and HDF5
osmpbfreader OpenStreetMap PBF
quick-xml KML, GPX and other XML formats
laz LAZ and COPC, a port of LASzip
e57 E57 laser scans
delaunator Delaunay triangulation

Tooling

clap parses the command line, rayon runs it in parallel, ureq fetches remote data, serde handles JSON, PyO3 and rust-numpy build the Python package, and wasm-bindgen builds the JavaScript one. The optional gdal feature uses the gdal crate.

JPEG writing (through jpeg-encoder) is based in part on the work of the Independent JPEG Group.

Polygon coverage simplification ports JTS's shared-edge topology construction, TPVW corner removal and ring rebuilding from commit 3460207216f3091cd7f72d48d6ddd1b561b2b8fd, using the Eclipse Distribution License 1.0 (BSD-3-Clause). Its source header, NOTICE entries and JTS provenance document retain exact source paths and copyright notices.

Notices and licenses

NOTICE holds the copyright and license notices of the code and data terrio adapts (GDAL, PROJ, CSF, the EPSG dataset, Esri's projection data, rasterio, rioxarray, Apache Arrow and the IJG), whose copyright remains with their authors, and LICENSE-THIRD-PARTY.md the licenses of every Rust crate terrio's packages and binaries are built with, generated with cargo-about. Both ship with the Python wheels, the npm package and the command-line archives.

The full list of dependencies is in Cargo.toml and Cargo.lock. If your work is missing here, please open an issue.