Description Usage Arguments Details Value Examples
Get location elevation.
1 2 | getElev(df_loc, Lat, Long, elev_units = "meters",
proj_loc = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
|
df_loc |
Data frame with location information |
Lat |
df_loc column name; Latitude (decimal degrees). Default = Latitude |
Long |
df_loc column name; Longitude (decimal degrees). Default = Longitude |
elev_units |
Requested elevation units; meters or feet. Default = meters. |
proj_loc |
Projection. Default is WGS84. |
Uses the elevatr package to acccess USGS Elevation Point Query Service (EPQS).
The EPQS is based on the National Map. The vertical accuracy is 3.04 meters.
https://www.usgs.gov/faqs/what-vertical-accuracy-seamless-3dep-dems
getElev assumes WGS84 but any projections can be entered.
Requires package elevatr and sp.
Requires a data frame with latitude and longitude. Other arguments are desired units and a projection.
The output is the input data frame with the elevation and units columns appended to it.
A data frame with elevation and units columns appended to it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #Function Arguments
df_loc <- head(data_Sites)
Lat <- "FinalLatitude"
Long <- "FinalLongitude"
elev_units <- "feet"
proj_loc <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
# Run Function
df_elev <- getElev(df_loc, Lat, Long, elev_units, proj_loc)
/dontrun{
# Save Results
write.table(df_elev, "Elev.tsv", sep="\t", row.names=FALSE, col.names = TRUE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.