Skip to content

roataway/osrm-map-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Overview

http://project-osrm.org/ is used for "map matching", it is an algorithm that provides a "snap to road" functionality, without which tracked vehicles might appear that they travel off their designated roads.

  • It is deployed on the streamsheets server, 192.168.13.45, and accepts requets over HTTP on port 5000.
  • The data files are in ~/osrm.

Prerequisites

OSRM requires map data to be prepared in advance, according to these instructions: https://github.com/Project-OSRM/osrm-backend

  1. mkdir ~/osrm && cd ~/osrm
  2. Download the latest map for Moldova from http://download.geofabrik.de/europe/moldova.html, typically it is a matter of wget http://download.geofabrik.de/europe/moldova-latest.osm.pbf
  3. Pre-process the data docker run -t -v --rm "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/moldova-latest.osm.pbf
  4. docker run -t -v --rm "${PWD}:/data" osrm/osrm-backend osrm-partition /data/moldova-latest.osrm
  5. docker run -t -v --rm "${PWD}:/data" osrm/osrm-backend osrm-customize /data/moldova-latest.osrm
  6. After running these commands, many of the generated files are owned by root; it is better to change ownership to your own user chown osrm:osrm ./*.*

Check if all is well

  1. Run the server itself docker run -t -i --rm -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/moldova-latest.osrm (note that the --rm flag ensures the container will be deleted after use; no worries - a new one will be created if you start osrm again via docker)
  2. Sending a test request curl 'http://127.0.0.1:5000/match/v1/driving/28.8260977,47.0231816;28.8260977,47.0231816?radiuses=15;15', you should get a JSON response back.

Production deployment

This is done with systemd, see res/systemd-osrm.template for details. Pay attention to several sneaky differences between what is in the service template file and the commands above:

  • absolute paths are used, so no ${PWD} in the service
  • no -i either, because the service doesn't provide an interactive console

Controlling the service

  • sudo systemctl osrm start|stop|restart
  • sudo journalctl -u osrm -f

References

About

Map-matching service notes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors