Title: | A Wrapper for Querying KISTERS 'WISKI' Databases via the 'KiWIS' API |
---|---|
Description: | A wrapper for querying 'WISKI' databases via the 'KiWIS' 'REST' API. 'WISKI' is an 'SQL' relational database used for the collection and storage of water data developed by KISTERS and 'KiWIS' is a 'REST' service that provides access to 'WISKI' databases via HTTP requests (<https://www.kisters.eu/water-weather-and-environment/>). Contains a list of default databases (called 'hubs') and also allows users to provide their own 'KiWIS' URL. Supports the entire query process- from metadata to specific time series values. All data is returned as tidy tibbles. |
Authors: | Ryan Whaley [aut, cre], Sam Albers [ctb] |
Maintainer: | Ryan Whaley <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.4 |
Built: | 2024-11-10 06:01:11 UTC |
Source: | https://github.com/rywhale/kiwisr |
kiwisR provides a simplified method for retrieving tidy data from KISTERS WISKI databases via KiWIS API.
A suggested workflow for using this package:
Get station metadata using ki_station_list()
Get time series metadata using ki_timeseries_list()
Get time series data using ki_timeseries_values()
Maintainer: Ryan Whaley [email protected]
Other contributors:
Sam Albers [email protected] [contributor]
Useful links:
Returns a tibble containing metadata available groups. This can be used to further filter down other queries like 'ki_station_list'.
ki_group_list(hub, datasource = 0)
ki_group_list(hub, datasource = 0)
hub |
The KiWIS database you are querying. Either one of the defaults or a URL. See README. |
datasource |
(Optional) The data source to be used, defaults to 0. |
A tibble with three columns: group_id, group_name and group_type.
## Not run: ki_group_list(hub = "swmc") ## End(Not run)
## Not run: ki_group_list(hub = "swmc") ## End(Not run)
Returns all available stations by default and allows for search terms and other filters.
ki_station_list( hub, search_term, bounding_box, group_id, return_fields, datasource = 0 )
ki_station_list( hub, search_term, bounding_box, group_id, return_fields, datasource = 0 )
hub |
The KiWIS database you are querying. Either one of the defaults or a URL. See README. |
search_term |
(Optional) A station name to search for. Supports the use of * as a wildcard. Case doesn't matter. |
bounding_box |
(Optional) A bounding box to search within for stations. Should be a vector or comma separated string. |
group_id |
(Optional) A station group id (see ki_group_list). with the following format: (min_x, min_y, max_x, max_y). |
return_fields |
(Optional) Specific fields to return. Consult your KiWIS hub services documentation for available options. Should be a comma separate string or a vector. |
datasource |
(Optional) The data source to be used, defaults to 0. |
Tibble containing station metadata.
## Not run: ki_station_list(hub = "swmc") ki_station_list(hub = "swmc", search_term = "A*") ki_station_list(hub = "swmc", bounding_box = "-131.7,-5.4,135.8,75.8") ki_station_list(hub = "swmc", group_id = "518247") ## End(Not run)
## Not run: ki_station_list(hub = "swmc") ki_station_list(hub = "swmc", search_term = "A*") ki_station_list(hub = "swmc", bounding_box = "-131.7,-5.4,135.8,75.8") ki_station_list(hub = "swmc", group_id = "518247") ## End(Not run)
Get list of available time series for station or list of stations.
ki_timeseries_list( hub, station_id, ts_name, coverage = TRUE, group_id, return_fields, datasource = 0 )
ki_timeseries_list( hub, station_id, ts_name, coverage = TRUE, group_id, return_fields, datasource = 0 )
hub |
The KiWIS database you are querying. Either one of the defaults or a URL. See README. |
station_id |
Either a single station id or a vector of station ids. Can be string or numeric. Station ids can be found using the ki_station_list function. |
ts_name |
(Optional) A specific time series short name to search for. Supports the use of "*" as a wildcard. |
coverage |
(Optional) Whether or not to return period of record columns. Defaults to TRUE, change to FALSE for faster queries. |
group_id |
(Optional) A time series group id (see ki_group_list). |
return_fields |
(Optional) Specific fields to return. Consult your KiWIS hub services documentation for available options. Should be a comma separate string or a vector. |
datasource |
(Optional) The data source to be used, defaults to 0. |
A tibble containing all available time series for selected stations.
## Not run: ki_timeseries_list(hub = "swmc", station_id = "146775") ki_timeseries_list(hub = "swmc", ts_name = "Vel*") ## End(Not run)
## Not run: ki_timeseries_list(hub = "swmc", station_id = "146775") ki_timeseries_list(hub = "swmc", ts_name = "Vel*") ## End(Not run)
Returns time series values for given time series id and date range.
ki_timeseries_values( hub, ts_id, start_date, end_date, return_fields, datasource = 0 )
ki_timeseries_values( hub, ts_id, start_date, end_date, return_fields, datasource = 0 )
hub |
The KiWIS database you are querying. Either one of the defaults or a URL. See README. |
ts_id |
Either: a single time series id or a vector of time series ids. Time series ids can be found using the 'ki_timeseries_list' function. |
start_date |
A date string formatted "YYYY-MM-DD". Defaults to yesterday. |
end_date |
A date string formatted "YYYY-MM-DD". Defaults to today. |
return_fields |
(Optional) Specific fields to return. Consult your KiWIS hub services documentation for available options. Should be a comma separate string or a vector. |
datasource |
(Optional) The data source to be used, defaults to 0. |
A tibble with following columns by default: Timestamp, Value, ts_name, Units, station_name
## Not run: ki_timeseries_values( hub = "swmc", ts_id = "1125831042", start_date = "2015-12-01", end_date = "2018-01-01" ) ## End(Not run)
## Not run: ki_timeseries_values( hub = "swmc", ts_id = "1125831042", start_date = "2015-12-01", end_date = "2018-01-01" ) ## End(Not run)