Get PLZ Geodata for all of switzerland

237 views
Skip to first unread message

Silvan Spycher

unread,
Jan 8, 2024, 9:02:10 AM1/8/24
to GeoAdminCh API
The Swiss Post had an API at swisspost.opendatasoft.com where one could get the geo_shape for all PLZ-areas for all of Switzerland. Sadly they closed this API due to a small usage volume.

Now I need this data from somewhere else. I tried getting it from the GeoAdmin API but wasn't able to accomplish this until now. The layer "ch.swisstopo-vd.ortschaftenverzeichnis_plz" seems to be the one i'd need for the plz's. However I don't see geodata there.

The geodata i found was on the layer ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill.

Now I have 2 problems:
- How do i connect the data of these 2 layers? After all the same "Gemeinde" can have multiple ZIP-areas, right?
- Is there a way to get the needed data with a single request? Or do i have to send many requests due to pagination?

I would only update these values once per year in my application, so I hope the request volume is not a problem. And sorry if this is a basic question or has been asked multiple times already. I read through everything i could find in both the documentation and fitting threads in this group, but i'm no closer to the solution.

Best regards
Silvan

Pascal Barth

unread,
Jan 8, 2024, 10:08:17 AM1/8/24
to geoadm...@googlegroups.com
Hi Silvan,

You might be able to find the data you need on our OpenData website : https://data.geo.admin.ch/
the layer you are interested in (ch.swisstopo-vd.ortschaftenverzeichnis_plz) can be downloaded as a CSV file here (or as a shapefile).

Would that be enough for you needs?

Best regards,
Pascal

--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/cecd8f6b-3461-4df8-b1c7-7529fd2c9498n%40googlegroups.com.

Michael Gasser

unread,
Jan 8, 2024, 10:45:19 AM1/8/24
to geoadm...@googlegroups.com
Hi Silvan,

As an employee of Swiss Post I can confirm the following:
- One municipality can have several ZIP-Areas
- One ZIP-area can include several municipalities.

Thus working with a single ZIP per municipality will cause headaches at some point.

Also:
- Sometimes, a ZIP-Area and a municipality only differs by the inclusion/exclusion of a few houses / addresses.
- The ZIP-Areas are fairly dynamic and change over time.

With regards to where to obtain the data, I can only guide you to this address, where can get in touch with the right people at Swiss Post: https://www.post.ch/en/business-solutions/address-management/address-and-geodata

Best regards,

Mike

--

Silvan Spycher

unread,
Jan 10, 2024, 9:35:37 AM1/10/24
to GeoAdminCh API
Thank you two for the fast responses. 
Sadly I'm already on other projects and will come back to this problem next week or later. But Pascals link looks promising, thank you!
And thanks for the comments Mike, it may not have been very clear from my initial post, but we know about these "problems" as we had it working already with the Swiss Post API before. And if something is not perfectly up to date and/or not all addresses are perfectly correct that isn't that big of a problem for our application. We just have some addresses, and a search with filters. And there we want the user to be able to filter for all addresses in our database with i.e. being in Bern +5km or being at the ZIP-code 1234 + 10km. So we just need the ZIP-Areas with their geodata as well as a name for them. 

Thanks again, maybe I come back to this thread when i'm back on the project and more questions arise.

Best regards,
Silvan
Reply all
Reply to author
Forward
0 new messages