php-swiss-cantons icon indicating copy to clipboard operation
php-swiss-cantons copied to clipboard

Keep Zipcode Dataset automatically up to date

Open stefanzweifel opened this issue 5 years ago • 1 comments

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

stefanzweifel avatar Feb 19 '20 19:02 stefanzweifel

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. 🤔

stefanzweifel avatar Apr 25 '21 12:04 stefanzweifel

Hello This url https://swisspost.opendatasoft.com/explore/dataset/politische-gemeinden_v2/table/ is broken.. image

kira0269 avatar May 17 '24 06:05 kira0269

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. image

kira0269 avatar May 23 '24 06:05 kira0269

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.

stefanzweifel avatar May 26 '24 15:05 stefanzweifel