cynkra / munch

Functions for working with the historicized list of communes of Switzerland.
https://munch.cynkra.com
6 stars 2 forks source link

Get municipality data (area/pop) from BFS for 2012 and later #18

Open ThomasKnecht opened 4 years ago

ThomasKnecht commented 4 years ago

Link: https://www.bfs.admin.ch/bfs/de/home/statistiken/regionalstatistik/regionale-portraets-kennzahlen/gemeinden.html

krlmlr commented 3 years ago

REST APIs: https://www.bfs.admin.ch/bfs/de/home/dienstleistungen/forschung/api/api-gemeinde.assetdetail.15224054.html

TSchiefer commented 3 years ago

Seems to me that neither area not population data are included in the output of this API. I also wasn't successful in finding another place where we'd be able to automatically get this information. Would you have an idea or know someone who might know more?

krlmlr commented 3 years ago

https://opendata.swiss/de ?

krlmlr commented 2 years ago

Once we have this data, we can check that all mapping tables produce the correct mapping between all pairs of years.

TSchiefer commented 2 years ago

Once we have this data, we can check that all mapping tables produce the correct mapping between all pairs of years.

We already have the function load_bfs_mun_list() (using the REST API mentioned above), that we could use for checking the correct mapping, I think.

TSchiefer commented 2 years ago

Some tests are already using this function (https://github.com/cynkra/munch/blob/main/tests/testthat/test-download_mun_list_by_year.R, https://github.com/cynkra/munch/blob/main/tests/testthat/test-external-consistency.R), but admittedly querying the API makes testing rather slow.