get_geodata retrieves the latest geodata provided by the Federal Statistical Office in connection with federal votes.

get_geodata(geolevel = "municipality", latest = T, verbose = F, call_res)

Arguments

geolevel

geographical level. Options: "national", "canton", "district", "municipality", "zh_counting_districts" or "lakes".

latest

if TRUE, the latest data is retrieved. If FALSE, geo data from the beginning of the year is retrieved. The API does not support finer distinctions. For more detailed information on the exact status of the data, please use verbode = TRUE.

verbose

if TRUE, the date from which the data originates is displayed.

call_res

result of a previous call to the geodata API. Optional argument.

Value

a simple feature collection of the desired spatial units with corresponding IDs.

Examples

# Get latest geodata at municipal level get_geodata()
#> Simple feature collection with 2141 features and 1 field #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 485203 ymin: 75282.37 xmax: 834035 ymax: 295864.1 #> CRS: NA #> First 10 features: #> mun_id geometry #> 1 1 MULTIPOLYGON (((678565 2380... #> 2 2 MULTIPOLYGON (((673824.2 23... #> 3 3 MULTIPOLYGON (((676425.6 24... #> 4 4 MULTIPOLYGON (((680601.6 23... #> 5 5 MULTIPOLYGON (((675433 2409... #> 6 6 MULTIPOLYGON (((679215.3 23... #> 7 7 MULTIPOLYGON (((676323 2307... #> 8 8 MULTIPOLYGON (((675450.1 23... #> 9 9 MULTIPOLYGON (((676168.9 23... #> 10 10 MULTIPOLYGON (((672865.8 23...
# Get latest geodata at cantonal level get_geodata(geolevel = "canton")
#> Simple feature collection with 26 features and 1 field #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 485203 ymin: 75282.37 xmax: 834035 ymax: 295864.1 #> CRS: NA #> First 10 features: #> canton_id geometry #> 1 1 MULTIPOLYGON (((696655.2 22... #> 2 2 MULTIPOLYGON (((575329.1 19... #> 3 3 MULTIPOLYGON (((671941.6 20... #> 4 4 MULTIPOLYGON (((679711.7 15... #> 5 5 MULTIPOLYGON (((713992.4 19... #> 6 6 MULTIPOLYGON (((672540.6 18... #> 7 7 MULTIPOLYGON (((678719 1898... #> 8 8 MULTIPOLYGON (((718733.2 22... #> 9 9 MULTIPOLYGON (((678051.5 21... #> 10 10 MULTIPOLYGON (((583082 1974...