School coursework. GIS web app for finding tourist tracks and areas of interest. Using Postgis DB, Python Flask as webserver in backend and Leaflet for frontend, e.g. map.
Web and mobile application where you can find hiking tracks nearby your current position. Or you can drag-and-drop pointer and find tracks somewhere else on the map. You can show all hiking shelters in Slovakia. You can find tracks going nearby city which is in your radius. You can find tracks with water source in the way. All the searched tracks are fetched within radius (can be adjusted) within your current position.
Data queried from DB are returned as geojson using Postgis function ST_AsGeojson. If returned data is not a single geojson record, it needs to be transformed to geojson FeatureCollection, this is done on backend. Application frontend can then through api request desired data, e.g. FeatureCollection of all hiking shelters in Slovakia. Response (e.g. geojson FeatureCollection) from api route is then visualized on map using Leaflet.js methods.
- find all shelters
- find nearby hiking tracks in selected radius
- find hiking tracks going near to any city on the way
- find hiking tracks with water source on the way
- Download latest slovakia OSM bz2 file from https://download.geofabrik.de/europe/slovakia.html
- Install Postgres 11+ and Postgis extension.
- Load downloaded slovakia data into the DB by running
osm2pgsql slovakia-latest.osm.bz2 -U postgres -d postgres -P 5432 -W -H localhost -l -s
- Create python virtual env, activate and install requirements
pip install -r requirements.txt
- Start the application
python app.py
- Visit website GUI: http://0.0.0.0:5000/ (see screenshots below)
- Map: openstreemap.org, exported whole Slovakia from geofabrik.de
- Loading data to Postgres (with Postgis extension) has been done using osm2pgsql, command:
osm2pgsql slovakia-latest.osm.bz2 -U postgres -d postgres -P 5432 -W -H localhost -l -s
. - All necessary columns used to query data are indexed.
- Web server: python Flask micro webframework,
- DB: Postgres with Postgis extension,
- Map visualization: Leaflet.js with Mapbox tiles (+ jQuery and Materialize for UI).