Commit 5817fb90 authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

allowed request by location and bbox

parent d1b91e5b
......@@ -13,11 +13,11 @@
luftlyr_get_data <- function(x,username,password) {
db <- luftkvalr::luftkvalr()
db$start(username,password)
tmp_st <- db$GetAQStations(stationIDs=x$stationObj$station_id,locationName=x$stationObj$locationName)
tmp_ts <- db$GetAQTimeseries(stationIDs=tmp_st$ST_ID,componentName=x$elementObj$element_id)
tmp_st <- db$GetAQStations(stationIDs=x$stationObj$station_id,west=x$stationObj$west,south=x$stationObj$south,east=x$stationObj$east,north=x$stationObj$north)
tmp_ts <- db$GetAQTimeseries(stationIDs=unique(tmp_st$ST_ID),componentName=x$elementObj$element_id)
if (nrow(tmp_st)>0) {
res <- db$GetAQData(stationIDs=tmp_st$ST_ID,
res <- db$GetAQData(stationIDs=unique(tmp_st$ST_ID),
timeSeriesIDs=tmp_ts$TS_ID,
fromDateTime=as.character(x$timeObj$fromDateTime()+3600), #UTC+1, no summer time
toDateTime=as.character(x$timeObj$toDateTime()+3600)) #UTC+1, no summer time
......@@ -43,9 +43,9 @@ luftlyr_get_data <- function(x,username,password) {
luftlyr_get_meta <- function(x,username,password) {
db <- luftkvalr::luftkvalr()
db$start(username,password)
tmp_st <- db$GetAQStations(stationIDs=x$stationObj$station_id,locationName=x$stationObj$locationName)
tmp_st <- db$GetAQStations(stationIDs=x$stationObj$station_id,west=x$stationObj$west,south=x$stationObj$south,east=x$stationObj$east,north=x$stationObj$north)
if (nrow(tmp_st)>0) {
tmp_ts <- db$GetAQTimeseries(stationIDs=tmp_st$ST_ID,componentName=x$elementObj$element_id)
tmp_ts <- db$GetAQTimeseries(stationIDs=unique(tmp_st$ST_ID),componentName=x$elementObj$element_id)
db$stop()
colnames(tmp_ts) <- c("ID","NAME","ALT","LAT","LON","TS_ID","CO_NAME","TS_Z1","TS_Z2")
return(tmp_ts[,c(1:5,7)])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment