GVZ Hydranten Finder App to GPX File Converter
Go to file
Tobias Brunner 531c8fddb0 small updates 2022-04-24 19:12:10 +02:00
.vscode initial commit 2021-08-12 21:40:44 +02:00
.gitignore initial commit 2021-08-12 21:40:44 +02:00
README.md small updates 2022-04-24 19:12:10 +02:00
Swisstopo-REFRAME-Web-API.pdf initial commit 2021-08-12 21:40:44 +02:00
main.py small updates 2022-04-24 19:12:10 +02:00
poetry.lock initial commit 2021-08-12 21:40:44 +02:00
pyproject.toml initial commit 2021-08-12 21:40:44 +02:00

README.md

Fire Hydrants Data Converter

NOTE: This information and scripts apply only to Kanton Zurich, Switzerland.

Unfortunately coordinates of fire hydrants are seemingly not common Open Data in Kanton Zurich. Stadt Zürich has a very nice Open Data strategy, data is openly accessible here https://data.stadt-zuerich.ch/dataset/geo_hydranten.

There is an Android App called GVZ Hydranten Finder which is able to display locations of fire hydrants on a map, but it's very limited and the data is seemingly not accessible.

But: The app has to have to data from somewhere. When extracting this data and feed it to this little Python script, the fire hydrants are then available as GPX file. The data is stored in an SQLite database locally. It is retrieved on startup from a Google Firebase database.

Get the data

  • Install the Android App
  • Start the App, the data is now downloaded
  • Copy the SQLite database to your computer:
    adb root
    adb pull /data/data/ch.gvz.hydrants/databases/hydrants_live.sqlite
    

Convert the data

Run the script python main.py <PLZ> > hydranten.gpx and you're done.

About the data and coordinates

The data is stored in a single table hydrants with the following columns:

  • id
  • status
  • easting
  • northing
  • abgaenge
  • installationsjahr
  • hydrantennummer
  • plz
  • ort
  • strasse

The coordinates are stored in LV95 format which needs to be converted to WGS95 to be compatible with the GPS format. This seems to be a conversion which isn't very accurate, so the position of the fire hydrants is not very accurate as well. But it seems to be "good enough".

Conversion of the coordinates happen with a local function, the source is from here: libracore/erpnextswiss/. This code is AGPLv3 licensed.

An alternative to convert the coordinates could be the REST service REFRAME of Swisstopo.