utm_convert | R Documentation |
This can operate on a data frame containing coordinates from multiple UTM zones with a column denoting the zone, or a single zone for the full dataset.
utm_convert(
x,
easting,
northing,
zone,
crs = "EPSG:3005",
datum = c("NAD83", "WGS84"),
xycols = TRUE
)
x |
data.frame containing UTM coordinates, with a zone column |
easting |
the name of the 'easting' column |
northing |
the name of the 'northing' column |
zone |
the name of the 'zone' column, or a single value if the data are all in one UTM zone |
crs |
target CRS. Default BC Albers (EPSG:3005) |
datum |
The datum of the source data. |
xycols |
should the X and Y columns be appended to the output? |
It supports data collected in either the NAD83 or WGS84 ellipsoid in the Northern hemisphere
sf object in the chosen CRS
# Data with multiple zones, and a column denoting the zone
df <- data.frame(
animalid = c("a", "b", "c"),
zone = c(10, 11, 11),
easting = c(500000, 800000, 700000),
northing = c(5000000, 3000000, 1000000)
)
utm_convert(df, easting = "easting", northing = "northing", zone = "zone")
# Data all in one zone, specify a single zone:
df <- data.frame(
animalid = c("a", "b"),
easting = c(500000, 800000),
northing = c(5000000, 3000000)
)
utm_convert(df, easting = "easting", northing = "northing", zone = 11)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.