GVZ Hydranten Finder App to GPX File Converter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.1 KiB

11 months ago
# 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](https://play.google.com/store/apps/details?id=ch.gvz.hydrants) 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
2 months ago
* Copy the SQLite database to your computer:
adb root
adb pull /data/data/ch.gvz.hydrants/databases/hydrants_live.sqlite
11 months ago
## 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](https://de.wikipedia.org/wiki/Schweizer_Landeskoordinaten) 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/](https://github.com/libracore/erpnextswiss/blob/master/erpnextswiss/erpnextswiss/swisstopo.py). This code is AGPLv3 licensed.
An alternative to convert the coordinates could be the REST service [REFRAME](https://www.swisstopo.admin.ch/de/karten-daten-online/calculation-services/m2m.html) of Swisstopo.