OSRM and Demo WPF Desktop Application

Once at work, I was tasked with creating an application simulating the train of a vehicle. The task became relevant due to the fact that for presentation of all the possibilities of the vehicle monitoring system we created we had to show how the system works in different situations and when certain traffic situations occur, for example: a trip along the planned route, speeding, entry into certain geozones and etc. It was necessary to effectively demonstrate all the opportunities for management and potential clients. The main problem was that a real vehicle could get stuck in a traffic jam, lose the gsm / gps signal, and ultimately getting the ideal route for presentations took a very long time and became problematic.
The first thing I needed was to automate the construction of routes. Everything was complicated by the fact that the utility had the opportunity to work offline and I did not have to use paid external mapping providers to build routes such as Google Maps, Yandex maps, etc.
After some time of searching, a solution was found – it was OSRM Routing Machine, which was perfect for solving our problems.
OSRM (Open Source Routing Machine)
The project, open source, which allows you to deploy on your server, your own route building service. For more information, please visit the project website https://github.com/Project-OSRM/osrm-backend/wiki

Install OSRM
Download the OpenStreetMap of the locality we need from Geofabrik

wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
For quick deployment we use the docker image:

docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-contract /data/berlin-latest.osrm
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed /data/berlin-latest.osrm

Demo WPF Desktop Application
As an application for building / editing routes, it was decided to create a desktop WPF application that I realized in a few days
Result of work demo




Comments

Post a Comment

Popular posts from this blog

Ansible - Basic Commands

HOW TO: Install NATS Message Broker