
Official keys
bkg_ags.RdRetrieve geographical names associated with official municipality keys
and regional keys. To retrieve their polygon geometries, see
bkg_admin.
These functions interface the wfs_gnde product of the BKG.
Usage
bkg_ags(..., filter = NULL, properties = NULL, max = NULL)
bkg_ars(..., filter = NULL, properties = NULL, max = NULL)Arguments
- ...
Used to construct CQL filters. Dot arguments accept an R-like syntax that is converted to CQL queries internally. These queries basically consist of a property name on the left, an aribtrary vector on the right, and an operator that links both sides. If multiple queries are provided, they will be chained with
AND. The following operators and their respective equivalents in CQL and XML are supported:R CQL XML ===PropertyIsEqualTo!=<>PropertyIsNotEqualTo<<PropertyIsLessThan>>PropertyIsGreaterThan>=>=PropertyIsGreaterThanOrEqualTo<=<=PropertyIsLessThanOrEqualTo%LIKE%LIKEPropertyIsLike%ILIKE%ILIKE%in%INPropertyIsEqualToandOrTo construct more complex queries, you can use the
filterargument to pass CQL queries directly. Also note that you can switch between CQL and XML queries usingoptions(ffm_query_language = "xml"). See alsowfs_filter.- filter
A character string containing a valid CQL or XML filter. This string is appended to the query constructed through
.... Use this argument to construct more complex filters. Defaults toNULL.- properties
Vector of columns to include in the output.
- max
Maximum number of results to return.
Value
A dataframe containing the respective identifier and geographical
names related to their state, government region, district and municipality.
bkg_ars additionally returns the name of the administrative
association.
Query language
While other WFS interfaces like bkg_admin allow querying
using CQL or XML, bkg_ags and bkg_ars (using the GNDE service)
ONLY support XML. This has implications for the allowed query filters
(see wfs_filter).
Examples
# Either get geographical names for identifiers
bkg_ars(ars == "01")
#> # A tibble: 1 × 6
#> ars bundesland regierungsbezirk kreis verwaltungsgemeinsch…¹ gemeinde
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 01 Schleswig-Holste… NA NA NA NA
#> # ℹ abbreviated name: ¹verwaltungsgemeinschaft
# ... or identifiers for geographical names
bkg_ars(gemeinde == "Köln")
#> # A tibble: 1 × 6
#> ars bundesland regierungsbezirk kreis verwaltungsgemeinsch…¹ gemeinde
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 053150000000 Nordrhein… Köln Köln Köln Köln
#> # ℹ abbreviated name: ¹verwaltungsgemeinschaft