Giter Club home page Giter Club logo

homebrew-valhalla'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

homebrew-valhalla's People

Contributors

domt4 avatar drewda avatar kevinkreiser avatar

Stargazers

 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

homebrew-valhalla's Issues

MacOS Install error for valhalla/valhalla/prime_server

Command: % brew install valhalla/valhalla/prime_server

Result:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 2 formulae.

==> Tapping valhalla/valhalla
Cloning into '/usr/local/Homebrew/Library/Taps/valhalla/homebrew-valhalla'...
remote: Enumerating objects: 84, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 84 (delta 0), reused 0 (delta 0), pack-reused 80
Unpacking objects: 100% (84/84), done.
Tapped 2 formulae (97 files, 42.4KB).
==> Cloning https://github.com/kevinkreiser/prime_server.git
Cloning into '/Users/bradcolbert/Library/Caches/Homebrew/prime_server--git'...
==> Checking out tag 0.7.0
HEAD is now at bfd1534 prepare for release
Submodule 'logging' (https://gist.github.com/39f2e39273c625d96790.git) registered for path 'src/logging'
Submodule 'testing' (https://gist.github.com/ada902fb51a1ad1e5a27.git) registered for path 'test/testing'
Cloning into '/Users/bradcolbert/Library/Caches/Homebrew/prime_server--git/src/logging'...
Cloning into '/Users/bradcolbert/Library/Caches/Homebrew/prime_server--git/test/testing'...
Submodule path 'src/logging': checked out '10ba199d1e23b356c3446b723289a602663d41ec'
Submodule path 'test/testing': checked out '1c45352fa2c4e25a748cf1221b93a9aed4dbc34c'
/Users/bradcolbert/Library/Caches/Homebrew/prime_server--git/src/logging
/Users/bradcolbert/Library/Caches/Homebrew/prime_server--git/test/testing
==> Installing prime_server from valhalla/valhalla
==> ./autogen.sh
Last 15 lines from /Users/bradcolbert/Library/Logs/Homebrew/prime_server/01.autogen.sh:
configure.ac:28: warning: The macro `AC_LANG_CPLUSPLUS' is obsolete.
configure.ac:28: You should run autoupdate.
./lib/autoconf/c.m4:262: AC_LANG_CPLUSPLUS is expanded from...
configure.ac:28: the top level
configure.ac:37: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_pthread.m4:88: AX_PTHREAD is expanded from...
configure.ac:37: the top level
configure.ac:2: error: possibly undefined macro: m4_esyscmd
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: error: /usr/local/Cellar/autoconf/2.71/bin/autoconf failed with exit status: 1

Failing to install Valhalla to MacOS

Hi Team,
While installing valhalla to MacOS via homebrew I got following issue, please can you check:

`
Installing valhalla from valhalla/valhalla
==> Cloning https://github.com/valhalla/valhalla.git
Updating /Users/sabiralizada/Library/Caches/Homebrew/valhalla--git
==> Checking out revision 9338349dc1c0fce65ec2333d872149268250b7dd
HEAD is now at 9338349dc update to 3.0.2
HEAD is now at 9338349dc update to 3.0.2
Entering 'third_party/OSM-binary'
Entering 'third_party/OSMLR'
Entering 'third_party/date'
Entering 'third_party/dirent'
Entering 'third_party/rapidjson'
Synchronizing submodule url for 'thirdparty/gtest'
Entering 'third_party/rapidjson/thirdparty/gtest'
/Users/sabiralizada/Library/Caches/Homebrew/valhalla--git/third_party/OSM-binary
/Users/sabiralizada/Library/Caches/Homebrew/valhalla--git/third_party/OSMLR
/Users/sabiralizada/Library/Caches/Homebrew/valhalla--git/third_party/date
/Users/sabiralizada/Library/Caches/Homebrew/valhalla--git/third_party/dirent
/Users/sabiralizada/Library/Caches/Homebrew/valhalla--git/third_party/rapidjson
/Users/sabiralizada/Library/Caches/Homebrew/valhalla--git/third_party/rapidjson/thirdparty/gtest
==> git submodule update --init --recursive
==> cmake .. -DENABLE_PYTHON_BINDINGS=On -DCMAKE_BUILD_TYPE=Release -DENABLE_NOD
==> make

Last 15 lines from /Users/sabiralizada/Library/Logs/Homebrew/valhalla/03.make:
make[2]: *** [valhalla_service] Error 1
make[1]: *** [CMakeFiles/valhalla_service.dir/all] Error 2
[ 89%] Linking CXX executable valhalla_convert_transit
/usr/local/Cellar/cmake/3.16.2/bin/cmake -E cmake_link_script CMakeFiles/valhalla_convert_transit.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -fcolor-diagnostics -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/valhalla_convert_transit.dir/src/mjolnir/valhalla_convert_transit.cc.o -o valhalla_convert_transit src/libvalhalla.a /usr/local/lib/libboost_program_options.dylib /usr/local/lib/libboost_filesystem.dylib /usr/local/lib/libboost_system.dylib /usr/local/lib/libprotobuf-lite.dylib /usr/lib/libcurl.dylib /usr/lib/libz.dylib /usr/local/lib/libprime_server.dylib /usr/local/lib/libboost_date_time.dylib /usr/local/lib/libspatialite.dylib /usr/local/opt/sqlite3/lib/libsqlite3.dylib /usr/local/lib/liblua5.3.dylib
[ 89%] Linking CXX executable valhalla_build_statistics
/usr/local/Cellar/cmake/3.16.2/bin/cmake -E cmake_link_script CMakeFiles/valhalla_build_statistics.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -fcolor-diagnostics -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/valhalla_build_statistics.dir/src/mjolnir/valhalla_build_statistics.cc.o CMakeFiles/valhalla_build_statistics.dir/src/mjolnir/statistics.cc.o CMakeFiles/valhalla_build_statistics.dir/src/mjolnir/statistics_database.cc.o -o valhalla_build_statistics src/libvalhalla.a /usr/local/lib/libboost_program_options.dylib /usr/local/lib/libboost_filesystem.dylib /usr/local/lib/libboost_system.dylib /usr/local/lib/libprotobuf-lite.dylib /usr/lib/libcurl.dylib /usr/lib/libz.dylib /usr/local/lib/libprime_server.dylib /usr/local/lib/libboost_date_time.dylib /usr/local/lib/libspatialite.dylib /usr/local/opt/sqlite3/lib/libsqlite3.dylib /usr/local/lib/liblua5.3.dylib
[ 89%] Built target valhalla_build_statistics
[ 89%] Built target valhalla_convert_transit
[ 89%] Linking CXX executable valhalla_fetch_transit
/usr/local/Cellar/cmake/3.16.2/bin/cmake -E cmake_link_script CMakeFiles/valhalla_fetch_transit.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -fcolor-diagnostics -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/valhalla_fetch_transit.dir/src/mjolnir/valhalla_fetch_transit.cc.o -o valhalla_fetch_transit src/libvalhalla.a /usr/local/lib/libboost_program_options.dylib /usr/local/lib/libboost_filesystem.dylib /usr/local/lib/libboost_system.dylib /usr/local/lib/libprotobuf-lite.dylib /usr/lib/libcurl.dylib /usr/lib/libz.dylib /usr/local/lib/libprime_server.dylib /usr/local/lib/libboost_date_time.dylib /usr/local/lib/libspatialite.dylib /usr/local/opt/sqlite3/lib/libsqlite3.dylib /usr/local/lib/liblua5.3.dylib
[ 89%] Built target valhalla_fetch_transit
make: *** [all] Error 2
`

Archive or update valhalla recipe?

I guess prime_server is being maintained by @kevinkreiser. The Valhalla recipe would need a few updates. Or should we remove that one? It’s pretty easy to maintain though, just needs someone doing it:)

improve installation of Python bindings

After running brew audit --strict valhalla.rb, one gets the following warning:

  * python modules have explicit framework links
    These python extension modules were linked directly to a Python
    framework binary. They should be linked with -undefined dynamic_lookup
    instead of -lpython or -framework Python.
      /usr/local/opt/valhalla/lib/python2.7/site-packages/valhalla.so

Perhaps this can be improved with some changes around

# "--link-python-framework-via-dynamic-lookup", TODO: improve Python module stuff

not finding libprotobuf-lite

~ valhalla_service
dyld: Library not loaded: /usr/local/opt/protobuf/lib/libprotobuf-lite.17.dylib
  Referenced from: /usr/local/bin/valhalla_service
  Reason: image not found

failing Valhalla tests on Mac OS

When the Valhalla formula runs make test, it produces the following output:

==> make test
Last 15 lines from /Users/drew/Library/Logs/Homebrew/valhalla/05.make:
# TOTAL: 87
# PASS:  83
# SKIP:  0
# XFAIL: 0
# FAIL:  4
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
Please report to https://github.com/valhalla/valahlla/issues
============================================================================
make[3]: *** [test-suite.log] Error 1
make[2]: *** [check-TESTS] Error 2
make[1]: *** [check-am] Error 2
make: *** [check] Error 2

This is a known issue: valhalla/valhalla#977 and valhalla/valhalla#436

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.