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)
geolevel | geographical level. Options: "national", "canton", "district", "municipality", "zh_counting_districts" or "lakes". |
---|---|
latest | if |
verbose | if |
call_res | result of a previous call to the geodata API. Optional argument. |
a simple feature collection of the desired spatial units with corresponding IDs.
# 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...