FIS-Broker Datasets

Statistics

By Type

library(kwb.fisbroker)

overview <- kwb.fisbroker::get_dataset_overview() %>% 
  dplyr::filter(.data$cmd == "navigationShowService") 
#> Login to FIS-Broker ... ok. (2.75 secs) 
#> Getting HTML text from 'https://fbinter.stadt-be...d=navigationFrameResult' ... ok. (2.58 secs)

overview_atom <- overview[overview$type == "ATOM",]
overview_wfs <- overview[overview$type == "WFS",]
overview_wms <- overview[overview$type == "WMS",]

overview %>%  
  dplyr::count(.data$type) %>% 
  dplyr::arrange(dplyr::desc(.data$n)) %>% 
  DT::datatable()

By Type and Category

overview %>%  
  dplyr::count(
    .data$type,
    .data$category_name
  ) %>% 
  dplyr::arrange(dplyr::desc(.data$n)) %>% 
  DT::datatable()

Types

ATOM

overview_atom %>%
  dplyr::select(
    .data$dataset_id,
    .data$dataset_name,
    .data$type,
    .data$identifier
  ) %>% 
  DT::datatable()
#> Warning: Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
#> ℹ Please use `"dataset_id"` instead of `.data$dataset_id`
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
#> ℹ Please use `"dataset_name"` instead of `.data$dataset_name`
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
#> ℹ Please use `"type"` instead of `.data$type`
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
#> ℹ Please use `"identifier"` instead of `.data$identifier`
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

WFS

overview_wfs %>%
  dplyr::select(
    .data$dataset_id,
    .data$dataset_name,
    .data$type,
    .data$identifier
  ) %>% 
  DT::datatable()

WMS

overview_wms %>%
  dplyr::select(
    .data$dataset_id,
    .data$dataset_name,
    .data$type,
    .data$identifier
  ) %>% 
  DT::datatable()

Metadata

Fetch


## Only run on KWB-R Github Actions
metadata_atom <- kwb.fisbroker::read_all_metadata(overview_atom, dbg = FALSE)
metadata_wfs <- kwb.fisbroker::read_all_metadata(overview_wfs, dbg = FALSE)
metadata_wms <- kwb.fisbroker::read_all_metadata(overview_wms, dbg = FALSE)

Export

## Only run on KWB-R Github Actions
kwb.fisbroker::write_to("csv", metadata_atom)
kwb.fisbroker::write_to("json", metadata_atom)

kwb.fisbroker::write_to("csv", metadata_wfs)
kwb.fisbroker::write_to("json", metadata_wfs)


kwb.fisbroker::write_to("csv", metadata_wms)
kwb.fisbroker::write_to("json", metadata_wms)

Details

How do get dataset_id for function kwb.fisbroker::read_wfs() ?

overview <- kwb.fisbroker::get_dataset_overview() 

kwb.fisbroker:::lookup_dataset_id(
  overview = overview, 
  dataset_id = 3L, 
  type = "WMS"
)

What happens within get_dataset_overview()?

library(kwb.fisbroker)

response <- login_to_fis_broker() %>%
  compose_fis_broker_url(cmd = "navigationFrameResult") %>%
  httr_get_or_fail()

#open_response(response)

html_tree <- response %>%
  httr::content(as = "text") %>%
  rvest::read_html()

# To be integrated in kwb.fisbroker::get_dataset_overview()...
overview <- kwb.fisbroker:::extract_overview_table(html_tree)

#View(overview)