st_add_coordinates {eks}R Documentation

Add coordinates as attributes to geospatial data

Description

Add coordinates as attributes to geospatial data.

Usage

st_add_coordinates(x, as_sf=FALSE, as_tibble=FALSE, rename=TRUE)

Arguments

x

sf object with point geometry

as_sf

flag for output as sf object. Default is TRUE.

as_tibble

flag for output as tibble. Default is TRUE.

rename

flag to rename output from X,Y to lon,lat. Default is TRUE.

Details

The sf::st_coordinates is applied to obtain the longitude and latitude coordinates.

Value

The longitude and latitude of the point geometry are added as attributes.

Examples

data(grevilleasf)
hakeoides <- dplyr::filter(grevilleasf, species=="hakeoides")
hakeoides_coord <- st_add_coordinates(hakeoides)

[Package eks version 1.0.4 Index]