View source: R/set_coordinates_sf.R
set_coordinates_sf | R Documentation |
sf
spatial informationThis function helps format standard location fields like longitude and
latitude point coordinates to a tibble
using Darwin Core Standard.
It differs from set_coordinates()
by accepting sf
geometry columns of
class POINT
as coordinates (rather than numeric
lat/lon coordinates).
The advantage
of using an sf
geometry is that the Coordinate Reference System (CRS) is
automatically formatted into the required geodeticDatum
column.
set_coordinates_sf(.df, geometry = NULL, .keep = "unused")
.df |
A |
geometry |
The latitude/longitude coordinates as |
.keep |
Control which columns from .data are retained in the output.
Note that unlike |
A tibble
with the requested columns added/reformatted.
set_coordinates()
for providing numeric coordinates,
set_locality()
for providing 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")
) |>
sf::st_as_sf(coords = c("longitude", "latitude")) |>
sf::st_set_crs(4326)
# Reformat columns to Darwin Core Standard terms.
# Coordinates and CRS are automatically detected and reformatted.
df |>
set_coordinates_sf()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.