#geospatial #cartography #geography

bin+lib geodesy

A platform for experiments with geodetic transformations and data flow

9 releases (5 breaking)

0.12.0 Jan 2, 2024
0.11.1 Nov 23, 2023
0.10.0 Jun 7, 2023
0.9.2 Jan 24, 2023
0.3.0 Jul 29, 2021

#14 in Geospatial

Download history 42/week @ 2023-10-30 29/week @ 2023-11-06 42/week @ 2023-11-13 121/week @ 2023-11-20 112/week @ 2023-11-27 95/week @ 2023-12-04 117/week @ 2023-12-11 23/week @ 2023-12-18 90/week @ 2023-12-25 60/week @ 2024-01-01 92/week @ 2024-01-08 85/week @ 2024-01-15 74/week @ 2024-01-22 262/week @ 2024-01-29 644/week @ 2024-02-05 529/week @ 2024-02-12

1,517 downloads per month
Used in 6 crates (4 directly)

MIT/Apache

1MB
10K SLoC

Geodesy

Abstract

Rust Geodesy is - unsurprisingly - a geodesy library written in the Rust programming language.

Rust Geodesy provides a number of features to support a number of objectives.

The most important features are

  • a set of more than 20 geodetic transformation primitives
  • a set of more than 40 primitives for operations on the ellipsoid
  • a means for composing these primitives into more complex operations.

The most important objectives are

  • to support new, and hopefully better, abstractions,
  • to use these abstractions to build better, simpler, and more tractable, geospatial standards, transformations, and software.

If any of this resonates with you, read on after this minimal usage example...

Usage

Add Geodesy to your Cargo.toml file

[dependencies]
geodesy = "0.12.0"

Then try this minimal example, computing the UTM coordinates of some Scandinavian capitals

use geodesy::prelude::*;
fn main() -> anyhow::Result<()> {
    let mut context = Minimal::new();
    let utm33 = context.op("utm zone=33")?;

    let cph = Coor2D::geo(55., 12.); // Copenhagen
    let sth = Coor2D::geo(59., 18.); // Stockholm
    let mut data = [cph, sth];

    context.apply(utm33, Fwd, &mut data)?;
    println!("{:?}", data);
    Ok(())
}

Concrete

Rust Geodesy (RG), is a platform for experiments with geodetic software, transformations, and standards. RG vaguely resembles the PROJ transformation system, and was built in part on the basis of experiments with alternative data flow models for PROJ. The fundamental transformation functionality of RG is fairly complete (i.e. on par with the datum shift/reference frame transformation capability of PROJ), while the number of projections supported is a far cry from PROJ's enormous gamut. It does, however, support a suite of the most important ones:

  • Transverse Mercator
  • Universal Transverse Mercator (UTM)
  • Web Mercator
  • Mercator
  • Oblique Mercator
  • Lambert Conformal Conic
  • Lambert Azimuthal Equal Area

But fundamentally, RG is born as a geodesy, rather than cartography library. And while PROJ benefits from four decades of reality hardening, RG, being a platform for experiments, does not have operational robustness as a main focus. Hence, viewing RG as another PROJ, or PROJ RiiR, will lead to bad disappointment. At best, you may catch a weak mirage of a potential shape of jazz to come for the PROJ internal dataflow.

That said, being written in Rust, with all the memory safety guarantees Rust provides, RG by design avoids a number of pitfalls that are explicitly worked around in the PROJ code base. So the miniscule size of RG compared to PROJ is not just a matter of functional pruning. It is also a matter of development using a tool wonderfully suited for the task at hand.

Also, having the advantage of learning from PROJ experience, both from a user's and a developer's perspective, RG is designed to be significantly more extensible than PROJ. So perhaps for a number of applications, and despite its limitations, RG may be sufficient, and perhaps even useful.

Aims

Dataflow experimentation is just one aspect of RG. Overall, the aims are (at least) fourfold:

  1. Support experiments for evolution of geodetic standards.
  2. Support development of geodetic transformations.
  3. Hence, provide easy access to a number of basic geodetic operations, not limited to coordinate operations.
  4. Support experiments with data flow and alternative abstractions. Mostly as a tool for aims (1, 2, 3)

All four aims are guided by a wish to amend explicitly identified shortcomings in the existing geodetic system landscape.

Documentation

The documentation is currently limited, but take a look at:

  • The coordinate operator documentation
  • The description of kp, the Rust Geodesy coordinate processing program
  • This essayistic rumination, outlining the overall philosophy and architecture of Rust Geodesy, and this related comparison between PROJ and RG
  • The API documentation at Docs.rs
  • The examples
  • The tests embedded in the source code
  • This rather concrete and this more philosophical description of the main discrepancy between geodesy and geomatics, RG tries to elucidate and amend.

License

Rust Geodesy: Copyright 2020, 2021, 2022, 2023 by Thomas Knudsen knudsen.thomas@gmail.com.

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.8–2.6MB
~47K SLoC