View source: R/set_coordinates.R
set_coordinates | R Documentation |
This function helps format standard location fields like
latitude and longitude point coordinates to a tibble
using Darwin Core
Standard.
set_coordinates(
.df,
decimalLatitude = NULL,
decimalLongitude = NULL,
geodeticDatum = NULL,
coordinateUncertaintyInMeters = NULL,
coordinatePrecision = NULL,
.keep = "unused"
)
.df |
A |
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.
|
coordinatePrecision |
(numeric) The precision that |
.keep |
Control which columns from |
In practice this is no different from using mutate()
, but gives some
informative errors, and serves as a useful lookup for how spatial columns are
represented in the Darwin Core Standard.
Example values are:
geodeticDatum
should be a valid EPSG code
A tibble
with the requested columns added/reformatted.
set_locality()
for provided text-based spatial information.
df <- tibble::tibble(
scientificName = c("Crinia Signifera", "Crinia Signifera", "Litoria peronii"),
latitude = c(-35.27, -35.24, -35.83),
longitude = c(149.33, 149.34, 149.34),
eventDate = c("2010-10-14", "2010-10-14", "2010-10-14")
)
# Reformat columns to Darwin Core Standard terms
df |>
set_coordinates(
decimalLongitude = longitude,
decimalLatitude = latitude
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.