rgeodesy wraps Rust Geodesy (RG), a platform for experiments with geodetic transformations. A transformation is a pipeline string of named operators; you apply it to vectors of coordinates.
Unlike PROJ, RG does not take EPSG codes or a
from -> to pair of coordinate reference systems. You
spell out the transformation as a pipeline of operator primitives
chained with |, each taking key=value
arguments. For example, projecting geographic coordinates to UTM zone
32:
RG works internally in radians with a geodetic (latitude-first) axis order, so geographic data is bracketed with an I/O adaptor that converts units and order:
gis:in / gis:out — degrees in GIS order
(lon, lat), i.e. the natural (x, y) order.
Recommended for most R users.geo:in / geo:out — degrees in geodetic
order (lat, lon).These two give the same result when you swap the arguments:
Pass inv = TRUE to run a pipeline backwards. Applying
the forward pipeline and then its inverse recovers the input:
geod_xy() returns a two-column matrix instead of a list,
which is handy for feeding into other spatial code:
geod_validate() compiles a pipeline and returns
TRUE, or an error string if it cannot be built — useful for
checking user input before applying it:
geod_validate("gis:in | utm zone=55 south")
#> [1] TRUE
geod_validate("utm zone=banana")
#> [1] "Malformed value for parameter 'zone': 'banana'"A malformed pipeline passed to geod_apply() raises a
normal R error:
geod_ops() lists every registered operator and adaptor.
See vignette("operators") for a tour of the transformation
families.