Converts point coordinates stored in an sf
object to columns for
both the x and y coordinates. Useful for storing spatial data in tabular form.
gw_get_coords(.data, names = c("x","y"), crs = 4269)
.data | A |
---|---|
names | A vector with two column names, one for the x coordinate and one for the y coordinate. |
crs | A numeric code corresponding to the desired coordinate system for the column output |
An updated object with two new columns based on the names provided in the names
argument.
Based on a function written Josh M. London and described in a GitHub issue.