I used to be able to use the following call to the geo admin API using
ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill to get the actual corresponding BFS-Nr of a coordinate using this call with an example point in Zurich Oerlikon.
Result in April 2024, BFS-Nr is bold:
{"results":
[{"layerBodId":
"ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill",
"layerName": "Municipal boundaries",
"featureId": 261, "id": 261, "properties":
{"gemname": "Z\u00fcrich", "gemflaeche":
9188.0, "perimeter": 58636.99647325312, "kanton":
"ZH", "objektart": 0, "label":
"Z\u00fcrich"}}]}
The current response of the same query gives a lot of history on this specific point and links where I could figure out the current BFS by digesting all changes, but it does not return the current BFS-Id.
Query Result as of March 2025:
{"results":
[{"layerBodId":
"ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill",
"layerName": "Municipal boundaries",
"featureId": "16458-1875", "id":
"16458-1875", "properties": {"gemname":
"Oerlikon", "gemflaeche": 265.0331599743301,
"gde_hist_id": 16458, "gde_nr": 7700, "jahr":
1875, "perimeter": 7888.425209554802, "kanton":
"ZH", "objektart": 11, "is_current_jahr":
false, "objektart_lookup": "politische_gemeinde",
"link_de":
"https://www.agvchapp.bfs.admin.ch/de/communes/results?BfsNr=7700&EntriesFrom=01.01.1872&EntriesTo=31.12.1933&IncludeUnassignedEntities=True",
"link_fr":
"https://www.agvchapp.bfs.admin.ch/fr/communes/results?BfsNr=7700&EntriesFrom=01.01.1872&EntriesTo=31.12.1933&IncludeUnassignedEntities=True",
"link_it":
"https://www.agvchapp.bfs.admin.ch/it/communes/results?BfsNr=7700&EntriesFrom=01.01.1872&EntriesTo=31.12.1933&IncludeUnassignedEntities=True",
"label": "Oerlikon"}}]}
Questions:
- How to build a new query that give me back the functionality I need?
- What expectations on stability in the response can I have on any queries I am running against an established dataset? Am I wrong to assume that responses to queries of established datasets should not start to exclude previous content?
- How do I manage to keep track of changes so production is not affected due to upstream changes?
Thanks, Michael