Skip to content
mramachi edited this page Jul 24, 2017 · 22 revisions

Cycle Networks Tool

This tool can be used to compare open data sources with OpenStreetMap data. The aim is to identify missing information in the OSM data. The main focus is on missing geometries and missing tags. This tool was first developed to complete the bicycle routes in Brussels.

The tool can be viewed here: https://cyclenetworks.osm.be/

We use Django to serve the webpages, Python for the comparison pipeline and the geometrical comparison is written in C#. The install scripts only works on Ubuntu based distributions. The front-end makes use of OpenLayers.

Installation

  • Install Python version 2
  • Install the following dependencies with pip:
    • django: pip install django
    • geojson: pip install geojson
    • pyproj: pip install pyproj
  • Install the PyOsmium library from here
  • Run the install.sh script or install following software manually:
    • flatpak: apt install flatpak
    • mono-devel: apt install mono-devel
    • monodevelop: flatpak install --user --from https://download.mono-project.com/repo/monodevelop.flatpakref

The webtool can be started by running the Django development server or by setting up a web server like Apache or NGINX. To run the script periodically, a cron job should be set-up to run main.py (e.g. every 15 minutes).

Compiling and running

cd to the nts folder to execute following steps.

Building can be done with: flatpak run --command=/app/bin/xbuild com.xamarin.MonoDevelop /p:Configuration=Release

An executable file NTS-BufferingTest.exe NTS will be built in the bin/Release folder. This can be executed with mono NTS-BufferingTest.exe input1 input2 output.

Workings

Everything comes together in the src/script folder. The main script does all the pre-processing and outputs the comparison files.

Scraping of OSM data

We scrape the data from OpenStreetMap using the Overpass API. The scraping is done in scraper.py.

Comparison

Missing geometries

Missing geometries are extracted in program.cs. It uses methods from the NTS Topology Suite (binaries included).

Missing tags

Tags from the reference data are converted to the correct OSM tags by the pre-processor and it is then compared with the OSM data in the metadata.py component.

Links