makeSpatialCoords: Make EDEN/DBHYDRO station coordinates spatial data

View source: R/makeSpatialCoords.R

makeSpatialCoordsR Documentation

Make EDEN/DBHYDRO station coordinates spatial data

Description

Converts scraped EDEN/DBHYDRO station coordinates to spatial data.

Usage

makeSpatialCoords(
  data,
  format = "dbhydro",
  new_crs = "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
)

Arguments

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).

Value

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")

Examples

## 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)


troyhill/SFNRC documentation built on Dec. 30, 2024, 4:32 p.m.