Skip to contents

This function helps format standard location fields to a tibble.

Usage

use_coordinates(
  .df,
  decimalLatitude = NULL,
  decimalLongitude = NULL,
  geodeticDatum = NULL,
  coordinateUncertaintyInMeters = NULL,
  coordinatePrecision = NULL,
  .keep = "unused"
)

Arguments

.df

a data.frame or tibble that the column should be appended to.

decimalLatitude

The latitude in decimal degrees

decimalLongitude

The longitude in decimal degrees

geodeticDatum

The datum or spatial reference system that coordinates are recorded against (usually "WGS84" or "EPSG:4326"). This is often known as the Coordinate Reference System (CRS). If your coordinates are from a GPS system, your data are already using WGS84.

coordinateUncertaintyInMeters

(numeric) Radius of the smallest circle that contains the whole location, given any possible measurement error. coordinateUncertaintyInMeters will typically be around 30 (metres) if recorded with a GPS after 2000, or 100 before that year.

coordinatePrecision

(numeric) The precision that decimalLatitude and decimalLongitude are supplied to. coordinatePrecision should be no less than 0.00001 if data were collected using GPS.

.keep

Control which columns from .data are retained in the output. Note that unlike dplyr::mutate(), which defaults to "all" this defaults to "unused"; i.e. only keeps Darwin Core fields, and not those fields used to generate them.

Value

A tibble with the requested fields added.

Details

In practice this is no different from using mutate(), but gives some informative errors, and serves as a useful lookup for how spatial fields are represented in the Darwin Core Standard.

Example values are:

  • geodeticDatum should be a valid EPSG code

See also

use_locality() for provided text-based spatial information