Learn R Programming

rosm (version 0.3.0)

osm_native: Coordinate helpers

Description

Coordinate helpers

Usage

osm_native(x, y)

osm_lnglat(lng, lat)

osm_crs_native()

osm_ensure_lnglat(pt)

osm_ensure_native(pt)

Value

- `osm_native()`, `osm_lnglat()`, `osm_ensure_native()`, and `osm_ensure_lnglat()` return a [wk::xy()] with the appropriate crs - `osm_crs_native()` returns a value that can be used as the [wk::wk_crs()] of a vector.

Arguments

x, y

Ordinate values in EPSG:3857 (Spherical Mercator in meters)

lng, lat

Coordinate values for longitude/latitude in degrees.

pt

A vector of points as coerced by [wk::as_xy()]. The CRS for these points is considered.

Examples

Run this code
osm_lnglat(-64, 45)
osm_ensure_native(osm_lnglat(-64, 45))
osm_ensure_lnglat(
  osm_ensure_native(osm_lnglat(-64, 45))
)

Run the code above in your browser using DataLab