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
A tool to guide you for team selection based on mana and ruleset using your owned cards.

Splinterlands_Teams_Guide A tool to guide you for team selection based on mana and ruleset using your owned cards. Built With This project is built wi

Ruzaini Subri 3 Jul 30, 2022
WMIC Serial Checker For Python

WMIC Serial Checker Follow me here: Discord | Github FR: A but éducatif seulement. EN: For educational purposes only. ❓ Informations FR: WMIC Serial C

AkaTool's 0 Apr 25, 2022
Python package for reference counting native pointers

refcount master: testing: This package is primarily for managing resources in native libraries, written for instance in C++, from Python. While it boi

CSIRO Hydroinformatics 2 Nov 03, 2022
use Notepad++ for real-time sync after python appending new log text

FTP远程log同步工具 使用Notepad++配合来获取实时更新的log文档效果 适用于FTP协议的log远程同步工具,配合MT管理器开启FTP服务器使用,通过Notepad++监听文本变化,更便捷的使用电脑查看方法注入打印后的信息 功能 过滤器 对每行要打印的文本使用回调函数筛选,支持链式调用

Liuhaixv 1 Oct 17, 2021
The purpose of this code base is to add a specified signal-to-noise ratio noise from MUSAN dataset to a pure speech signal and to generate far-field speech data using room impulse response data from BUT [email protected] Reverb Database.

Add_noise_and_rir_to_speech The purpose of this code base is to add a specified signal-to-noise ratio noise from MUSAN dataset to a pure speech signal

Yunqi Chen 7 Oct 30, 2022
A project for the Qvault Hackathon, 2022-01-17

musical-octo-engine Steps to run brew install python-tk brew install portaudio

Erik Kristofer Anderson 2 May 17, 2022
An Android app that runs Elm in a webview. And a Python script to build the app or install it on the device.

Requirements You need to have installed: the Android SDK Elm Python git Starting a project Clone this repo and cd into it: $ git clone https://github.

Benjamin Le Forestier 11 Mar 17, 2022
importlib_resources is a backport of Python standard library importlib.resources module for older Pythons.

importlib_resources is a backport of Python standard library importlib.resources module for older Pythons. The key goal of this module is to replace p

Python 36 Dec 13, 2022
A deployer and package manager for OceanBase open-source software.

OceanBase Deploy OceanBase Deploy (简称 OBD)是 OceanBase 开源软件的安装部署工具。OBD 同时也是包管理器,可以用来管理 OceanBase 所有的开源软件。本文介绍如何安装 OBD、使用 OBD 和 OBD 的命令。 安装 OBD 您可以使用以下方

OceanBase 59 Dec 27, 2022
Statically typed BNF with semantic actions; A frontend of frontend frameworks; Use your grammar everywhere.

Statically typed BNF with semantic actions; A frontend of frontend frameworks; Use your grammar everywhere.

Taine Zhao 56 Dec 14, 2022
The-White-Noise-Project - The project creates noise intentionally

The-White-Noise-Project High quality audio matters everywhere, even in noise. Be

Ali Hakim Taşkıran 1 Jan 02, 2022
Fabric mod where anyone can PR anything, concerning or not. I'll merge everything as soon as it works.

Guess What Will Happen In This Fabric mod where anyone can PR anything, concerning or not (Unless it's too concerning). I'll merge everything as soon

anatom 65 Dec 25, 2022
Parser for the GeoSuite[tm] PRV export format

Parser for the GeoSuite[tm] PRV export format This library provides functionality to parse geotechnical investigation data in .prv files generated by

EMerald Geomodelling 1 Dec 17, 2021
A passive recon suite designed for fetching the information about web application

FREAK Suite designed for passive recon Usage: python3 setup.py python3 freak.py warning This tool will throw error if you doesn't provide valid api ke

toxic v3nom 7 Feb 17, 2022
This bot uploads telegram files to MixDrop.co,File.io.

What is about this bot ? This bot uploads telegram files to MixDrop.co, File.io. Usage: Send any file, and the bot will upload it to MixDrop.co, File.

Abhijith NT 3 Feb 26, 2022
IOP Support for Python (Experimental)

TAGS Experimental IOP Framework for Python WARNING: Currently, this project has NO EXCEPTION HANDLING. USE AT YOUR OWN RISK! I. Introduction to Interf

1 Oct 22, 2021
A Python module for decorators, wrappers and monkey patching.

wrapt The aim of the wrapt module is to provide a transparent object proxy for Python, which can be used as the basis for the construction of function

Graham Dumpleton 1.8k Jan 06, 2023
A python script that changes your desktop background based on current weather and time of the day.

Desktop background wallpaper, based on current weather and time A python script that changes your computer's desktop background based on current weath

Maj Gaberšček 1 Nov 16, 2021
A python server markup language

PSML - Python server markup language How to install: python install.py

LMFS 6 May 18, 2022