| Title: | R Interface to Rust Geodesy |
|---|---|
| Description: | Provides R bindings to the Rust Geodesy library by Thomas Knudsen, a platform for experiments with geodetic transformations and data flow. Exposes the pipeline operator model — compose transformations from named primitives such as 'utm', 'helmert', 'molodensky', and 'geo:in' adaptors — and apply them to vectors of coordinates. Useful for learning the Rust Geodesy architecture and for geodetic operations not available in 'PROJ'-based tools. |
| Authors: | Michael Sumner [aut, cre] (ORCID: <https://orcid.org/0000-0002-2471-7511>) |
| Maintainer: | Michael Sumner <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-16 12:42:48 UTC |
| Source: | https://github.com/hypertidy/rgeodesy |
Compiles the pipeline once and applies it, vectorised, to all coordinate
pairs. Coordinates follow Rust Geodesy conventions: geographic data must be
bracketed with an adaptor operator (gis:in/gis:out for (lon, lat) in
degrees, or geo:in/geo:out for (lat, lon)), because RG works internally
in radians.
geod_apply(op_str, x, y, inv = FALSE)geod_apply(op_str, x, y, inv = FALSE)
op_str |
Character scalar. A Rust Geodesy pipeline string, e.g.
|
x |
Numeric vector. First coordinate (longitude/easting under the GIS convention). |
y |
Numeric vector. Second coordinate (latitude/northing). Must be the
same length as |
inv |
Logical scalar. Run the inverse operation. Default |
A named list with numeric elements x and y, each the same length
as the input.
geod_xy() for matrix output, geod_validate(), geod_ops()
Other rgeodesy functions:
geod_ops(),
geod_validate(),
geod_xy()
# Geographic (lon, lat) in degrees -> UTM zone 55 south (easting, northing) geod_apply("gis:in | utm zone=55 south", x = c(147.3, 147.5), y = c(-42.9, -42.8)) # Round trip: forward then inverse recovers the input fwd <- geod_apply("gis:in | utm zone=55 south", x = 147.3, y = -42.9) geod_apply("gis:in | utm zone=55 south", x = fwd$x, y = fwd$y, inv = TRUE) # Multi-step pipeline: geographic in, northing-easting-up out geod_apply("gis:in | utm zone=32 | neu:out", x = c(12, 18), y = c(55, 59))# Geographic (lon, lat) in degrees -> UTM zone 55 south (easting, northing) geod_apply("gis:in | utm zone=55 south", x = c(147.3, 147.5), y = c(-42.9, -42.8)) # Round trip: forward then inverse recovers the input fwd <- geod_apply("gis:in | utm zone=55 south", x = 147.3, y = -42.9) geod_apply("gis:in | utm zone=55 south", x = fwd$x, y = fwd$y, inv = TRUE) # Multi-step pipeline: geographic in, northing-easting-up out geod_apply("gis:in | utm zone=32 | neu:out", x = c(12, 18), y = c(55, 59))
Returns the names of the built-in operators and coordinate adaptors
registered in a Minimal Rust Geodesy context. The list reflects the crate
version pinned by the package (Rust Geodesy 0.15).
geod_ops()geod_ops()
A sorted character vector of operator names.
Other rgeodesy functions:
geod_apply(),
geod_validate(),
geod_xy()
ops <- geod_ops() length(ops) c("utm", "helmert", "laea") %in% opsops <- geod_ops() length(ops) c("utm", "helmert", "laea") %in% ops
Attempts to compile the pipeline and returns TRUE if it succeeds, or a
character string describing the error if it fails. Useful for checking a
pipeline interactively before passing it to geod_apply().
geod_validate(op_str)geod_validate(op_str)
op_str |
Character scalar. A pipeline string to validate. |
TRUE if valid, otherwise a character string with the error message.
Other rgeodesy functions:
geod_apply(),
geod_ops(),
geod_xy()
geod_validate("gis:in | utm zone=55 south") # TRUE geod_validate("utm zone=banana") # error stringgeod_validate("gis:in | utm zone=55 south") # TRUE geod_validate("utm zone=banana") # error string
Convenience wrapper around geod_apply() that returns a numeric matrix with
columns x and y rather than a list.
geod_xy(op_str, x, y, inv = FALSE)geod_xy(op_str, x, y, inv = FALSE)
op_str |
Character scalar. A Rust Geodesy pipeline string, e.g.
|
x |
Numeric vector. First coordinate (longitude/easting under the GIS convention). |
y |
Numeric vector. Second coordinate (latitude/northing). Must be the
same length as |
inv |
Logical scalar. Run the inverse operation. Default |
A numeric matrix with columns x and y, one row per input point.
Other rgeodesy functions:
geod_apply(),
geod_ops(),
geod_validate()
geod_xy("gis:in | utm zone=55 south", x = c(147.3, 147.5), y = c(-42.9, -42.8))geod_xy("gis:in | utm zone=55 south", x = c(147.3, 147.5), y = c(-42.9, -42.8))