rg_province_get: Download meteorological data from the province API of South...

Description Usage Arguments Format Functions Source Examples

View source: R/download_province.R

Description

Functions for accessing the Meteorological Data from the province of South Tyrol. The function rg_province_get can be used to download station measurements for the requested time period and stations. Information about valid station_codes and sensors can be retrieved using the function rg_province_info.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rg_province_get(
  station_code,
  sensor_code,
  datestart = Sys.Date() - 1,
  dateend = Sys.Date(),
  format = "wide",
  dburl = "http://daten.buergernetz.bz.it/services/meteo/v1/timeseries"
)

rg_province_info(format = "table")

Arguments

station_code

string; Code of the station

sensor_code

string; Abbreviation of the sensor of interest (e.g. "N" for Precipitation or "LT" for air temperature). Use rg_province_info for valid sensor names.

datestart

date; Starting date for the download

dateend

date; End date for the download

format

string, wide or long for a wide or long table as result for function rg_province_get and "table" or "spatial" if the output should be a table or sf-object for function rg_province_info

dburl

URL; URL of the Province Database

Format

The table returned by the function rg_progince_info contains the following information:

SCODE

ID of the station

NAME_D

Full name of the station

ALT

Station elevation in meters

LONG

Station longitude in EPSG:4326

LAT

Station latitude in EPSG:4326

TYPE

Sensor Type

DESC_D

Full name of Sensor

unit

Measurement unit of the sensor

Functions

Source

https://github.com/mattia6690/MonalisR/blob/master/R/Processing.R

Examples

1
2
3
4
5
Get a vector of available station ids with air temperature measurements
ids <- rg_province_info() %>% filter(TYPE == 'LT') %>% pull(SCODE)

download data for all stations
data <- rg_province_get(station_code = ids, sensor_code = 'LT', datestart = as.Date('20180101', format = '%Y%m%d'), dateend = as.Date('20180105', format = '%Y%m%d'))

sitscholl/Rgadgets documentation built on Feb. 19, 2021, 1:24 a.m.