gw_get_coords: Extract Coordinates from sf Object

View source: R/geocode.R

gw_get_coordsR Documentation

Extract Coordinates from sf Object

Description

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.

Usage

gw_get_coords(.data, names = c("x","y"), crs = 4269)

Arguments

.data

A sf object

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

Details

Based on a function written Josh M. London and described in a GitHub issue.

Value

An updated object with two new columns based on the names provided in the names argument.


slu-openGIS/gateway documentation built on Jan. 31, 2024, 4:23 p.m.