Giter Site home page Giter Site logo

monav-light's Introduction

MoNav Light

MoNav Light is a lightweight and platform independent offline routing software that works on pre-rpocessed OpenStreetMap data and uses JSON for input and output.

Building

qmake monav-light.pro
make

JSON input format

Example:

{ "dataDirectory": "czech-republic/routing_car", "lookupEdgeNames": true, "routingRadius": 10000, "waypoints": [ [ 49.200000000000003, 16.616667, 0, 0 ], [ 50.083333000000003, 14.416667, 0, 0 ] ] }

  • dataDirectory - path to a valid MoNav offline routing data directory
  • lookupEdges - if name and type of the edges comprising the route should bee looked up
  • routingRadius - how far too look (in meters) around start/destination/waypoints for the nearest edge
  • waypoints a list waypoints the resulting route should pass through, the waypoint list has fields like this:
    • latitude
    • longitude
    • heading penalty - penalty in meters for edge with direction opposite of heading
    • heading - Degrees from North

At least two waypoints are needed for the routing request to be valid.

JSON output format

The output JSON is quite self describing - just run the example and it should be fairly evident what is what.

In short there are 4 main lists:

  • edgeNames - ordered list of names of the edges comprising the route
  • edgeTypes - ordered list of the types (based on OSM tag) of the edges comprising the route
  • edges - an ordered list of edges comprising the route, each edge segment is represented as a list:
    • number of segments - how many segments the given edge has
    • name index - index of the name of the edge in the edgeNames list
    • 0 -> first name in edgeNames, 1 -> second name, etc.
    • type index - index of the type of the edge in the edgeTypes list
    • 0 -> first type in edgeTypes, 1 -> second type, etc.
    • seconds - most probably how many seconds a given mode of transport will need to traverse the edge
    • branching possible - most probably if it is possible to turn to other edges than those comprising the route
  • nodes - list of latitude, longitude lists expressing the points comprising the route

To simply draw the route you can just render all the points from nodes, for turn-by-turn navigation you would usually iterate over all the edges comprising the route and assigning them names based on the name index and assigning nodes by adding number of segements together and using it as an index for the nodes list.

Usage example

Download a preprocessed Monav offline routing data pack:

wget http://data.modrana.org/monav/europe/czech-republic/czech-republic_car.tar.gz

Unpack it:

tar xfv czech-republic_car.tar.gz

Run a routing query:

monav-light "{\"lookupEdgeNames\":true,\"routingRadius\":10000,\"dataDirectory\":\"czech-republic/routing_car\",\"waypoints\":[[49.2,16.616667,0,0],[50.083333,14.416667,0,0]]}"

Resources

Licensing

MoNav Light is, just as Monav, licensed under GPLv3+.

monav-light's People

Contributors

m4rtink avatar tunp avatar yarda avatar

Stargazers

Jeffrey McAteer avatar Matthias Fauconneau avatar Guillaume Dumoulin avatar Virgile Landeiro avatar Lukáš Karas avatar  avatar Marco Piccolino avatar

Watchers

Matthias Fauconneau avatar  avatar James Cloos avatar GP Wang avatar  avatar

monav-light's Issues

Build error too

The error message shows that:
cd plugins/ && make -f Makefile.routingdaemon_plugins
make[1]: Entering directory '/home/ugv-yu/GPP/monav-light/plugins'
cd contractionhierarchies/ && make -f Makefile.routingdaemon_plugins.contractionhierarchiesclient
make[2]: Entering directory '/home/ugv-yu/GPP/monav-light/plugins/contractionhierarchies'
g++ -c -m64 -pipe -O3 -Wno-unused-function -std=c++0x -fPIC -Wall -W -D_REENTRANT -fPIC -DNOGUI -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I../.. -I. -o contractionhierarchiesclient.o contractionhierarchiesclient.cpp
In file included from contractionhierarchiesclient.cpp:20:0:
contractionhierarchiesclient.h:34:20: error: ‘IID’ has not been declared
Q_PLUGIN_METADATA(IID "monav.IRouter/1.1")
^
contractionhierarchiesclient.h:34:24: error: expected ‘,’ or ‘...’ before string constant
Q_PLUGIN_METADATA(IID "monav.IRouter/1.1")
^
contractionhierarchiesclient.h:34:43: error: ISO C++ forbids declaration of ‘Q_PLUGIN_METADATA’ with no type [-fpermissive]
Q_PLUGIN_METADATA(IID "monav.IRouter/1.1")
^
contractionhierarchiesclient.h:34:43: error: expected ‘;’ at end of member declaration
Makefile.routingdaemon_plugins.contractionhierarchiesclient:225: recipe for target 'contractionhierarchiesclient.o' failed
make[2]: *** [contractionhierarchiesclient.o] Error 1
make[2]: Leaving directory '/home/ugv-yu/GPP/monav-light/plugins/contractionhierarchies'
Makefile.routingdaemon_plugins:40: recipe for target 'sub-contractionhierarchies-contractionhierarchiesclient-pro-make_default' failed
make[1]: *** [sub-contractionhierarchies-contractionhierarchiesclient-pro-make_default] Error 2
make[1]: Leaving directory '/home/ugv-yu/GPP/monav-light/plugins'
Makefile:62: recipe for target 'sub-plugins-routingdaemon_plugins-pro-make_default' failed
make: *** [sub-plugins-routingdaemon_plugins-pro-make_default] Error 2

The compiler is gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 and QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib/x86_64-linux-gnu.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.