pyvalhalla-git 3.5.1.post187__cp39-cp39-manylinux_2_28_x86_64.whl → 3.6.0__cp39-cp39-manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. _valhalla.cpython-39-x86_64-linux-gnu.so +0 -0
  2. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/METADATA +32 -9
  3. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/RECORD +52 -40
  4. pyvalhalla_git-3.6.0.dist-info/entry_points.txt +7 -0
  5. pyvalhalla_git.libs/libcfitsio-b4c37dff.so.7.3.47 +0 -0
  6. pyvalhalla_git.libs/libcrypto-bdaed0ea.so.1.1.1k +0 -0
  7. pyvalhalla_git.libs/libcurl-c96f124b.so.4.5.0 +0 -0
  8. pyvalhalla_git.libs/libdf-2848fafa.so.0.0.0 +0 -0
  9. pyvalhalla_git.libs/libexpat-d2b8ed35.so.1.6.7 +0 -0
  10. pyvalhalla_git.libs/libfontconfig-dcb2ce6c.so.1.12.0 +0 -0
  11. pyvalhalla_git.libs/libfreetype-2f3b32b6.so.6.16.1 +0 -0
  12. pyvalhalla_git.libs/libgdal-bed6323b.so.26.0.4 +0 -0
  13. pyvalhalla_git.libs/libgeos-40815548.so.3.13.1 +0 -0
  14. pyvalhalla_git.libs/libgeos_c-386b0945.so.1.19.2 +0 -0
  15. pyvalhalla_git.libs/libgeotiff-cfdb9fd6.so.5.0.0 +0 -0
  16. pyvalhalla_git.libs/libgfortran-8f1e9814.so.5.0.0 +0 -0
  17. pyvalhalla_git.libs/libhdf5-b5e70f84.so.103.1.0 +0 -0
  18. pyvalhalla_git.libs/libkmlbase-57a08976.so.1.3.0 +0 -0
  19. pyvalhalla_git.libs/libkmlconvenience-ff3e16e9.so.1.3.0 +0 -0
  20. pyvalhalla_git.libs/libkmldom-137398f0.so.1.3.0 +0 -0
  21. pyvalhalla_git.libs/libkmlengine-aab5dd2a.so.1.3.0 +0 -0
  22. pyvalhalla_git.libs/libkmlregionator-d109603c.so.1.3.0 +0 -0
  23. pyvalhalla_git.libs/libkmlxsd-2dcaca9b.so.1.3.0 +0 -0
  24. pyvalhalla_git.libs/libmariadb-b978418d.so.3 +0 -0
  25. pyvalhalla_git.libs/libmfhdf-38b34047.so.0.0.0 +0 -0
  26. pyvalhalla_git.libs/libminizip-89ecf5b6.so.2.8.9 +0 -0
  27. pyvalhalla_git.libs/libnetcdf-3915b03a.so.15.0.1 +0 -0
  28. pyvalhalla_git.libs/libogdi-48a138d1.so.4.1 +0 -0
  29. pyvalhalla_git.libs/libpng16-748299c7.so.16.34.0 +0 -0
  30. pyvalhalla_git.libs/libspatialite-779b5fe7.so.7.1.1 +0 -0
  31. pyvalhalla_git.libs/libsqlite3-7a6fdc49.so.3.49.2 +0 -0
  32. pyvalhalla_git.libs/libssh-c11d285b.so.4.8.7 +0 -0
  33. pyvalhalla_git.libs/libssl-60250281.so.1.1.1k +0 -0
  34. pyvalhalla_git.libs/libtiff-84c53c12.so.5.3.0 +0 -0
  35. pyvalhalla_git.libs/libxml2-54d19b2f.so.2.9.7 +0 -0
  36. pyvalhalla_git.libs/libz-282eaf2a.so.1.2.11 +0 -0
  37. valhalla/__init__.py +10 -2
  38. valhalla/__main__.py +68 -0
  39. valhalla/__version__.py +2 -2
  40. valhalla/_scripts.py +46 -0
  41. valhalla/_valhalla.cc +81 -0
  42. valhalla/bin/valhalla_add_landmarks +0 -0
  43. valhalla/bin/valhalla_add_predicted_traffic +0 -0
  44. valhalla/bin/valhalla_build_admins +0 -0
  45. valhalla/bin/valhalla_build_tiles +0 -0
  46. valhalla/bin/valhalla_convert_transit +0 -0
  47. valhalla/bin/valhalla_ingest_transit +0 -0
  48. pyvalhalla_git.libs/libgeos-3-54342c21.7.2.so +0 -0
  49. pyvalhalla_git.libs/libgeos_c-e683d5c0.so.1.11.2 +0 -0
  50. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/WHEEL +0 -0
  51. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/licenses/AUTHORS +0 -0
  52. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/licenses/COPYING +0 -0
  53. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/licenses/LICENSE.md +0 -0
  54. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/top_level.txt +0 -0
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvalhalla-git
3
- Version: 3.5.1.post187
3
+ Version: 3.6.0
4
4
  Summary: High-level bindings to the Valhalla C++ library
5
5
  Home-page: https://github.com/valhalla/valhalla
6
6
  Author: Nils Nolde
@@ -26,7 +26,7 @@ Dynamic: summary
26
26
 
27
27
  ## Valhalla Python bindings
28
28
 
29
- This package contains the Python bindings to [Valhalla routing engine](https://github.com/valhalla/valhalla).
29
+ This folder contains the Python bindings to [Valhalla routing engine](https://github.com/valhalla/valhalla).
30
30
 
31
31
  > [!NOTE]
32
32
  > `pyvalhalla(-git)` packages are currently only published for:
@@ -34,9 +34,7 @@ This package contains the Python bindings to [Valhalla routing engine](https://g
34
34
  > - `win-amd64`
35
35
  > - `macos-arm64`
36
36
 
37
- ### License
38
-
39
- Due to the dependencies we package, the Python bindings are licensed under GNU Lesser General Public License v2 or later (LGPLv2+).
37
+ On top of the (very) high-level Python bindings, we package some data-building Valhalla executables to ease the process of graph creation.
40
38
 
41
39
  ### Installation
42
40
 
@@ -47,7 +45,9 @@ We distribute all currently maintained CPython versions as **binary wheels** for
47
45
 
48
46
  ### Usage
49
47
 
50
- Find a more extended notebook in `./examples`, e.g. how to [use the actor](./examples/actor_examples.ipynb).
48
+ #### Bindings
49
+
50
+ Find a more extended notebook in `./examples`, e.g. how to [use the actor](https://github.com/valhalla/valhalla/blob/master/src/bindings/python/examples/actor_examples.ipynb).
51
51
 
52
52
  Before using the Python bindings you need to have access to a routable Valhalla graph. Either install Valhalla from source and built the graph from OSM compatible data or use our [Valhalla docker image](https://github.com/gis-ops/docker-valhalla) for a painless experience, e.g. this will build the routing graph for Andorra in `./custom_files`:
53
53
 
@@ -71,6 +71,24 @@ actor = Actor(config)
71
71
  route = actor.route({"locations": [...]})
72
72
  ```
73
73
 
74
+ #### Valhalla executables (**`linux-x86_x64` only**)
75
+
76
+ To access the C++ (native) executables, there are 2 options:
77
+ - (recommended) execute the module, e.g. `python -m valhalla valhalla_build_tiles -h`
78
+ - execute the Python wrapper scripts directly, e.g. `valhalla_build_tiles -h`
79
+
80
+ > [!NOTE]
81
+ > For the latter option to work, the Python environment's `bin/` folder has to be in the `$PATH`. Inside virtual environments, that's always the case.
82
+
83
+ Executing the scripts directly might also not work properly if there's a system-wide Valhalla installation, unless the Python environment's `bin/` folder has higher priority than system folders in `$PATH`. The module execution uses an explicit Python executable which should be preferred.
84
+
85
+ There are also some additional commands we added:
86
+ - `--help`: print the help for `python -m valhalla` explicitly
87
+ - `--quiet`: redirect `stdout` of the C++ executables to `/dev/null`; can be added **once** anywhere in the command, will not be forwarded to a C++ executable
88
+ - `print_bin_path`: simply prints the absolute path to the package-internal `bin/` directory where the C++ executables are; useful if the executables should be accessed directly in some script
89
+
90
+ To find out which Valhalla executables are currently included, run `python -m valhalla --help`. We limit the number of executables to control the wheel size. However, we're open to include any other executable if there's a good reason.
91
+
74
92
  ### Building from source
75
93
 
76
94
  #### Linux
@@ -94,7 +112,7 @@ Once built, start a container to actually build Valhalla using AlmaLinux 8:
94
112
  ```shell
95
113
  cd valhalla
96
114
  docker run -dt -v $PWD:/valhalla-py --name valhalla-py --workdir /valhalla-py ghcr.io/valhalla/manylinux:2_28_valhalla_python
97
- docker exec -t valhalla-py /valhalla-py/src/bindings/python/build_linux.sh build_manylinux 3.12
115
+ docker exec -t valhalla-py /valhalla-py/src/bindings/python/build_linux.sh build_manylinux 3.13
98
116
  ```
99
117
 
100
118
  This will also build & install `libvalhalla` before building the bindings. At this point there should be a `wheelhouse` folder with the fixed python wheel, ready to be installed or distributed to arbitrary python 3.12 installations.
@@ -104,11 +122,16 @@ This will also build & install `libvalhalla` before building the bindings. At th
104
122
  On our CI, this orchestrates the packaging of all `pyvalhalla` wheels for every supported, minor Python version and every platform. It can also be run locally (obviously only being able to build wheels for _your_ platform), e.g.
105
123
 
106
124
  ```shell
107
- # specifiers from https://cibuildwheel.pypa.io/en/stable/options/#build-skip
125
+ python -m pip install cibuildwheel
126
+ cibuildwheel --print-build-identifiers
108
127
  cibuildwheel --only cp313-manylinux_x86_64
109
128
 
110
129
  # for windows you'll have to set an env var to the vcpkg win root
111
130
  VCPKG_ARCH_ROOT="build/vcpkg_installed/custom-x64-windows" cibuildwheel --only cp313-manylinux_x86_64
112
131
  ```
113
132
 
114
- On Linux, this might download the `manylinux` docker image. In the end, you'll find the wheel in `./wheelhouse`.
133
+ On Linux, this might download the [`manylinux` docker image](https://github.com/valhalla/manylinux/pkgs/container/manylinux). In the end, you'll find the wheel in `./wheelhouse`.
134
+
135
+ ### Testing (**`linux-x86_x64` only**)
136
+
137
+ We have a small [test script](https://github.com/valhalla/valhalla/blob/master/src/bindings/python/test/test_pyvalhalla_package.sh) which makes sure that all the executables are working properly. If run locally for some reason, install a `pyvalhalla` wheel first. We run this in CI in a fresh Docker container with no dependencies installed, mostly to verify dynamic linking of the vendored dependencies.
@@ -1,4 +1,4 @@
1
- _valhalla.cpython-39-x86_64-linux-gnu.so,sha256=jEr33Gtx7feyNg5qA6yCYvj-JLctJ7lddqa3umJNH9A,14981745
1
+ _valhalla.cpython-39-x86_64-linux-gnu.so,sha256=Yhzh1XfvHQel3tM5zP4GDyN9OrNhmGUZIRbcM24bx-c,14981769
2
2
  pyvalhalla_git.libs/libaec-91f0ca0f.so.0.0.8,sha256=GEdN1A2-2Ee3eA9OpLDk2Q_BCfD_w5OT26XF3eaiXkM,37697
3
3
  pyvalhalla_git.libs/libarmadillo-b35ffa1e.so.12.6.6,sha256=IwUzPx4x0YnMv_mNZpjL0AaGlYe0eubH6AuIUGI9iCA,98121
4
4
  pyvalhalla_git.libs/libarpack-042921fd.so.2.1.0,sha256=ih8rV9ek_fYnZlJnJtNs3oWzXIuZtU_-Ta0B6vU3lmQ,366689
@@ -7,29 +7,30 @@ pyvalhalla_git.libs/libbrotlicommon-6ce2a53c.so.1.0.6,sha256=zyiyGpvmy7huKm-JlWH
7
7
  pyvalhalla_git.libs/libbrotlidec-811d1be3.so.1.0.6,sha256=dmwMSDMQH7ShACzQjRinGgwh53QUkcxPZXYv0hEpmKI,62193
8
8
  pyvalhalla_git.libs/libbsd-526a917f.so.0.12.2,sha256=4rp1mSbErSoJwIIsNqEFBo1liqBV43-ITarb_u18-d0,88433
9
9
  pyvalhalla_git.libs/libbz2-a1e77c99.so.1.0.6,sha256=5hvZ8HbyaJrQBOyHAUvhVeH0kWm27etoKhiSFziIxhk,75049
10
- pyvalhalla_git.libs/libcfitsio-b4c37dff.so.7.3.47,sha256=c6hONSUSXaqE4RDFLuKKryPrjAmHsjwnmsACtW9EBGc,1648513
10
+ pyvalhalla_git.libs/libcfitsio-b4c37dff.so.7.3.47,sha256=BrjHu4HRNkCS-O591oMvqEgW23P9_-3A-qjJ6wpTZss,1648537
11
11
  pyvalhalla_git.libs/libcom_err-b4375b23.so.2.1,sha256=-DVlAb7x4XecB0Obr0WdKphOEey_CfH7LCpzx-Dx20U,21545
12
12
  pyvalhalla_git.libs/libcrypt-52aca757.so.1.1.0,sha256=Rl6iBH7tI_X3G4lQfsNm9goOdNC29wIf_I77cVjQESc,140977
13
- pyvalhalla_git.libs/libcrypto-bdaed0ea.so.1.1.1k,sha256=teTU1EbwIqcxLKEwQCCxVDDLNnMUyvbgJRzPb37I3uo,3215921
14
- pyvalhalla_git.libs/libcurl-c96f124b.so.4.5.0,sha256=ShGqMFMuRbVf9Dn48QqJTtE8vwVVIsmqzAOVN7nNq54,619977
13
+ pyvalhalla_git.libs/libcrypto-bdaed0ea.so.1.1.1k,sha256=FZwxdPnRjrvyuPE4DK2hCLGBi3WBMH6153Nwe5_D8Qk,3308689
14
+ pyvalhalla_git.libs/libcurl-c96f124b.so.4.5.0,sha256=o8LWZwJT9AkkYuyfps1w0CrV1udeZefUg3N-CgJM8tY,620001
15
15
  pyvalhalla_git.libs/libczmq-d9886762.so.4.2.1,sha256=q_nJxo2HTNGcEktk09pnpJWSppnRR1xVbWrrslA5MPk,542025
16
16
  pyvalhalla_git.libs/libdap-7e467616.so.25.0.1,sha256=yoFZYmAcBm9g_I8otmBFwK7sdKRVo2DJ9ZfdRFtFzzo,2380601
17
17
  pyvalhalla_git.libs/libdapclient-5ca79ace.so.6.1.7,sha256=iwsLb5Wc7h8YJ37L-nKigdRFx3XgvSZljuDT5f7TCl4,403281
18
18
  pyvalhalla_git.libs/libdapserver-e7ab5c47.so.7.6.7,sha256=OQggaCpDqIn68RtB_2u53R-Q86iEZmUJ8SJyvMr_hWw,99113
19
- pyvalhalla_git.libs/libdf-2848fafa.so.0.0.0,sha256=GV0JRwDVmay_oU3hMOtsOr2ZCIsIDJWt3ytG6kCWnbk,592385
20
- pyvalhalla_git.libs/libfontconfig-dcb2ce6c.so.1.12.0,sha256=3nb_Xf-B09W7jsdd0Ep6M8sgkpaJVyUiEITA5r_Gweg,304865
21
- pyvalhalla_git.libs/libfreetype-2f3b32b6.so.6.16.1,sha256=aNd-t0Fl7VyxZi-ofi_S4MwOiZDqKNBXVJpi4Lb0E84,799545
19
+ pyvalhalla_git.libs/libdf-2848fafa.so.0.0.0,sha256=U4BMy1cbTnytt3Ipdg6FmI4FZG9Nh_YxZBe8Q7qBK7M,592409
20
+ pyvalhalla_git.libs/libexpat-d2b8ed35.so.1.6.7,sha256=lEkMPMR0keY_Vfyw2F6eNKDPa4J7WPM5yanuqGvh1Ic,252905
21
+ pyvalhalla_git.libs/libfontconfig-dcb2ce6c.so.1.12.0,sha256=ov2Dsf_R--ddpsWVp8QpIjTnYrWqxAYB76T7dlMkx94,304897
22
+ pyvalhalla_git.libs/libfreetype-2f3b32b6.so.6.16.1,sha256=Im372POhhwYIrkipfd-B00pKbhwbqLD60wleIlCVs-U,799569
22
23
  pyvalhalla_git.libs/libfreexl-c4cb0770.so.1.1.0,sha256=en-2F0qnAWkyFxLIZtJ6AI6uhjrDde5hRt6luJHxjTk,46785
23
- pyvalhalla_git.libs/libgdal-bed6323b.so.26.0.4,sha256=53WpfluAMrFPam2Ht0g-zpsYILLES5uxI0V9QVRdXCc,25912449
24
- pyvalhalla_git.libs/libgeos-3-54342c21.7.2.so,sha256=9d-KZHzxbxlFobE5KNQuCf8tGISDskzCf0LbzNdTMXo,2785809
25
- pyvalhalla_git.libs/libgeos_c-e683d5c0.so.1.11.2,sha256=7kWRzV7TLb6PQHU0WR1Uy9KBIsbyTrirBBvXoPjtukQ,310209
26
- pyvalhalla_git.libs/libgeotiff-cfdb9fd6.so.5.0.0,sha256=zkoKazRpBzk9vXxHu_0hAcvcbrSzoa7HtLBJEgnd_yE,227921
27
- pyvalhalla_git.libs/libgfortran-8f1e9814.so.5.0.0,sha256=qVzErEr62Iny2DCI9Gteb6bNXv1ynbiH4eY5FH7FW3M,2714697
24
+ pyvalhalla_git.libs/libgdal-bed6323b.so.26.0.4,sha256=7pMd7Z1P_Vx1wjbrGkLpDpIrWDoEU-aDGr2_kuo1fO0,25912497
25
+ pyvalhalla_git.libs/libgeos-40815548.so.3.13.1,sha256=ndVwAvJY3nwFxNQHmNB6eV932TnE1mPtp_3YsoGVqBc,4999793
26
+ pyvalhalla_git.libs/libgeos_c-386b0945.so.1.19.2,sha256=zGNBBHxem0bjWBbdRrt2V2WN5LwVYv1B-Zn_qcDMKIE,510113
27
+ pyvalhalla_git.libs/libgeotiff-cfdb9fd6.so.5.0.0,sha256=JRCKo-h_6hBhoU4epyC1qMfMC_52MnlY579CODwE1Fo,227945
28
+ pyvalhalla_git.libs/libgfortran-8f1e9814.so.5.0.0,sha256=osiOwmN3jV_OAdSJU8lcZwXVK-_FTblrsMF8AaeAOW0,2714721
28
29
  pyvalhalla_git.libs/libgif-5ed6ffef.so.7.0.0,sha256=i19mAFnKEYemEOQFqyoi5GBad1vSdrrQ6-2HVffEmZI,46873
29
30
  pyvalhalla_git.libs/libgomp-870cb1d0.so.1.0.0,sha256=Ta6ZPLbakQH8LP74JzBt0DuJIBHS4nicjkSCjKnyWDw,253289
30
31
  pyvalhalla_git.libs/libgssapi_krb5-5b6840e5.so.2.2,sha256=zTS6gw0kgEUGor4jW30dslK1ger7zfQR9BbMBDNYT1Y,378601
31
32
  pyvalhalla_git.libs/libgta-6ed1f83a.so.1.0.0,sha256=oveLGR6wyS3z-zYWEjux3DfDnGyMvDLn6iqnvsIOniE,47545
32
- pyvalhalla_git.libs/libhdf5-b5e70f84.so.103.1.0,sha256=bHo6bEEPeX-bJARxt3H7BadA1APYeW3VZw8D5iasy9o,4007249
33
+ pyvalhalla_git.libs/libhdf5-b5e70f84.so.103.1.0,sha256=TVlemnSAaOkxv4PVyar_WqRrj9hDo9mRbiHCHZHy4AI,4007273
33
34
  pyvalhalla_git.libs/libhdf5_hl-0b60eabd.so.100.1.2,sha256=bL6R_QGKadx8UM7SlfQgPZ7KJqW1nBqeN4sAeQIsUEM,165561
34
35
  pyvalhalla_git.libs/libidn2-2f4a5893.so.0.3.6,sha256=tElml3gdyDiZ61Dr9wncteS_pazPfYFpBEhnBI7aqQw,140377
35
36
  pyvalhalla_git.libs/libjasper-61dc4fbf.so.4.0.0,sha256=TSXz7eYrCQ-uFM2oTc4ww1mz32dlm0m2Mm_4AVsLixg,396545
@@ -38,12 +39,12 @@ pyvalhalla_git.libs/libjpeg-e87d2658.so.62.2.0,sha256=sRuavCl6x0zAPrZOEcsYFMAOLE
38
39
  pyvalhalla_git.libs/libjson-c-53e1d64f.so.4.0.0,sha256=_7l__xCHCYafuwbMOd6QMlwwW5gUT3OuxDrCfv1bXf4,74337
39
40
  pyvalhalla_git.libs/libk5crypto-404ad962.so.3.1,sha256=qR8T9MOIpu_crBlrnNSPCI6hVkqAmaBpy6brhy-chHY,110073
40
41
  pyvalhalla_git.libs/libkeyutils-2777d33d.so.1.6,sha256=Lxjn7VlUyYm6A8b4JMCptowYVig9FWTq8mEwh2PphLo,17929
41
- pyvalhalla_git.libs/libkmlbase-57a08976.so.1.3.0,sha256=RBsQV_XEmbT6RWZ5BtlvZ8VbXw6tIwnMoNirYR8EzzU,204865
42
- pyvalhalla_git.libs/libkmlconvenience-ff3e16e9.so.1.3.0,sha256=_vAHApFZ59gBWBB2U28dqeXruJBYgEGqEEJZghv1PHk,204433
43
- pyvalhalla_git.libs/libkmldom-137398f0.so.1.3.0,sha256=CX2a3dttEVHNfCYtKrTzqT9zr4AAmgEHIG2wrlGgtiU,1150513
44
- pyvalhalla_git.libs/libkmlengine-aab5dd2a.so.1.3.0,sha256=w_DZFgc2DCD-P5aGor4lPP0mMHEPC-bbTvY_PUDirpI,399633
45
- pyvalhalla_git.libs/libkmlregionator-d109603c.so.1.3.0,sha256=G7qlssYkatEsIuh-SzycYHBFuEjcBhi83qTmRHhI-BM,73377
46
- pyvalhalla_git.libs/libkmlxsd-2dcaca9b.so.1.3.0,sha256=vjlDekfYfVPB3E8lTG0_y1SmjzqSMUmAeBX_gHyYhCI,138889
42
+ pyvalhalla_git.libs/libkmlbase-57a08976.so.1.3.0,sha256=rcmxYwqi1LJfwArRps4kI6eOCxSiZD3jk12gg_Szzf4,204921
43
+ pyvalhalla_git.libs/libkmlconvenience-ff3e16e9.so.1.3.0,sha256=xWsQXW9Gep4NNQLaE_D81PQxyKloYNH1yo3FtLpWqQk,204481
44
+ pyvalhalla_git.libs/libkmldom-137398f0.so.1.3.0,sha256=5Cz0AZnGFXn0-14rj70cGQ1bTw5wuU0PLIRT6q0lxVU,1150569
45
+ pyvalhalla_git.libs/libkmlengine-aab5dd2a.so.1.3.0,sha256=m0KB29ILNsP8-klGfl8biBFrpwRspKZORdMenYZtzYY,399681
46
+ pyvalhalla_git.libs/libkmlregionator-d109603c.so.1.3.0,sha256=u_K_ilsLmkryGBVCMH2ddhmuC1Pfrue1k36N8HhcemE,73425
47
+ pyvalhalla_git.libs/libkmlxsd-2dcaca9b.so.1.3.0,sha256=hXR2KQa3SCkx6tL4zDPFPejqqroBLaOReP_30czYWAI,138937
47
48
  pyvalhalla_git.libs/libkrb5-eda01fcc.so.3.3,sha256=2bfY3YLiQwxzsyHR1-WTXUcWYuttmEfk9w7xUsU_xY0,1027097
48
49
  pyvalhalla_git.libs/libkrb5support-123248d0.so.0.1,sha256=F9DGlb34TNay8DVRdmFcT3244nXW4qkYlV_JQwHNduA,85161
49
50
  pyvalhalla_git.libs/liblapack-31d7d384.so.3.8.0,sha256=Q4BcY0EzqJXXo8OyRrLhkTU8OaYzRVCo1yhH8M70yBI,7808185
@@ -55,18 +56,18 @@ pyvalhalla_git.libs/libltdl-c869cdfb.so.7,sha256=pBQR20qv9VpwW9Kzl7btHUNThOiLyhB
55
56
  pyvalhalla_git.libs/libluajit-5-e85ce75d.1.so.2.1.0,sha256=97vuCX5NrFAFiptOCLcGFwGwXJHwURjMpdYSVaExwdk,524513
56
57
  pyvalhalla_git.libs/liblz4-a5753129.so.1.8.3,sha256=5f7UmcvMpsV5QfnvNRpO19pH3X8EOK9m_mKm-j6vg6Y,125881
57
58
  pyvalhalla_git.libs/liblzma-51a76f52.so.5.2.4,sha256=3EDuNDuc_qFaqWfrJ8TjbJH2lPntVHhFdyIyzxLyVuk,167585
58
- pyvalhalla_git.libs/libmariadb-b978418d.so.3,sha256=VcuF41MqPYUwtEke43gX9Ys2DMBMeuRxU7IHKNHlLdQ,371409
59
+ pyvalhalla_git.libs/libmariadb-b978418d.so.3,sha256=Zm_TQeOIr0OXX4ZnLm6iany7aRxentgbmvjyN_msJX4,371433
59
60
  pyvalhalla_git.libs/libmd-3e096870.so.0.1.0,sha256=u4NgKhejcWdnUJ2XeY087UlHHQxI_vj3i4I2O9ic0Ig,67593
60
- pyvalhalla_git.libs/libmfhdf-38b34047.so.0.0.0,sha256=BGyzILyrzr8t74PLWebvUYps6keb30xFEzS0-1zo_b4,189121
61
- pyvalhalla_git.libs/libminizip-89ecf5b6.so.2.8.9,sha256=cY5VqVvi5p99y1l1qadbwBCeZPFQ34Q0rcu1OQpw_-A,343961
62
- pyvalhalla_git.libs/libnetcdf-3915b03a.so.15.0.1,sha256=0tdpbqDgfl9K3IseAXFg2ta0x8-nCmldTt2cfiztZEE,1421713
61
+ pyvalhalla_git.libs/libmfhdf-38b34047.so.0.0.0,sha256=zlsl5u5MbAlOapnzFpAlABLsGkEhtwlRZ75LLyTjJzI,189145
62
+ pyvalhalla_git.libs/libminizip-89ecf5b6.so.2.8.9,sha256=IrWYZtKmv0drR_HcuQwjpXYO8LYoV03uSo_5HwL6pC0,343985
63
+ pyvalhalla_git.libs/libnetcdf-3915b03a.so.15.0.1,sha256=_5OdIpGHpA_E35CM_Po9Df6YX7ZC94_5x7q9ihw31hc,1421737
63
64
  pyvalhalla_git.libs/libnghttp2-39367a22.so.14.17.0,sha256=llfQElLBK10tju2J2kujCoHMuQDnxCASAhoWmQfQOO8,175025
64
65
  pyvalhalla_git.libs/libnspr4-50db7ede.so,sha256=7U-ViNCNu6Mj-H5b0Do1YdTqBnLLRDNCuFMwjpj2ihE,278289
65
66
  pyvalhalla_git.libs/libnss3-97de30de.so,sha256=QAdfWpJVnn5TQxLaGMhCl_ka0mGefsSKA0slia5vp0Y,1395721
66
67
  pyvalhalla_git.libs/libnssutil3-6f5c6901.so,sha256=rNnEt7CKA3tFJ4VKQkl5qfadoXUNe4EdLLIiBYH4XR8,236561
67
68
  pyvalhalla_git.libs/libodbc-cdeefa4a.so.2.0.0,sha256=6SojV8GfWsKv_ejENITJ_BEadoXV0l3Bkv3UlQFKAlE,564521
68
69
  pyvalhalla_git.libs/libodbcinst-433c34e3.so.2.0.0,sha256=Wb-qXnGUaeHv_iPEAf8-ooJsLdKHqUnQB6oDMytuYb8,133169
69
- pyvalhalla_git.libs/libogdi-48a138d1.so.4.1,sha256=4DNFXHpKsN_SdkgW0IyiiDPrjsOQeMQaOuI8LYu-Lro,140089
70
+ pyvalhalla_git.libs/libogdi-48a138d1.so.4.1,sha256=70Y_0SBLOXSaTfFbA_vOUE5cTIqBd5BEr0FxvKxo15g,140137
70
71
  pyvalhalla_git.libs/libopenblaso-r0-d77a1985.3.15.so,sha256=AiFqF-Njr5Dg726ykl93ZDHY2rYvfatW4TTKZ7UME1Y,38700273
71
72
  pyvalhalla_git.libs/libopenblasp-r0-59ffcd50.3.15.so,sha256=1uI-clKs5UaNgrvbAoE31Sj10T_NUNudcYbUjk5LhA8,38683921
72
73
  pyvalhalla_git.libs/libopenjp2-88dcb7ba.so.2.4.0,sha256=zxkK31bmOl7wvfGVVxPNTra4ua5e3bNQMTe-yLIaGQw,376961
@@ -75,7 +76,7 @@ pyvalhalla_git.libs/libpcre2-8-516f4c9d.so.0.7.1,sha256=IcbljW_oKuAVlrAwKz8qtRZx
75
76
  pyvalhalla_git.libs/libpgm-5-d8330baa.2.so.0.0.122,sha256=o37Fuc6vaTuXY1gHOIIqgU2eWjGwetKUiAAC16655vM,421681
76
77
  pyvalhalla_git.libs/libplc4-5da7697c.so,sha256=RpOab0fTQWGOIUQM1cQ1wVXVU3jVQiYSs-yIrupQY-o,29537
77
78
  pyvalhalla_git.libs/libplds4-c96adacf.so,sha256=nMN2jcw0bZgWv5HP9Jim676_mc6HnhYVXWR6TQUcBII,26353
78
- pyvalhalla_git.libs/libpng16-748299c7.so.16.34.0,sha256=Z210PQGjR2IKZUFrIH8usUGiy5_QZQF-6YOT-z1sMgo,236961
79
+ pyvalhalla_git.libs/libpng16-748299c7.so.16.34.0,sha256=CJF2GyfvO-P1rpjvQ_OcLxR7O8-hJws8rpQFX8bqVGE,243089
79
80
  pyvalhalla_git.libs/libpoppler-2ef877a6.so.104.0.0,sha256=gcw4FJnNUWFLqV9Qw_aYMuByNUVhe4Q2W4T6GbYfEDA,4377313
80
81
  pyvalhalla_git.libs/libpq-a39742ca.so.5.13,sha256=apf29T9oJY8Zt_Kqh3ageGBw-SGL2kW_BZQ743bX3n8,358201
81
82
  pyvalhalla_git.libs/libprime_server-d1a42131.so.0.6.7,sha256=Q-hMkMCR0XUCn-5q69qBj_Lq2nPmv6qDZ2oH7eQO8jI,2452545
@@ -87,13 +88,13 @@ pyvalhalla_git.libs/libsatlas-6c1f674f.so.3.10,sha256=3R5A2Nt42ulAKzO5al18b0Sbv0
87
88
  pyvalhalla_git.libs/libselinux-d0805dcb.so.1,sha256=iYGaLO-LIy5-WEihMiXHpeJUXyq56DDqGU49JbpfTu4,195097
88
89
  pyvalhalla_git.libs/libsmime3-374c4dc4.so,sha256=v3rZYChjGu5TE8pChRPu9KcwUpaqrChxYAluBvl54kE,211937
89
90
  pyvalhalla_git.libs/libsodium-2d1e6a3a.so.23.3.0,sha256=g5oRi005mSjgl1LyS0lhrdNX-QwbzchcN2x9QimD4cI,434873
90
- pyvalhalla_git.libs/libspatialite-779b5fe7.so.7.1.1,sha256=B0HNGuUnMZ0Cz27T7URV6bR54CCmFA9o-8dMLEHmt_w,7174105
91
- pyvalhalla_git.libs/libsqlite3-7a6fdc49.so.3.49.2,sha256=fURZqCuKNZQdTnFPE4AAHbzzf44EYlNyNeLFnRrULDM,7216393
92
- pyvalhalla_git.libs/libssh-c11d285b.so.4.8.7,sha256=pJAUqcNeoRNqZavEVWyfpgNSJZXBN-8AyIMCaAqv4K4,500185
93
- pyvalhalla_git.libs/libssl-60250281.so.1.1.1k,sha256=MCNuTI3K8vc-l_BvN5nElqPps2xW3COe2EZnuxtfQrE,666865
91
+ pyvalhalla_git.libs/libspatialite-779b5fe7.so.7.1.1,sha256=8I-f0sCMhxBobtdPi7A_oBqWbZxZW0GoL7fcOAWueUs,7174129
92
+ pyvalhalla_git.libs/libsqlite3-7a6fdc49.so.3.49.2,sha256=peF5Nffl4urZitdpoR6pDcVXjZUjlwbYkL5pFNK172Q,7224017
93
+ pyvalhalla_git.libs/libssh-c11d285b.so.4.8.7,sha256=zvJgQnY0NnEVTjkKtexXHxC7zQ0qceBBRIkAHDpss5E,500209
94
+ pyvalhalla_git.libs/libssl-60250281.so.1.1.1k,sha256=RCOXO__09WYzExJ2G4x3DrarhbGh7mbH11siXVR0_qw,666889
94
95
  pyvalhalla_git.libs/libsuperlu-17b63ae5.so.5.1,sha256=v-vhMkxagxoI0bfmQB36TbpwL_WIkp64AA-v2aBQE5c,583121
95
96
  pyvalhalla_git.libs/libsz-0deeef7d.so.2.0.1,sha256=oHMyDpIHEu8PwHfRYVYQnQ-jNECkLleGMrsSV9SXabg,16817
96
- pyvalhalla_git.libs/libtiff-84c53c12.so.5.3.0,sha256=PTVss_zdjG-4W0SAsaL3cS3MkN4pTkN9fkpsUjPE4QA,517801
97
+ pyvalhalla_git.libs/libtiff-84c53c12.so.5.3.0,sha256=e68N-IIEHaGm3mirQSZP2rg7dK1mgc3b49gWFdet4A0,517825
97
98
  pyvalhalla_git.libs/libtirpc-cff449a4.so.3.0.0,sha256=8jAvYqXzCstumcLc8Y69ewqShYnBbrfzI65uSR77B2o,239849
98
99
  pyvalhalla_git.libs/libunistring-05abdd40.so.2.1.0,sha256=IxfT3Vuwa8TtEgGZDPNNtS5NtygqrJJwvXgaV8Ku3HU,1826161
99
100
  pyvalhalla_git.libs/libunwind-7e4e9a3c.so.8.0.1,sha256=EwQrqnFdpDy58YRUARVeOUUsTZNhfsb7K71pk6Sa7SQ,79577
@@ -101,18 +102,29 @@ pyvalhalla_git.libs/liburiparser-8aafb6b8.so.1.0.31,sha256=r-mzhgMuJyE6vAUSvvfmf
101
102
  pyvalhalla_git.libs/libuuid-95b83d40.so.1.3.0,sha256=Bj-_E8XyWfgC65o6pTuT9qLNcuA97EYDyCUUOfDR2q0,38041
102
103
  pyvalhalla_git.libs/libwebp-0b9c754d.so.7.0.2,sha256=EYSlMkseuy7mksJNLEZeie2EmgXh8SOKIuv7jbz0RUQ,457449
103
104
  pyvalhalla_git.libs/libxerces-c-3-f7c60809.2.so,sha256=AvLjV7pehcEa_7l5hr8SAE4q30iwD03S6Czh-aZMEMc,4706377
104
- pyvalhalla_git.libs/libxml2-54d19b2f.so.2.9.7,sha256=_L0cmQpE_Ag8yLaDcjYcD7HlArAMU7X7GJp4zsWylQc,1597833
105
+ pyvalhalla_git.libs/libxml2-54d19b2f.so.2.9.7,sha256=7Hlah0Js_iDCsfRCX-DDHlZ9IGoMZ2mKlLCGSUjfsdE,1597857
106
+ pyvalhalla_git.libs/libz-282eaf2a.so.1.2.11,sha256=jhlAOnGjWt4x1HjeCIqz6mXAuqM8fNbU45kDY-9lyC0,104817
105
107
  pyvalhalla_git.libs/libzmq-a60bbc04.so.5.2.4,sha256=PVj6lcs0afQZUC7fJTdKfRyaplq41L30sx-XCY4J6ow,804321
106
- valhalla/__init__.py,sha256=TQKBm2DP8mNh3OYJ-orTqk1KWGOum2U8fJo27IwQrBk,194
107
- valhalla/__version__.py,sha256=fUJPudoAYydBLozK46W_lClD7MtK4kD3D24zHiwVYDg,530
108
+ valhalla/__init__.py,sha256=jxEX6PBKomyDW1D0On57Y52MIzBmmRQ8gnKb04p8tWg,374
109
+ valhalla/__main__.py,sha256=2X-2Wd8BOXKG63pI8M-nA2nMya2eJGU16aFK3ye0UMQ,2069
110
+ valhalla/__version__.py,sha256=eic-6Xs9-9wocSdGZ3Qt8lkpGHJbspTaUymbZDQfBkA,511
111
+ valhalla/_scripts.py,sha256=-zpCo07ckNy9yQFs2BymmmYwKS94ZAhlRyHLPUsfEKg,1504
112
+ valhalla/_valhalla.cc,sha256=3OorCxyOun1-Q9olHlHw75q3XlprX4Lgd4UKQSHahsY,3699
108
113
  valhalla/actor.py,sha256=MviJjb6ui1KwIzJbACHncuLNDdHkj1hyzCHlDD_yEjw,4077
109
114
  valhalla/config.py,sha256=kpYm-7RS4Mz3plcfGWNDx1s6tfXjnBGMei1uxhQ7VJM,1488
110
115
  valhalla/utils.py,sha256=VCxJ5rNX4Ha8Ey4T81y1b3Ke2svUwGn5TNyW8nC_8p8,1923
111
116
  valhalla/valhalla_build_config.py,sha256=WJJG6t6I8NnkGc_Wd4vSwI2mgZcwQqPrwvKph2AjfGc,42507
112
- pyvalhalla_git-3.5.1.post187.dist-info/METADATA,sha256=U5_omjLt3jjVJGrYfLlGB3sMSLKg0x5nN37ddO_rhVc,4773
113
- pyvalhalla_git-3.5.1.post187.dist-info/WHEEL,sha256=GgX20VmKcCojXA25QwkMazru5rPDAsLYhjc0VMiPAHQ,111
114
- pyvalhalla_git-3.5.1.post187.dist-info/top_level.txt,sha256=mU472JpF5fOfpVQ8UxZ_dwLmecLogajAMO5RmYsU1gw,19
115
- pyvalhalla_git-3.5.1.post187.dist-info/RECORD,,
116
- pyvalhalla_git-3.5.1.post187.dist-info/licenses/AUTHORS,sha256=IGm6Dg1NRkmFHV2GWvlPdfiqVoc1kfoc0pMbcKiCs30,171
117
- pyvalhalla_git-3.5.1.post187.dist-info/licenses/COPYING,sha256=i9sUrrsAX_p17jiQqhCyQrMMhAyqAbmWxWM4yiefN80,1135
118
- pyvalhalla_git-3.5.1.post187.dist-info/licenses/LICENSE.md,sha256=sZlxfQFAuJ8ba_1E8G3hYQ7eC770tBIywEWAg3rrixM,44
117
+ valhalla/bin/valhalla_add_landmarks,sha256=ratQCuEAmGOWPUVKOQUYoY4f0Oe-QkM7LvxKyGtmd-8,8342216
118
+ valhalla/bin/valhalla_add_predicted_traffic,sha256=NclodbUjtk_sygaknWjr1vPCc4PkmF6oEmwzX62xqwQ,3948272
119
+ valhalla/bin/valhalla_build_admins,sha256=xUjDZescYypt50YuM40mJpJ6VyKOfh4_twk-KFoSFbQ,1391832
120
+ valhalla/bin/valhalla_build_tiles,sha256=9shEEkOMuQCwECecJsKnszgwrnbHpDLwa9cWYwwxFaU,7004528
121
+ valhalla/bin/valhalla_convert_transit,sha256=qH9IbC_IOOEmas1ORFf11P-zSZ92PFmdI2-UwjGw-G8,7759344
122
+ valhalla/bin/valhalla_ingest_transit,sha256=r1sgKRFvNN4f7C3VbGcg3sjssLbQXS6neoqgkS2vRCc,3919264
123
+ pyvalhalla_git-3.6.0.dist-info/METADATA,sha256=ZVANuP450Tvh5CtKqPfYW2FSwa_SWNiqHIXmBo-FvQE,6784
124
+ pyvalhalla_git-3.6.0.dist-info/WHEEL,sha256=GgX20VmKcCojXA25QwkMazru5rPDAsLYhjc0VMiPAHQ,111
125
+ pyvalhalla_git-3.6.0.dist-info/entry_points.txt,sha256=8F-7UTJvuCYMbRZJQzzCPbrt-vXHTsXMx0xlhG2VXiQ,308
126
+ pyvalhalla_git-3.6.0.dist-info/top_level.txt,sha256=mU472JpF5fOfpVQ8UxZ_dwLmecLogajAMO5RmYsU1gw,19
127
+ pyvalhalla_git-3.6.0.dist-info/RECORD,,
128
+ pyvalhalla_git-3.6.0.dist-info/licenses/AUTHORS,sha256=IGm6Dg1NRkmFHV2GWvlPdfiqVoc1kfoc0pMbcKiCs30,171
129
+ pyvalhalla_git-3.6.0.dist-info/licenses/COPYING,sha256=i9sUrrsAX_p17jiQqhCyQrMMhAyqAbmWxWM4yiefN80,1135
130
+ pyvalhalla_git-3.6.0.dist-info/licenses/LICENSE.md,sha256=sZlxfQFAuJ8ba_1E8G3hYQ7eC770tBIywEWAg3rrixM,44
@@ -0,0 +1,7 @@
1
+ [console_scripts]
2
+ valhalla_add_landmarks = valhalla._scripts:run
3
+ valhalla_add_predicted_traffic = valhalla._scripts:run
4
+ valhalla_build_admins = valhalla._scripts:run
5
+ valhalla_build_tiles = valhalla._scripts:run
6
+ valhalla_convert_transit = valhalla._scripts:run
7
+ valhalla_ingest_transit = valhalla._scripts:run
Binary file
Binary file
valhalla/__init__.py CHANGED
@@ -1,8 +1,16 @@
1
+ from pathlib import Path
2
+
1
3
  try:
2
4
  from ._valhalla import *
3
5
  except ModuleNotFoundError:
4
6
  from _valhalla import *
5
-
6
7
  from .actor import Actor
7
8
  from .config import get_config, get_help
8
- from .__version__ import __version__
9
+
10
+ # if run from CMake, Docker or tests
11
+ try:
12
+ from .__version__ import __version__
13
+ except ModuleNotFoundError:
14
+ __version__ = "undefined"
15
+
16
+ PYVALHALLA_DIR = Path(__file__).parent.resolve()
valhalla/__main__.py ADDED
@@ -0,0 +1,68 @@
1
+ import subprocess
2
+ import sys
3
+ from typing import Optional
4
+
5
+ from ._scripts import PYVALHALLA_BIN_DIR, run
6
+ from . import __version__
7
+
8
+ PRINT_BIN_PATH = "print_bin_path"
9
+
10
+
11
+ def print_help():
12
+ # left-align executable names
13
+ exe_names = [p.name for p in PYVALHALLA_BIN_DIR.iterdir()]
14
+ fixed_width = len(max(exe_names, key=lambda x: len(x)))
15
+
16
+ # TODO: we also want the git commit to show here, probably written to __version__.py by setup.py's BDistWheelCommand
17
+ print(
18
+ F"""
19
+ valhalla Python package {__version__}
20
+
21
+ pyvalhalla package provides a CLI to run Valhalla C++ executables. Arguments are simply passed on as they are.
22
+ One notable exception is --quiet/-q, which will forward the C++ executable's stdout to /dev/null.
23
+ 'python -m valhalla --help' will print this help.
24
+
25
+ Example usage: 'python -m valhalla --quiet valhalla_build_tiles -c valhalla.json -s initialize -e build test.pbf'
26
+
27
+ Available commands (in {PYVALHALLA_BIN_DIR}):
28
+ \t{PRINT_BIN_PATH:<{fixed_width}} - Print the absolute path of directory containing the C++ executables
29
+ """
30
+ )
31
+
32
+
33
+ def main():
34
+ if len(sys.argv) < 2:
35
+ print("[FATAL] command needs arguments, see 'python -m valhalla --help': \n")
36
+ print_help()
37
+ sys.exit(1)
38
+
39
+ prog_or_opt = sys.argv[1]
40
+
41
+ if prog_or_opt in ("--help", "-h"):
42
+ print_help()
43
+ sys.exit(0)
44
+ elif prog_or_opt == PRINT_BIN_PATH:
45
+ # useful when another script wants to run the executables directly for some reason
46
+ print(PYVALHALLA_BIN_DIR)
47
+ else:
48
+ exc: Optional[Exception] = None
49
+ try:
50
+ run(from_main=True)
51
+ except (FileNotFoundError, subprocess.CalledProcessError) as e:
52
+ exc = e
53
+ finally:
54
+ if not exc:
55
+ sys.exit(0)
56
+
57
+ if isinstance(exc, subprocess.CalledProcessError):
58
+ print(f"Failed calling command '{exc.cmd}'\n")
59
+
60
+ print_help()
61
+ print("Sub-command failed with:\n")
62
+ print(exc, file=sys.stderr)
63
+
64
+ sys.exit(1)
65
+
66
+
67
+ if __name__ == "__main__":
68
+ main()
valhalla/__version__.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '3.5.1.post187'
21
- __version_tuple__ = version_tuple = (3, 5, 1, 'post187')
20
+ __version__ = version = '3.6.0'
21
+ __version_tuple__ = version_tuple = (3, 6, 0)
valhalla/_scripts.py ADDED
@@ -0,0 +1,46 @@
1
+ from pathlib import Path
2
+ from shutil import which
3
+ import subprocess
4
+ import sys
5
+
6
+ from . import PYVALHALLA_DIR
7
+
8
+ PYVALHALLA_BIN_DIR = PYVALHALLA_DIR.joinpath("bin").resolve()
9
+
10
+
11
+ def run(from_main=False) -> None:
12
+ """
13
+ Parses the command line arguments and runs the Valhalla executables with the
14
+ provided arguments. Note, by default we assume this is not being called by
15
+ __main__.py via e.g. 'python -m valhalla ...', but directly with e.g.d
16
+ 'valhalla_build_tiles -h'. sys.argv relates to different executables for
17
+ both scenarios.
18
+
19
+ :param from_main: We parse sys.argv differently if it's called from __main__.py
20
+ """
21
+ prog = sys.argv[1] if from_main else Path(sys.argv[0]).name
22
+ prog_args = sys.argv[2:] if from_main else sys.argv[1:]
23
+
24
+ if not which(prog):
25
+ raise FileNotFoundError(f"Can't find executable at {prog}")
26
+ prog_path = PYVALHALLA_BIN_DIR.joinpath(prog).resolve()
27
+
28
+ print(f"[INFO] Running {prog_path} with args: {prog_args}...")
29
+
30
+ # --quiet/-q is our option, don't pass it to the executables
31
+ is_quiet = False
32
+ for arg in prog_args:
33
+ if arg not in ("--quiet", "-q"):
34
+ continue
35
+ prog_args.pop(prog_args.index(arg))
36
+ is_quiet = True
37
+
38
+ # recommended way to call exe
39
+ proc = subprocess.run(
40
+ [str(prog_path)] + prog_args,
41
+ stderr=sys.stderr,
42
+ stdout=subprocess.DEVNULL if is_quiet else sys.stdout,
43
+ )
44
+
45
+ # raises CalledProcessError if not successful
46
+ proc.check_returncode()
valhalla/_valhalla.cc ADDED
@@ -0,0 +1,81 @@
1
+ #include "baldr/rapidjson_utils.h"
2
+ #include "midgard/logging.h"
3
+ #include "midgard/util.h"
4
+ #include "tyr/actor.h"
5
+
6
+ #include <boost/make_shared.hpp>
7
+ #include <boost/noncopyable.hpp>
8
+ #include <boost/property_tree/ptree.hpp>
9
+ #include <pybind11/pybind11.h>
10
+
11
+ #include <string>
12
+
13
+ namespace vt = valhalla::tyr;
14
+ namespace {
15
+
16
+ // configuring multiple times is wasteful/ineffectual but not harmful
17
+ // TODO: make this threadsafe just in case its abused
18
+ const boost::property_tree::ptree configure(const std::string& config) {
19
+ boost::property_tree::ptree pt;
20
+ try {
21
+ // parse the config and configure logging
22
+ rapidjson::read_json(config, pt);
23
+
24
+ auto logging_subtree = pt.get_child_optional("mjolnir.logging");
25
+ if (logging_subtree) {
26
+ auto logging_config = valhalla::midgard::ToMap<const boost::property_tree::ptree&,
27
+ std::unordered_map<std::string, std::string>>(
28
+ logging_subtree.get());
29
+ valhalla::midgard::logging::Configure(logging_config);
30
+ }
31
+ } catch (...) { throw std::runtime_error("Failed to load config from: " + config); }
32
+
33
+ return pt;
34
+ }
35
+ } // namespace
36
+
37
+ namespace py = pybind11;
38
+
39
+ PYBIND11_MODULE(_valhalla, m) {
40
+ py::class_<vt::actor_t>(m, "_Actor", "Valhalla Actor class")
41
+ .def(py::init<>([](std::string config) { return vt::actor_t(configure(config), true); }))
42
+ .def(
43
+ "route", [](vt::actor_t& self, std::string& req) { return self.route(req); },
44
+ "Calculates a route.")
45
+ .def(
46
+ "locate", [](vt::actor_t& self, std::string& req) { return self.locate(req); },
47
+ "Provides information about nodes and edges.")
48
+ .def(
49
+ "optimized_route",
50
+ [](vt::actor_t& self, std::string& req) { return self.optimized_route(req); },
51
+ "Optimizes the order of a set of waypoints by time.")
52
+ .def(
53
+ "matrix", [](vt::actor_t& self, std::string& req) { return self.matrix(req); },
54
+ "Computes the time and distance between a set of locations and returns them as a matrix table.")
55
+ .def(
56
+ "isochrone", [](vt::actor_t& self, std::string& req) { return self.isochrone(req); },
57
+ "Calculates isochrones and isodistances.")
58
+ .def(
59
+ "trace_route", [](vt::actor_t& self, std::string& req) { return self.trace_route(req); },
60
+ "Map-matching for a set of input locations, e.g. from a GPS.")
61
+ .def(
62
+ "trace_attributes",
63
+ [](vt::actor_t& self, std::string& req) { return self.trace_attributes(req); },
64
+ "Returns detailed attribution along each portion of a route calculated from a set of input locations, e.g. from a GPS trace.")
65
+ .def(
66
+ "height", [](vt::actor_t& self, std::string& req) { return self.height(req); },
67
+ "Provides elevation data for a set of input geometries.")
68
+ .def(
69
+ "transit_available",
70
+ [](vt::actor_t& self, std::string& req) { return self.transit_available(req); },
71
+ "Lookup if transit stops are available in a defined radius around a set of input locations.")
72
+ .def(
73
+ "expansion", [](vt::actor_t& self, std::string& req) { return self.expansion(req); },
74
+ "Returns all road segments which were touched by the routing algorithm during the graph traversal.")
75
+ .def(
76
+ "centroid", [](vt::actor_t& self, std::string& req) { return self.centroid(req); },
77
+ "Returns routes from all the input locations to the minimum cost meeting point of those paths.")
78
+ .def(
79
+ "status", [](vt::actor_t& self, std::string& req) { return self.status(req); },
80
+ "Returns nothing or optionally details about Valhalla's configuration.");
81
+ }
Binary file
Binary file
Binary file
Binary file
Binary file