-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get mutations via API #20
Comments
@krlmlr -> see branch: https://github.com/cynkra/SwissCommunes/tree/f-20-download-with-api We can download the data with the api, but some variables are missing such as: mAbolitionDate as well as the mAdmissionDate. Furthermore the download takes a long time and it returns everything as a single character string. I added a method which is also used by swissdata. It uses the BFS_NR of the file to scrape the asset number which allows us to download the same files structure as we had before. I prefer this method, since we get them in the same structure and all the variables are present. What is your opinion about the download method? |
Thanks. If we can reliably get the asset ID I'm fine with that approach. Basically, I'm fine with anything we can stuff into a GitHub Action ;-)
|
You are right, the api data has similar structure to our data after saw_get_mutations(), but only the mutation date is given. |
- `swc_read_data()` now always fetches the most recent dataset (#20).
A useful next step would be to write the result of |
We now have |
I don't think the current approach of |
Hey there, I just randomly stumbled upon this repo. If you'd like to work with the API mentioned above: I've written an R package (AGPL-3+) named swissmuni a while ago which allows to access all endpoints and offers as much documentation as I could put together (I've updated the doc just now since I only now learned about the PDF available here which wasn't around two years ago). As you already noticed, the API is very slow. Thus I've added a caching mechanism (building upon pkgpins). Be aware that the caching might not work as intended on Windows (cache lost after R session restart I think), I still have to investigate that. Besides that, everything else should be stable. I never got around to publish the package on CRAN, but you can simply install it using |
Thanks! The API seems to deliver data that looks slightly different from what we are processing internally. It would be great to have a closer look to understand the differences and perhaps consolidate. |
https://www.bfs.admin.ch/bfs/de/home/dienstleistungen/forschung/api/api-gemeinde.assetdetail.15224054.html
Also check how zazuko is doing it. Old way: zazuko/fso-lod@e8f08de, maybe this has improved by now?
The text was updated successfully, but these errors were encountered: