High-level bindings to the Valhalla framework.

Overview

Valhalla for Python

This spin-off project simply offers improved Python bindings to the fantastic Valhalla project.

Installation

pip install valhalla

We package CPython 3.7, 3.8, 3.9 binary wheels for Win64, MacOS X and Linux distributions with glibc>=2.24 (most modern systems, see PEP 600). We do not offer a source distribution on PyPI. Please contact us on [email protected] if you need support building the bindings for your platform.

Build

First you need to build and install valhalla. On Linux I use:

cmake -B build -DENABLE_BENCHMARKS=OFF -DENABLE_PYTHON_BINDINGS=OFF -DENABLE_TESTS=OFF -DENABLE_TOOLS=OFF -DENABLE_SERVICES=OFF -DENABLE_HTTP=OFF -DCMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build -- -j$(nproc)
cmake --build . --target install

This should be enough for all platforms. For OSX and Linux the wheels have to be fixed with auditwheel or delocate.

pip install setuptools wheel setuptools_scm setuptools_scm_git_archive pybind11
python setup.py bdist_wheel

Usage

TBD

Comments
  • Change configuration

    Change configuration

    We can use get_help() to retrieve the config information. Could we change the configuration? For example, I want to increase the number of points allowed in trace.

    opened by vtao1989 2
  • Link protobuf statically

    Link protobuf statically

    WIP

    this will allow the python bindings to link to a static protobuf library which will circumvent problems with the qgis python console. it's a little patchy still, at some point we might want to include tile building and depend on spatialite which will cause the same problem. there's a good chance though that spatialite static is in debian's package manager and is compiled with position-independent-code :crossed_fingers:

    still needs:

    • [x] choose a protobuf tag. probably latest, cmake wasn't introduced until very recently
    • [x] smth is messed up with pre-commit
    • [x] update the manylinux image to have the image built protobuf from source
    • [x] adapt and test windows in qgis (comment: couldn't make static linking of protobuf work on windows, maybe bcs libvalhalla is linking dynamically.. actually it took the protobuf-lite.lib but still the resulting .pyd would, maybe additionally, link to the .dll)
    • [x] adapt and test mac os in qgis 🤞 (didn't actually test it works in qgis, but only built the lib on mac)
    opened by nilsnolde 2
  • fix wheel build for win

    fix wheel build for win

    it appears that mvsc does not copy the dependency .dll's to the python distribution (it does do that with valhalla's cmake). so we need another tool similar to auditwheel & delocate. seems that https://github.com/adang1345/delvewheel is a good option. even cibuildwheel considered using it by default.

    opened by nilsnolde 1
  • release v3.0.0

    release v3.0.0

    new, other PR didn't build anymore for some reason..

    branch to collect all things to be done before releasing v3.0.0:

    • ~~all main OSs are integrated~~
    • improve documentation/tutorials with some binder stuff
    opened by nilsnolde 0
  • release v3.0.0

    release v3.0.0

    branch to collect all things to be done before releasing v3.0.0:

    • ~~all main OSs are integrated~~
    • improve documentation/tutorials with some blender package
    opened by nilsnolde 0
  • Solve CI and publishing on PyPI

    Solve CI and publishing on PyPI

    fixes #2, fixes #3

    finally worked for both linux & windows. eventually the process became:

    • we checked in all needed libraries, including valhalla, for all platforms (mac still missing)
    • so we have to build any binary dependency locally and also update all headers etc. easy for win (simply copy the vcpkg libs & headers), but it's harder for linux of course (script provided), mac we'll see, expected to be easier than linux
    • valhalla is registered as submodule but is solely used locally when we want to update valhalla
    • added __version__ and __valhalla_commit to __init__.py, guess that'll become important
    • releasing scheme will be .., but only after we're out of 0.x
    opened by nilsnolde 0
  • Segment fault

    Segment fault

    Package and system information: pyvalhalla 3.0.3 with python 3.10.6 in the Debian Linux 11.

    My task was to map match several trips to the roads. The issue was that, after trace_route returned a RuntimeError with "Exact route match algorithm failed to find path" when map matching a trip, map matching another trip caused the "Segment fault" error.

    opened by vtao1989 2
  • Try PBF in-/output

    Try PBF in-/output

    For maximum performance & output information we could try protobuf in-/output optionally. Probably quite a bit of work, if we want to do it properly, so I’d first try to benchmark the HTTP service to see if it’s worth it. Also, would be much nicer if all endpoints are protobuf compatible, e.g. matrix/isochrone & expansion are not.

    opened by nilsnolde 0
  • More convenience stuff

    More convenience stuff

    I haaate the location stuff for Valhalla😅 Coords ALWAYS come as lists in one way or another so let’s at least give some convenience function that accepts a ([lon, lat], **kwargs) and returns a location object.

    opened by nilsnolde 0
  • 3.11 is out

    3.11 is out

    Another year passed, python 3.11 is out, so we should build for that as well. Thankfully it's not updated yet on Arch, but usually is within a few weeks, so let's get it built together with #19.

    opened by nilsnolde 0
  • Error setting

    Error setting

    Hi,

    I am map matching a large number of trips to the roads (more than 1000). I currently use a for-loop strategy to match one trip for each request. The issue is when there is a failed match, pyvalhalla will return an error message and stop the loop. Is there a configuration to avoid pyvalhalla to return the error message?

    Or is there a better way than for loop to map match a large number of trips?

    Thank you so much.

    opened by vtao1989 13
Releases(3.0.3)
  • 3.0.3(Sep 11, 2022)

    What's Changed

    • Link protobuf statically by @nilsnolde in https://github.com/gis-ops/pyvalhalla/pull/14

    Full Changelog: https://github.com/gis-ops/pyvalhalla/compare/3.0.2...3.0.3

    Source code(tar.gz)
    Source code(zip)
  • 3.0.2(Mar 10, 2022)

  • 3.0.1(Mar 10, 2022)

  • 3.0.0(Mar 8, 2022)

Owner
GIS • OPS
We at GIS • OPS are passionate about spatial data and build custom solutions evolving around routing, web-maps & spatial databases.
GIS • OPS
CoreSE - basic of social Engineering tool

Core Social Engineering basic of social Engineering tool. just for fun :) About First of all, I must say that I wrote such a project because of my int

Hamed Mohammadvand 7 Jun 10, 2022
A program that lets you use your tablet's tilting to emulate an actual joystick on a Linux computer.

Tablet Tilt Joystick A program that lets you use your tablet's tilting to emulate an actual joystick on a Linux computer. It's called tablet tilt joys

1 Feb 07, 2022
Tools for dos (denial-of-service) website / web server

DoS Attack Tools Tools for dos (denial-of-service) website / web server di buat olah NurvySec How to install on debian / ubuntu $ apt update $ apt ins

nurvy 1 Feb 10, 2022
A simple app that helps to train quick calculations.

qtcounter A simple app that helps to train quick calculations. Usage Manual Clone the repo in a folder using git clone https://github.com/Froloket64/q

0 Nov 27, 2021
Procedural modeling of fruit and sandstorm in Blender (bpy).

SandFruit Procedural modelling of fruit and sandstorm. Created by Adriana Arcia and Maya Boateng. Last updated December 19, 2020 Goal & Inspiration Ou

Adriana Arcia 2 Mar 20, 2022
A module comment generator for python

Module Comment Generator The comment style is as a tribute to the comment from the RA . The comment generator can parse the ast tree from the python s

飘尘 1 Oct 21, 2021
Generalise Prometheus metrics. takes out server specific, replaces variables and such.

Generalise Prometheus metrics. takes out server specific, replaces variables and such. makes it easier to copy from Prometheus console straight to Grafana.

ziv 5 Mar 28, 2022
Inverted-pendulum-with-fuzzy-control - Inverted pendulum with fuzzy control

Fuzzy Inverted Pendulum Basically, this project consists of an inverted pendulum

Mahan Ahmadvand 1 Aug 25, 2022
Python Monopoly Simulator

Monopoly simulator Original creator: Games Computer Play YouTube: https://www.youtube.com/channel/UCTrp88f-QJ1SqKX8o5IDhWQ Config file (optional) conf

Games Computers Play 37 Jan 03, 2023
Python implementation of the ASFLIP advection method

This is a python implementation of the ASFLIP advection method . We would like to hear from you if you appreciate this work.

Raymond Yun Fei 133 Nov 13, 2022
A simple countdown timer in eazy code to show timer with python

Countdown_Timer The simple CLI countdown timer in eazy code to show timer How Work First you fill the input by int-- (Enter the time in Seconds:) for

Yasin Rezvani 3 Nov 15, 2022
Ramadhan countdown - Simple daily reminder about upcoming Ramadhan

Ramadhan Countdown Bot Simple bot for displaying daily reminder about Islamic pr

Abdurrahman Shofy Adianto 1 Feb 06, 2022
A free and powerful system for awareness and research of the American judicial system.

CourtListener Started in 2009, CourtListener.com is the main initiative of Free Law Project. The goal of CourtListener.com is to provide high quality

Free Law Project 332 Dec 25, 2022
Cylinder volume calculator features the calculations of the volume of a Right /oblique full cylinder

Cylinder-Volume-Calculator Cylinder volume calculator features the calculations of the volume of a Right /oblique full cylinder. Size : 10.5 mb compat

Abhijeet 4 Nov 07, 2022
Cash in on Expressed Barcode Tags (EBTs) from NGS Sequencing Data with Python

Cash in on Expressed Barcode Tags (EBTs) from NGS Sequencing Data with Python Cashier is a tool developed by Russell Durrett for the analysis and extr

3 Sep 11, 2022
Build a grocery store management application.

python_projects_grocery_webapp In this python project, we will build a grocery store management application. It will be 3 tier application, Front end:

codebasics 54 Dec 29, 2022
You'll learn about Iterators, Generators, Closure, Decorators, Property, and RegEx in detail with examples.

07_Python_Advanced_Topics Introduction 👋 In this tutorial, you will learn about: Python Iterators: They are objects that can be iterated upon. In thi

Milaan Parmar / Милан пармар / _米兰 帕尔马 252 Dec 23, 2022
In this project, we are going to display the battery notification and the time left for the battery to drain out using the battery capacity value.

In this project, we are going to display the battery notification and the time left for the battery to drain out using the battery capacity value.

Ritoban Biswas 1 Dec 20, 2021
Analysis of ROM image for Norsk Data VDU 301 S

This repository is meant to analyze the ROM images from Norsk Data VDU 301 S as provided at by Torfinn. To combine the two ROM image halves and extrac

Sebastian Rasmussen 1 Oct 21, 2021
A Google sheet which keeps track of the locations that want to visit and a price cutoff

FlightDeals Here's how the program works. First, I have a Google sheet which keeps track of the locations that I want to visit and a price cutoff. It

Lynne Munini 5 Nov 21, 2022