View source: R/makeSpatialCoords.R
makeSpatialCoords | R Documentation |
Converts scraped EDEN/DBHYDRO station coordinates to spatial data.
makeSpatialCoords(
data,
format = "dbhydro",
new_crs = "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
)
data |
input data. Typically, output from 'getCoords_XXXX' functions. |
format |
data source: 'eden' or 'dbhydro' |
new_crs |
coordinate system to convert data to. Optional (set to 'NULL' if a conversion is not desired). |
spatialPointsDataFrame converts the output from getCoords_EDEN and getCoords_DBHYDRO to a spatialPointsDataFrame. EDEN data are set in the same projection as the EDEN DEM ("+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs") and DBHYDRO data are in lat/long ("+init=epsg:4326")
## Not run:
### example usage as part of a workflow
stns <- c(
"S18C_T",
"NESRS1"
)
stn.coords <- do.call(rbind, lapply(X = stns, getCoords_EDEN, spatial = FALSE))
### convert to spatial data and plot
stn.coords <- makeSpatialCoords(stn.coords, format = "eden")
plot(stn.coords)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.