Skip to content

Service that provides map data (overlays) to the PrioBike app such as accident hotspots

License

Notifications You must be signed in to change notification settings

priobike/priobike-map-data

Repository files navigation

priobike-map-data

The scripts in this repository can be used to download map data relevant for cyclists in Hamburg. This contains bicycle stands, rental stations, repair stations, air pump stations, velo routes, the current traffic density, construction sites, and accident spots.

For some datasets, additional processing is performed to obtain meaningful data. For example, the accident spots from the Unfallatlas dataset are clustered to find hotspots and warn users.

To provide this data as map overlays to users of the PrioBike app, it is packaged into a NGINX image which can be deployed as a stateless web service.

Learn more about PrioBike

Quickstart

The easiest way to run a web service with the processed data is to use the contained Dockerfile:

docker build -t priobike-map-data . && docker run -p 80:80 --rm priobike-map-data

API and CLI

main.py

This script executes all the following scripts in the correct order. All possible data is updated with this script.

export_osm_data.py

This script downloads the latest OpenStreetMap data for the city of Hamburg (provided by Geofabrik). These are then filtered based on the values of the fclass attribute and saved in a geojson file. In these datasets, some features are stored as point data and others as polygons. The datasets contain different features.

  • Bicycle stands (point data): gis_osm_traffic_free_1.shpbicycle_parking.geojson (fclass=parking_bicycle)
  • Bicycle stands (polygon data): gis_osm_traffic_a_free_1.shpbicycle_parking_polygon.geojson (fclass=parking_bicycle)
  • Bicycle rental stations (point data): gis_osm_pois_free_1bicycle_rental (fclass=bicycle_rental)
  • Bicycle rental stations (polygon data): gis_osm_pois_a_free_1bicycle_rental_polygon (fclass=bicycle_rental)
  • Bicycle shops/workshops (point data): gis_osm_pois_free_1bicycle_shop (fclass=bicycle_shop)
  • Bicycle shops/workshops (polygon data): gis_osm_pois_a_free_1bicycle_shop_polygon (fclass=bicycle_shop)

export_wfs_data.py

This script downloads data from various Web Feature Services (WFS) of the city of Hamburg and saves them in a geojson file. The following WFS are used:

1. HH_WFS_Bike_und_Ride (data/generated/wfs/bike_and_ride.geojson)

The dataset contains the location of bicycle parking facilities at rapid transit stations in the Hamburg metropolitan area. For each facility, the number of public parking spaces (covered and uncovered) and, if available, the number of lockable rental spaces are provided. More details here. License. Source.

2. HH_WFS_Verkehrslage (data/generated/wfs/traffic.geojson)

The dataset contains real-time traffic conditions (updated every 5 minutes) on the Hamburg road network and major roads in the immediate vicinity of Hamburg, as well as on highways running through Hamburg south to Lüneburg, Hannover, and Bremen, and north to Itzehoe, Flensburg, and Lübeck.

Traffic conditions are classified into four states, from state class 1, free-flowing traffic (green) to state class 4, congested traffic (dark red). If no data is available for individual segments, no traffic condition is displayed. More details here. License. Source.

3. HH_WFS_Baustellen (data/generated/wfs/construction_sites.geojson)

Construction sites on major roads and federal highways in Hamburg. More details here. License. Source.

4. HH_WFS_Stadtrad (data/generated/wfs/stadt_rad.geojson)

The dataset contains the position of all StadtRAD stations in the Hamburg metropolitan area and the number of bicycles and cargo pedelecs currently available for rent. More details here. License. Source.

5. HH_WFS_Fahrradluftstationen (data/generated/wfs/bike_air_station.geojson)

License. Source.

6. HH_WFS_ITS_Dienste_Hamburg (data/generated/wfs/static_green_waves.geojson)

Static green waves in Hamburg. More details here. License. Source.

7. HH_WFS_ITS_Dienste_Hamburg (data/generated/wfs/prio_change.geojson)

More details here. License. Source.

8. HH_WFS_Velorouten (data/generated/wfs/velo_routes.geojson)

The dataset contains the network of the

Hamburg veloroutes. More details here. License. Source.

What else to know

  • All geodata generated by these scripts is stored in the EPSG:4326 coordinate system.
  • The main.py script should be used to execute all scripts in the correct order to update all data.
  • Ensure the required Python libraries are installed to avoid any issues during execution.
  • The generated geojson files contain valuable geographical information for the PrioBike app and are saved in the EPSG:4326 coordinate system.

Contributing

We highly encourage you to open an issue or a pull request. You can also use our repository freely with the MIT license.

Every service runs through testing before it is deployed in our release setup. Read more in our PrioBike deployment readme to understand how specific branches/tags are deployed.

Additional credit goes to our external contributors: SoWieMarkus

Anything unclear?

Help us improve this documentation. If you have any problems or unclarities, feel free to open an issue.

About

Service that provides map data (overlays) to the PrioBike app such as accident hotspots

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •