php-swiss-cantons
php-swiss-cantons copied to clipboard
Keep Zipcode Dataset automatically up to date
The original zipcode data set has been downloaded from cadastre.ch in 2016. Between 2016 and now, there have probably been some changes: Cities merged with other cities and received a new zipcode, Cities switched Cantons, etc.
I would like to add some bit of code (little bash script) to automatically download the latest dataset from a trusted source. Maybe we can use the open sourced data of the Swiss Post? (https://swisspost.opendatasoft.com/explore/dataset/politische-gemeinden_v2/table/)
If possible, it would also be great to automate this step. GitHub Actions makes it easy to schedule a monthly workflow to execute some scripts.
Related Issues
- https://github.com/stefanzweifel/php-swiss-cantons/issues/27#issuecomment-587806128
In #38 a new console command has been added to:
- download the latest dataset from Swiss Post
- parse the CSV
- simplify the data and store it as
zipcodes.json
We could now write a GitHub Action to periodically run the command and create a PR, if the data set changed. 🤔
Hello
This url https://swisspost.opendatasoft.com/explore/dataset/politische-gemeinden_v2/table/ is broken..
I found this link on www.swisstopo.admin.ch : https://ogd.swisstopo.admin.ch/ch.swisstopo-vd.ortschaftenverzeichnis_plz
There is no difference between ortschaftenverzeichnis_plz_2056.csv.zip and ortschaftenverzeichnis_plz_4326.csv.zip, except for the coordonates format.
The existing command has been updated in #47 and released in https://github.com/stefanzweifel/php-swiss-cantons/releases/tag/5.0.0.
A scheduled GitHub Action that would open a new PR when changes are detected is still missing. I will however open a PR for this soon.