Learn R Programming

rdwd (version 1.9.3)

nearbyStations: Find DWD stations close to given coordinates

Description

Select DWD stations within a given radius around a set of coordinates

Usage

nearbyStations(
  lat,
  lon,
  radius,
  res = NA,
  var = NA,
  per = NA,
  mindate = NA,
  hasfileonly = TRUE,
  mindex = metaIndex,
  current = FALSE,
  statname = "nearbyStations target location",
  quiet = rdwdquiet(),
  ...
)

Value

metaIndex subset with additional columns "dist" and "url"

Arguments

lat

Coordinates y component [degrees N/S, range 47:55]

lon

Coordinates x component [degrees E/W, range 6:15]

radius

Maximum distance [km] within which stations will be selected

res, var, per

Restrictions for dataset type as documented in selectDWD(). Each can be a vector of entries. DEFAULTS: NA (ignored)

mindate

Minimum dataset ending date (as per metadata). DEFAULT: NA

hasfileonly

Logical: only return entries for which there is an open-access file available? DEFAULT: TRUE

mindex

Index with metadata for selecting data. See https://bookdown.org/brry/rdwd/fileindex.html#metaindex DEFAULT: metaIndex

current

Get current mindex for res/var/per? All 3 must be given. See selectDWD() for details. DEFAULT: FALSE

statname

Character: name for target location. DEFAULT: "nearbyStations target location"

quiet

Logical: suppress progress messages? DEFAULT: FALSE through rdwdquiet()

...

Further arguments passed to selectDWD()

Author

Berry Boessenkool, berry-b@gmx.de, Mar 2017, Aug 2025

See Also

selectDWD(), metaIndex, website use case with nearbyStations

Examples

Run this code

m <- nearbyStations(49.211784, 9.812475, radius=30,
    res=c("daily","hourly"), var=c("precipitation","more_precip","kl"),
    mindate=as.Date("2016-05-30"), statname="Braunsbach catchment center")
# View(m)

# for a continued example of this, see the website use case
# "plot all rainfall values around a given point" (ca section 21):
# browseURL("https://bookdown.org/brry/rdwd")

Run the code above in your browser using DataLab