Giter VIP home page Giter VIP logo

demos's Introduction

 ██▒   █▓ ▄▄▄       ██▓     ██░ ██  ▄▄▄       ██▓     ██▓    ▄▄▄
▓██░   █▒▒████▄    ▓██▒    ▓██░ ██▒▒████▄    ▓██▒    ▓██▒   ▒████▄
 ▓██  █▒░▒██  ▀█▄  ▒██░    ▒██▀▀██░▒██  ▀█▄  ▒██░    ▒██░   ▒██  ▀█▄
  ▒██ █░░░██▄▄▄▄██ ▒██░    ░▓█ ░██ ░██▄▄▄▄██ ▒██░    ▒██░   ░██▄▄▄▄██
   ▒▀█░   ▓█   ▓██▒░██████▒░▓█▒░██▓ ▓█   ▓██▒░██████▒░██████▒▓█   ▓██▒
   ░ ▐░   ▒▒   ▓▒█░░ ▒░▓  ░ ▒ ░░▒░▒ ▒▒   ▓▒█░░ ▒░▓  ░░ ▒░▓  ░▒▒   ▓▒█░
   ░ ░░    ▒   ▒▒ ░░ ░ ▒  ░ ▒ ░▒░ ░  ▒   ▒▒ ░░ ░ ▒  ░░ ░ ▒  ░ ▒   ▒▒ ░
     ░░    ░   ▒     ░ ░    ░  ░░ ░  ░   ▒     ░ ░     ░ ░    ░   ▒
      ░        ░  ░    ░  ░ ░  ░  ░      ░  ░    ░  ░    ░  ░     ░  ░
     ░

Valhalla is an open source routing engine and accompanying libraries for use with OpenStreetMap data. Valhalla also includes tools like time+distance matrix computation, isochrones, elevation sampling, map matching and tour optimization (Travelling Salesman).

Build Status

Linux/MacOs Windows Code Coverage
Circle CI Windows CI codecov

License

Valhalla, and all of the projects under the Valhalla organization, use the MIT License. Avatar/logo by Jordan.

OpenStreetMap data in the ./test/data is licensed under ODbL and copyrighted by OSM contributors. Additional information on licenses and other requirements concerning the data sources most frequently used by Valhalla can be found in the docs.

Overview

There are several key features that we hope can differentiate the Valhalla project from other routing and network analysis engines. They are:

  • Open source software, on open source data with a very liberal license. Should allow for transparency in development, encourage contribution and community input, and foster use in other projects.
  • Tiled hierarchical data structure. Should allow users to have a small memory footprint on memory constrained devices, enable offline routing, provide a means for regional extracts and partial updates.
  • Dynamic, runtime costing of edges and vertices within the graph via a plugin architecture. Should allow for customization and alternate route generation.
  • C++ based API. Should allow for cross compilation of the various pieces to enable routing on offline portable devices.
  • A plugin based narrative and manoeuvre generation architecture. Should allow for generation that is customized either to the administrative area or to the target locale.
  • Multi-modal and time-based routes. Should allow for mixing auto, pedestrian, bike and public transportation in the same route or setting a time by which one must arrive at a location.

Demo Server

FOSSGIS e.V. hosts a demo server which is open to the public and includes a full planet graph with an open-source web app on https://valhalla.openstreetmap.de. The HTTP API is accessible on a slightly different subdomain, e.g. https://valhalla1.openstreetmap.de/isochrone. Usage of the demo server follows the usual fair-usage policy as OSRM & Nominatim demo servers (somewhat enforced by rate limits).

Platform Compatibility

Valhalla is fully functional on many Linux and Mac OS distributions, and is also used on iOS and Android devices.

For Windows, not all functionality is fully supported yet. Building the Valhalla library works flawlessly, as well as the following application modules:

  • TOOLS: utilities to query and benchmark various components
  • DATA_TOOLS: utilities to build input data and handle transit
  • PYTHON_BINDINGS: use all actions (route, isochrones, matrix etc) via the Valhalla Python library (needs a full (i.e. development) Python distribution in the PATH)

Organization

The Valhalla organization is comprised of several library modules each responsible for a different function. The layout of the various modules is as follows:

  • Midgard - Basic geographic and geometric algorithms for use in the various other projects.
  • Baldr - The base data structures for accessing and caching tiled route data.
  • Sif - Library used in costing of graph nodes and edges. This can be used as input to loki and thor.
  • Skadi - Library and service for accessing elevation data. This can be used as input to mjolnir or as a standalone service.
  • Mjolnir - Tools for turning open data into Valhalla graph tiles.
  • Loki - Library used to search graph tiles and correlate input locations to an entity within a tile. This correlated entity (edge or vertex) can be used as input to thor.
  • Meili - Library used to for map-matching.
  • Thor - Library used to generate a path through the graph tile hierarchy. This path and attribution along the path can be used as input to odin.
  • Odin - Library used to generate manoeuvres and narrative based on a path. This set of directions information can be used as input to tyr.
  • Tyr - Service used to handle http requests for a route communicating with all of the other valhalla APIs. The service will format output from odin and support json (and eventually protocol buffer) output.
  • Tools - A set command line tools that exercise bits of functionality from the library components above and provide the basis for quality testing and performance benchmarking.
  • Demos - A set of demos which allows interacting with the service and APIs.

Documentation

Documentation is stored in the docs/ folder in this GitHub repository. It can be viewed at valhalla.github.io/valhalla.

Installation

To run Valhalla locally or your own server, we recommend using our Docker image. Checkout our docker image here: https://github.com/orgs/valhalla/packages. Also, there's a community Docker image with more "magic" than the native one.

If you want to build Valhalla from source, follow the documentation.

For more information on binaries, see Command Line Tools section below and the docs.

Contributing

We ❤️ contributions to Valhalla. They could be non-technical, e.g. translations into other languages via Transifex or documentation improvements, or technical ones like bug fixes or feature implementations. It's important to open an issue before setting out to work on a PR.

Ideally, get familiar with our Contribution guidelines first.

Benchmarks

Valhalla includes several microbenchmarks which you can build and run using:

make benchmarks
make run-benchmarks

They are enabled by the -DENABLE_BENCHMARKS=On CMake flag and are currently only available for Linux and MacOS.

Command Line Tools

valhalla_service aka one-shot mode

If you can't (e.g. Windows Server) or don't want to have the full-fledged HTTP API running, you can have the (almost) exact same behavior with the 'valhalla_service' executable in so-called "one-shot" mode. It's simple, just pass the config file, the action (route, isochrone, matrix etc) and the stringified JSON request (or alternatively a file containing the request to circumvent shell command length issues):

valhalla_service valhalla.json isochrone '{"locations":[{"lat":42.552448,"lon":1.564865}],"costing":"auto","contours":[{"time":10,"color":"ff0000"}], "show_locations":true}'
# Alternatively you can pass a file with the same contents
valhalla_service valhalla.json isochrone isochrone_request.txt

It's important to note that all Valhalla logs for one-shot mode are piped to stderr while the actual JSON response will be in stdout. To completely silence the logs, pass type: "" to midgard.logging in the config file.

Batch Script Tool

Related projects

The following projects are open-source and built with the intention to make it easier to use Valhalla and its features:

  • OpenStreetMapSpeeds: A project conflating open GPS data to improve Valhalla's speed classification. The current JSON is from early 2022 and can be downloaded here and used by setting the path in the mjolnir.default_speeds_config config option.
  • docker-valhalla: An easy-to-use, relatively magical Docker image for Valhalla, which only requires setting a few environment variables in docker-compose.yml to get a full-featured Valhalla instance.
  • valhalla-operator: A k8s operator to deploy and manage Valhalla.
  • valhalla-app: A React based web app for Valhalla, powering https://valhalla.openstreetmap.de/.
  • valhalla-qgis-plugin: A QGIS plugin for Valhalla, also available in the official QGIS plugin store. Note, it's almost deprecated and will be replaced with a much superior alternative.
  • routingpy: A Python client for most open-source routing engines, including Valhalla, with a common interface for all engines. Available on PyPI.
  • routingjs: A TypeScript client for most open-source routing engines, including Valhalla, with a common interface for all engines. Available as engine-specific packages on npm.
  • pyvalhalla: Python bindings for Valhalla, so its APIs can be used from within Python without a HTTP service. Available on PyPI.
  • Valhalla_jll.jl: Valhalla binaries shipped for Julia.
  • valhalla-go: Valhalla Golang bindings via cgo

demos's People

Contributors

andrewharvey avatar aurelienlp avatar danpaz avatar dgearhart avatar dnesbitt61 avatar drewda avatar gknisely avatar hanbyul-here avatar kdiluca avatar kevinkreiser avatar louh avatar merkispavel avatar nilsnolde avatar ptpt avatar rmglennon avatar xlqian avatar zerebubuth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

demos's Issues

update matrix demo to use sources_to_targets

all the matrix end points are special cases of sources_to_targets. we should update the demo to just use sources_to_targets as, its easier to understand and the preferred method from within the service code as well. this will require some ui changes to the demo as we need to some how choose whether we are click points for sources or for targets but otherwise thats about the only change that needs to be made save for a small request format change to accommodate two lists of locations.

this was suggested in valhalla/valhalla#870

Update demos that do not include API keys

It looks like a few of these demos are missing API keys -- mostly, the simpler ones without configuration files.

Let's fix up any of these that rely on keyless access that need to continue to function. For example, the isochrone demo is linked to from a blog post.

PS - while you're in there, please fix the typo in a href="http://openstreetmap.org">OpenStreetMap contributers ---> contributors. :)

No edge/node costing provided

I'm getting the following error log for map_matching/index-internal.html demo on my local valhalla server:

66 2019/11/26 19:57:19.815257 GET /trace_attributes?api_key=&{%22costing%22:%22auto%22,%22shape_match%22:%22map_snap%22,%22filters%22:{%22attributes%22:[%22edge.way_id%22,%22edge.begin_shape_index%22,%22edge.end_shape_index%22,%22matched.point%22,%22matched.edge_index%22,%22matched.begin_route_discontinuity%22,%22matched.end_route_discontinuity%22,%22shape%22],%22action%22:%22include%22},%22encoded_polyline%22:%22jQuery111308051844215711581_1574798237645%22}&_=1574798237646 HTTP/1.1
2019/11/26 19:57:19.815359 [INFO] Got Loki Request 66
2019/11/26 19:57:19.815463 [ANALYTICS] 400::No edge/node costing provided
66 2019/11/26 19:57:19.815556 400 227

There seems to be an issue with the cost parameter but I couldn't figure it out after checking Map Matching API docs.

internal demo default server

can we change this to localhost or at least to dev? it seems silly that it defaults to the same thing as the non internal version so you have to change it every time you go to the page

update map matching demo to use trace_attributes api

we've deleted the meili based services and are now using the trace_attributes service everywhere. the demo however still expects the meili specific one. the changes here should just be to take the input request and reformat it so it matches what trace_attributes expects and then take the response from trace_attributes and reformat it to look like what the meili service returned. in the future we could make use of more of the functions of trace_attributes but for now i think this little bit of marshaling is enough to fix the demo.

Control defaults per html demo pages

examples:
multimodal page - default map to zinc
multimodal - default mode to transit
index.html - default map to road
index.html - default mode to auto

Valhalla returning convoluted transit routes

For example here:
valhalla-strange-routing

Taking the Metro from the starting point, it would take 1 transfer to get to the blue line and get to the destination, because as you can see the Metro Yellow line intercepts with the Metro Blue line instead it says to take the Metro from departure for 3 stations only and take a few buses in between, and completely discards the Metro the rest of the way, when there are more optimal routes, being it taking the Yellow line until it intercepts with the Blue line, or even taking the Yellow line, doing a transfer to the Red line, take the Red for one stop and transfer to the Blue line. And probably there are buses that connect the 2 places on a straighter path than using the Metro. The total journey by Metro is like 1h:15m, yet, using the given instructions, it's more than 6 hours.

Any ideas about anything I may tune on the valhalla config file that may help with this? Is it a problem with the transit data from Transit.land? Any clues?

BTW, here is what was requested from valhalla by the frontend: /route?json={%22locations%22:[{%22options%22:{%22allowUTurn%22:false},%22latLng%22:{%22lat%22:38.793663869859806,%22lng%22:-9.173669815063477},%22_initHooksCalled%22:true,%22lat%22:38.793663869859806,%22lon%22:-9.173669815063477},{%22options%22:{%22allowUTurn%22:false},%22latLng%22:{%22lat%22:38.75240990134552,%22lng%22:-9.22478199005127},%22_initHooksCalled%22:true,%22lat%22:38.75240990134552,%22lon%22:-9.22478199005127}],%22costing%22:%22multimodal%22,%22costing_options%22:{%22transit%22:{%22use_bus%22:%220.1%22,%22use_rail%22:%220.9%22,%22use_transfers%22:%220.1%22}},%22directions_options%22:{%22language%22:%22en-US%22},%22date_time%22:{%22type%22:1,%22value%22:%222018-02-28T16:03%22}}

elevation: mobile optimization

  • cannot add points to map on mobile (iOS: Safari, Chrome)
  • map not visible when phone is in landscape mode (iOS: Safari, Chrome)
  • make map bigger in portrait mode (iOS: Safari, Chrome)

Doesn't work with local Valhalla service

It seems that by default the demo map connects MapZen's routing service instead of the local Valhalla server. I tried to change the serviceUrl in L.Routing.Valhalla.js to http://localhost:8002/ but it still failed in browsers (tested in Firefox and Chrome) because of the Same Origin Policy (same hostname, but different port).

elevation: map credit typo

change

Leaflet | Maps © Thunderforest, ;Data © OpenStreetMap contributors

to

Leaflet | Maps © Thunderforest | Data © OpenStreetMap contributors

remember last used mode of travel

it would be cool if the didnt reset all the time. maybe we could have the modes be radio buttons and have a single button for running the route. that way the mode is always set to something that is known by the user instead of resetting.

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.