GithubHelp home page GithubHelp logo

ikyaqoob / monav-light Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m4rtink/monav-light

0.0 2.0 0.0 4.95 MB

A lightweight and portable Monav-based offline routing software.

Shell 0.01% C++ 86.53% QMake 1.32% C 11.45% Protocol Buffer 0.68%

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

Watchers

James Cloos avatar Imran Khan avatar

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.