Crates.io | geodesy |
lib.rs | geodesy |
version | 0.13.0 |
source | src |
created_at | 2021-07-28 15:33:30.977486 |
updated_at | 2024-04-06 09:49:22.586422 |
description | A platform for experiments with geodetic transformations and data flow |
homepage | |
repository | https://github.com/busstoptaktik/geodesy/ |
max_upload_size | |
id | 428414 |
size | 3,757,420 |
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
The most important objectives are
If any of this resonates with you, read on after this minimal usage example...
Initialize a new project, using Geodesy:
$ cargo new foo
Created binary (application) `foo` package
$ cd foo
$ cargo add geodesy
Then copy this to the foo/src/main.rs
file: A minimal example, computing the UTM coordinates of some Scandinavian capitals
use geodesy::prelude::*;
fn main() -> Result<(), Box<Error>> {
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(())
}
and try it out:
$ cargo r
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
Running `C:\FLOW\AD\RG\foo\target\debug\foo.exe`
[Coor2D([308124.36786033923, 6098907.825005002]), Coor2D([672319.9640879404, 6543920.334127973])]
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:
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.
Dataflow experimentation is just one aspect of RG. Overall, the aims are (at least) fourfold:
All four aims are guided by a wish to amend explicitly identified shortcomings in the existing geodetic system landscape.
The documentation is currently limited, but take a look at:
kp
, the Rust Geodesy coordinate processing programexamples
Rust Geodesy: Copyright 2020, 2021, 2022, 2023 by Thomas Knudsen knudsen.thomas@gmail.com.
Licensed under either of
at your option.
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.