Compare commits
613 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4370fd126d | |||
| 15a2fdd1f8 | |||
| 0eedcf69bc | |||
| 62abea30f5 | |||
| 3364be1860 | |||
| a5eeca9b51 | |||
| 1a09ff6005 | |||
| 2794a52902 | |||
| cb796e4cfc | |||
| 522ec4fc2e | |||
| 15dc5899b0 | |||
| 7e932ffbc3 | |||
| 810596bb83 | |||
| acabf0075c | |||
| 1ed72db210 | |||
| 6bdf95dfb4 | |||
| 785ae89cd8 | |||
| 16680191de | |||
| 59b70c4d11 | |||
| f96bae40ac | |||
| ba974c73bf | |||
| e498ad3ee7 | |||
| 1de031ed06 | |||
| d6ac924b94 | |||
| ee24473cbb | |||
| c19a3cec1c | |||
| f3694be1a0 | |||
| 306d86ce58 | |||
| 2c001b63a5 | |||
| e162dda836 | |||
| 10c532bd4c | |||
| c8a7bc1d6a | |||
| 9ca3c69b49 | |||
| d1cf8c1fd5 | |||
| 018742f50f | |||
| b82d21f856 | |||
| cfaadf198f | |||
| 6698b5e07e | |||
| 37794a5e8a | |||
| a88fef2937 | |||
| da474a16a9 | |||
| 59bbfeb67f | |||
| 4e9e2ed5bd | |||
| e0593c7ca2 | |||
| 1f69df0d89 | |||
| 05706879a0 | |||
| 7e49b36198 | |||
| 56bcb491d3 | |||
| f4e2bd848d | |||
| 0cf96314a3 | |||
| 91e24cab9e | |||
| 288155ead0 | |||
| 85454857d3 | |||
| fe50f6590a | |||
| 2da5da3f16 | |||
| 446c865415 | |||
| 0072bf0c59 | |||
| 4ec7ca29f1 | |||
| d94017dfae | |||
| dce0ce0e17 | |||
| d61102e255 | |||
| 7f6e0c478b | |||
| 786a3d8919 | |||
| ef3fcdc6e6 | |||
| 90c194fc81 | |||
| 5ed686a17b | |||
| 4e3009260c | |||
| c87ce2dede | |||
| 99a87b4c83 | |||
| 3f5fc1e897 | |||
| 97d1de1beb | |||
| d7e1c9c09c | |||
| 865111bca9 | |||
| 08d62cd5e3 | |||
| 603e2ee7de | |||
| 98948989d0 | |||
| 1aa8cc3b65 | |||
| c487d1307e | |||
| 604f4957f7 | |||
| 7726576bb7 | |||
| cf17a3a4c3 | |||
| 0972ec9115 | |||
| f660ae30dc | |||
| 2766c24b42 | |||
| cab83555e1 | |||
| 48a098a9c7 | |||
| a1fa1c610c | |||
| 905ca69301 | |||
| d66cc125aa | |||
| 3fc0fc65f9 | |||
| 8c64b01d67 | |||
| 2566f64c34 | |||
| 8cd40b9e90 | |||
| 45df8568b6 | |||
| 0da041477b | |||
| 272ea9b92e | |||
| 571681d019 | |||
| 9b614c6057 | |||
| 721f319909 | |||
| a3621f3655 | |||
| 789311abd6 | |||
| 091a495632 | |||
| 16665aeb00 | |||
| d6e56c38d5 | |||
| 87874006c7 | |||
| 703588b684 | |||
| b21ee1b63b | |||
| 427437d49b | |||
| 01deefc3bc | |||
| 157ca9161f | |||
| 266e65e6d2 | |||
| 70b3962c35 | |||
| e568b600f0 | |||
| 273fd689ce | |||
| 0363d64722 | |||
| d200507424 | |||
| fc84f605af | |||
| 927dea37bb | |||
| de98ae57b7 | |||
| 614398ed6c | |||
| 2cd4ba9a0a | |||
| 57d3f71bf9 | |||
| 8f8df969a2 | |||
| e39dc3c464 | |||
| dbc6535221 | |||
| e262cac3e8 | |||
| 4ab3165ae3 | |||
| 7a1a209168 | |||
| ac6f07a744 | |||
| dac929f8df | |||
| ebd938a8fc | |||
| 5ba54a62d6 | |||
| 827a595b6c | |||
| c03f74d8b0 | |||
| f5393f44f7 | |||
| ad6e834992 | |||
| 3439b21177 | |||
| 730c809395 | |||
| 5a2da798c8 | |||
| c0e7f6e9f4 | |||
| ed83d3ed13 | |||
| aa1dff3fc4 | |||
| c1901e9689 | |||
| c6e6d9fa94 | |||
| 88eabb98b9 | |||
| 3dcc7132b6 | |||
| 379380abd8 | |||
| 497709da13 | |||
| b95a58591d | |||
| 5727b1387e | |||
| 221cd00b1a | |||
| cce4f6344c | |||
| a49c6f433b | |||
| ef308ac53a | |||
| 2fab696bb3 | |||
| 836a5066c2 | |||
| 69422cc4e7 | |||
| e9c0987e8a | |||
| bd9eb76a2d | |||
| 441eae9df2 | |||
| bfc272f3e8 | |||
| 215489286d | |||
| c772210cc0 | |||
| 934f87bcdd | |||
| ff872b4009 | |||
| 7278f88aa9 | |||
| 16621f00c1 | |||
| 0c9eb8e16c | |||
| 78cd460395 | |||
| 2351b5a084 | |||
| ff238c2724 | |||
| 810e3c6a66 | |||
| 98529ee071 | |||
| e902ab4693 | |||
| b085add973 | |||
| 2b397942fe | |||
| 655ca803d8 | |||
| 58681fa7ea | |||
| 78a199e2fb | |||
| 851fcf0758 | |||
| 7379be90f9 | |||
| af65ccd054 | |||
| 79ef204e1f | |||
| f1b88adebe | |||
| 0c6ce6ce08 | |||
| 5e40b12450 | |||
| a75fd560d7 | |||
| 152f77b665 | |||
| c39690195e | |||
| 20c6b4682f | |||
| 97c442482d | |||
| 6586737835 | |||
| fe5d1a6e74 | |||
| 81771a3bfd | |||
| c648711f30 | |||
| 6829f46c31 | |||
| 43a7e8e08a | |||
| c370ddd89a | |||
| 57c6c6e51c | |||
| bf6698f4cc | |||
| 44757729b7 | |||
| eb2e4d0aaf | |||
| 4684a498c4 | |||
| 864543b023 | |||
| ed143b503d | |||
| 809d8a7d03 | |||
| 5ab882759d | |||
| acbaecf45d | |||
| 1f238fedd8 | |||
| 5828f4400d | |||
| 4e2b157db3 | |||
| 8f9b4fcdbb | |||
| 23c74af2b5 | |||
| 2cc22ce098 | |||
| 2df02aa301 | |||
| cec1f223e9 | |||
| 17f8339aa6 | |||
| 35c4c2a256 | |||
| 3c81baa26e | |||
| 0a917a77f5 | |||
| 583699c84d | |||
| 0f7218c0c4 | |||
| 2d66fec174 | |||
| 3cae315a76 | |||
| d661f3f31e | |||
| 907f933a54 | |||
| c6e9cc8024 | |||
| 40094ceeab | |||
| 24c70e3c8e | |||
| a636e8cc13 | |||
| ffd6311e7d | |||
| 260a84b94b | |||
| fb552fd751 | |||
| 94e2a8598d | |||
| 4986f5ea2d | |||
| 1b5ab37dfd | |||
| 83820bf82c | |||
| 20e028c47b | |||
| 89c62bf67f | |||
| bc43229055 | |||
| e43a8ca528 | |||
| c7fc36a61b | |||
| e705ff16e3 | |||
| 0a13390ab0 | |||
| bf6b571455 | |||
| e13ba8ba11 | |||
| 5aba239fc1 | |||
| dff8c48842 | |||
| ec3cda32fa | |||
| faaf82c837 | |||
| 3f6ae245f6 | |||
| bc2e06502e | |||
| aa1c4eb262 | |||
| 264cec12e9 | |||
| e423aa5511 | |||
| 9b5458840a | |||
| fae1c737a3 | |||
| 6f9aea4e56 | |||
| d575561d39 | |||
| f42136637d | |||
| 53b0417e36 | |||
| 5bb933dd84 | |||
| 821351f56e | |||
| a92fa257af | |||
| c29391636a | |||
| c8bd01caae | |||
| 1f39d936c5 | |||
| 36ab848aba | |||
| 6cb401b1ff | |||
| fc9b5938e6 | |||
| 8ad9a0aa9a | |||
| 8f9e980945 | |||
| b2f3b901e0 | |||
| 517b27bfc3 | |||
| 00d01946cd | |||
| 694bf9d8b1 | |||
| ef71cc0d12 | |||
| 5f73ac1eda | |||
| 108fce896b | |||
| ff0a98196f | |||
| 757e7ca936 | |||
| 74b382d881 | |||
| a725fb4655 | |||
| ee076e6156 | |||
| 65669f23a1 | |||
| 172b1ff9d1 | |||
| 596890a0f4 | |||
| 0770d8b8cf | |||
| cc3a4899a2 | |||
| 93cdd8bb46 | |||
| c2a5cc034a | |||
| e737700c7b | |||
| a32f8a6a59 | |||
| ed00965d18 | |||
| 3f485ac09b | |||
| a901bda41e | |||
| 0ac1f99f9c | |||
| 30ff0fa977 | |||
| 7da86b5984 | |||
| 922e155763 | |||
| 436b34ffea | |||
| 2fa8d0f534 | |||
| 71e95c92b6 | |||
| fbf7521769 | |||
| 7c911b3891 | |||
| 9f61f72ee8 | |||
| d32ebd57e6 | |||
| 8e43c8cbce | |||
| 7632c20ddf | |||
| 4fa3a5c362 | |||
| 886421b43a | |||
| e20cbf673f | |||
| 54c35710f6 | |||
| 748ade5fea | |||
| f5e9c7df07 | |||
| 1541d32a42 | |||
| ed7438b9ba | |||
| e8cca36369 | |||
| d473acb56d | |||
| b5d63e5ed5 | |||
| c712fafae3 | |||
| e589ab814d | |||
| 5015e12d59 | |||
| 3e409bea26 | |||
| e0665856b0 | |||
| f71d742b5e | |||
| 299d071e9d | |||
| 075f69acc2 | |||
| be41e8b321 | |||
| 739ad73ae9 | |||
| b62b09e5f6 | |||
| b789da45bd | |||
| e316dad1cb | |||
| c3cc79f798 | |||
| b9ed20bb9b | |||
| 786be6f570 | |||
| dd60ae31ae | |||
| db7adfa77b | |||
| dd3f351874 | |||
| d56db500d3 | |||
| 07221f5a48 | |||
| 421d336b0f | |||
| 5be6f8959a | |||
| f7b8e06c3a | |||
| 18a50d357f | |||
| 6c3390f14d | |||
| 8d83c3adbb | |||
| cd1a73dde6 | |||
| 4161181a6c | |||
| 82acd59a8e | |||
| 438aa66b4c | |||
| 5739c27ef4 | |||
| b59295e55e | |||
| 49862d1bcd | |||
| 544e54894f | |||
| 046d3128c4 | |||
| 1ad1ff5fc1 | |||
| e06ffabf21 | |||
| b2b5e2bb4d | |||
| c2727f2029 | |||
| a0e7bab598 | |||
| 67ae86882a | |||
| e52a8e060b | |||
| 1bc8dbf139 | |||
| 73b1a46d15 | |||
| 7ecf3410bf | |||
| 03bb6dc161 | |||
| a45b9e07fc | |||
| 6567e79ec5 | |||
| 224848fc11 | |||
| 6468a1ba79 | |||
| ce1141982b | |||
| 6e18af2267 | |||
| 73ce44028f | |||
| 335362315c | |||
| e75278f9c2 | |||
| a31f401995 | |||
| 6446257a93 | |||
| 1bace1288d | |||
| 23b07c9197 | |||
| a61b1a3623 | |||
| 7f39c9fcb0 | |||
| 921ff43acf | |||
| 1ed1bae249 | |||
| 38a1edfe3c | |||
| dc1d491c15 | |||
| e4d500f451 | |||
| d52ea86cb9 | |||
| b906f2a628 | |||
| 2b00d92463 | |||
| d28713b845 | |||
| 2e6428e917 | |||
| 1f3a8d4538 | |||
| 140f1ad923 | |||
| 1c25070572 | |||
| 24fe881d03 | |||
| 25ab51f4f0 | |||
| 46f96af360 | |||
| ce685da92c | |||
| 2218658969 | |||
| 3e2db47cc8 | |||
| 28a8154cee | |||
| 005124fe1c | |||
| 1e4c8eeeb6 | |||
| 72455a2733 | |||
| 112cf55aae | |||
| aa3f208032 | |||
| 919386bdaf | |||
| ae835cc04f | |||
| ef4d32a492 | |||
| 2a5ebf84bc | |||
| 768dc8d817 | |||
| 0c04c6cafb | |||
| bf690df97a | |||
| 880b982eeb | |||
| 53011755a2 | |||
| ddb60c34e6 | |||
| 543f0e5e44 | |||
| 1e9e420d91 | |||
| c885d03830 | |||
| ab91a05680 | |||
| 84261fd214 | |||
| 734df348cb | |||
| 41064e2d7b | |||
| 8d7aae8687 | |||
| 7256b6d0d4 | |||
| 3106b5dd9e | |||
| f1427a834d | |||
| 04954de9c6 | |||
| a6cd0863bc | |||
| 9f28873cb1 | |||
| 10c5d76909 | |||
| d81ef3f4db | |||
| 3abab16bf3 | |||
| 6e1c4bfecd | |||
| cedeb15ade | |||
| f2663acfc6 | |||
| c48fc58eb2 | |||
| 5f1c7efd41 | |||
| 9e5d45d86a | |||
| 5fd6355829 | |||
| 6da4d918d0 | |||
| 1628ebb871 | |||
| eaed5c7a8e | |||
| 9d2628b74f | |||
| 11ee632cfe | |||
| 97c0a74c04 | |||
| b3ef27d104 | |||
| c22ce3ae1f | |||
| 36c944ef53 | |||
| 5b24758742 | |||
| a572719484 | |||
| ad594cb2e4 | |||
| 6b143c5e1d | |||
| 25baf51a2c | |||
| c059d15cb9 | |||
| 279f8aabfb | |||
| e463733138 | |||
| 7deff5837c | |||
| 46ac9d05d9 | |||
| c7640903c3 | |||
| 445225bf6d | |||
| 47b1a56b12 | |||
| b5e289adc3 | |||
| e0a1a43449 | |||
| 337ecefa45 | |||
| 7961fa8863 | |||
| 88eb9e5499 | |||
| df449d3b5c | |||
| 6f27aae022 | |||
| d8c54fb815 | |||
| 5c93609142 | |||
| c277b95f03 | |||
| b1f1c26703 | |||
| a5d0707dd0 | |||
| d129b0ef24 | |||
| f2c3b9859e | |||
| bb1f4a025a | |||
| 8c36012653 | |||
| 66cb75f4a3 | |||
| 0c6dee4bef | |||
| 49d3467ec7 | |||
| a48cf58468 | |||
| fbc7189cf8 | |||
| e8167b2e4e | |||
| c03aa8a273 | |||
| a40abacfca | |||
| b8beac2d00 | |||
| 75e0b5a5c4 | |||
| c03b230e84 | |||
| 6b06c5bd32 | |||
| 226ee62981 | |||
| fce3bb180c | |||
| 1ae69fe40d | |||
| e4dc2aa45c | |||
| d0f1347ff1 | |||
| 70e899378d | |||
| dbd70d4884 | |||
| 71044e88f3 | |||
| b8f631f6f6 | |||
| 3837f9d015 | |||
| 763ad0d047 | |||
| b6f9ec2a33 | |||
| 5d3a348b76 | |||
| 104e23abf3 | |||
| a7bb26f2d6 | |||
| 710ba20acc | |||
| fce8d72895 | |||
| 774b8688ca | |||
| fe2beb6f68 | |||
| 71e7d6d6b8 | |||
| 29f736f1c8 | |||
| bb4f13a47c | |||
| bb0b03bbce | |||
| 59ad7dddb2 | |||
| f12fdeb23e | |||
| f896aaf881 | |||
| a2a2cf84d1 | |||
| 4e897aad50 | |||
| 5e8bdbfa0c | |||
| fd57c5b48b | |||
| 1d4d3b80b5 | |||
| f82740ed93 | |||
| c1f833c80f | |||
| 813e16b9b4 | |||
| 06ef3053de | |||
| 9fa7e6c74f | |||
| a7d63283ab | |||
| 78a443bfb2 | |||
| 84b8d3cfb9 | |||
| b3483f95a7 | |||
| 32f63e5e0c | |||
| 185e9dc7f3 | |||
| 6794f52cb2 | |||
| 06e6b9ea6f | |||
| 93d89ad686 | |||
| 7c8176b077 | |||
| 7ef95e9918 | |||
| f313cb9913 | |||
| 15c8fd326f | |||
| f7e8581a1b | |||
| c01ea2ea3e | |||
| 1153b78c06 | |||
| b5d5f309a3 | |||
| 5100f2cc7b | |||
| f6fef5c166 | |||
| 559c88b36d | |||
| 7dea7476f1 | |||
| dc81f581a0 | |||
| 300283d572 | |||
| aad2124faa | |||
| aced058c4a | |||
| 24ab71a346 | |||
| 2640a319c1 | |||
| e6ff17ab2a | |||
| f7ad2e1e26 | |||
| 2ed6b181c8 | |||
| f48bbb78de | |||
| bd2a5ebe10 | |||
| f8499957fa | |||
| 5db134bbba | |||
| 8645d8c7fc | |||
| b8e13d9b1b | |||
| 421caa1856 | |||
| ed9d10e96c | |||
| 0f3a463854 | |||
| b9b52cb857 | |||
| 9af67c5a9f | |||
| 8ffe915395 | |||
| b376c97db8 | |||
| 7b11cd3a11 | |||
| 76de3b6ace | |||
| bc081b7132 | |||
| 3cbac0f012 | |||
| f40b34af9d | |||
| cc14fb8bff | |||
| c5e3fa916f | |||
| dff7fe214b | |||
| 3b2ca720a8 | |||
| df4231341f | |||
| 0a2f934c87 | |||
| 3721f8c887 | |||
| 1ba5ff44cc | |||
| 5ecd2e4c67 | |||
| b1f6797aab | |||
| f04d146ca3 | |||
| 8c50a42ec4 | |||
| c4b3cdfd80 | |||
| 37051e1583 | |||
| d3ef993d5f | |||
| 9832825abd | |||
| d584bcad11 | |||
| e48ca65af4 | |||
| f429e08851 | |||
| de062d4ca3 | |||
| d83ab9d905 | |||
| 4618b502ac | |||
| 94854b5c90 | |||
| f8dd965435 | |||
| 6e29f9889b | |||
| 48d4e91d98 | |||
| 708ac04562 | |||
| 38b2ad298d | |||
| a51ef67db8 | |||
| 67ce19cb14 | |||
| 1b51163b1d | |||
| 84b618ed1a | |||
| dc8e6bd8d9 | |||
| 68e38880df | |||
| d5904d5756 | |||
| 0f59b78c02 | |||
| 6e7fe5feb0 | |||
| 3dfbf42e61 |
+11
-1
@@ -7,6 +7,8 @@
|
||||
#############################
|
||||
osrm-deps
|
||||
|
||||
.ycm_extra_conf.py
|
||||
|
||||
# Compiled source #
|
||||
###################
|
||||
*.com
|
||||
@@ -47,6 +49,9 @@ Thumbs.db
|
||||
/build/
|
||||
/example/build/
|
||||
/test/data/monaco*
|
||||
/test/data/ch
|
||||
/test/data/corech
|
||||
/test/data/mld
|
||||
/cmake/postinst
|
||||
|
||||
# Eclipse related files #
|
||||
@@ -86,7 +91,6 @@ stxxl.errlog
|
||||
/test/cache
|
||||
/test/speeds.csv
|
||||
/test/penalties.csv
|
||||
/test/data/monaco.*
|
||||
node_modules
|
||||
|
||||
# Deprecated config file #
|
||||
@@ -94,3 +98,9 @@ node_modules
|
||||
/server.ini
|
||||
|
||||
*.swp
|
||||
|
||||
# local lua debugging file
|
||||
debug.lua
|
||||
|
||||
# node-osrm artifacts
|
||||
lib/binding
|
||||
|
||||
+199
-56
@@ -7,14 +7,22 @@ git:
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
node_js:
|
||||
- "4"
|
||||
- "6"
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- "5.7"
|
||||
# enable building tags
|
||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
|
||||
cache:
|
||||
yarn: true
|
||||
ccache: true
|
||||
apt: true
|
||||
directories:
|
||||
@@ -22,11 +30,16 @@ cache:
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "hk+32aXXF5t1ApaM2Wjqooz3dx1si907L87WRMkO47WlpJmUUU/Ye+MJk9sViH8MdhOcceocVAmdYl5/WFWOIbDWNlBya9QvXDZyIu2KIre/0QyOCTZbrsif8paBXKIO5O/R4OTvIZ8rvWZsadBdmAT9GSbDhih6FzqXAEgeIYQ="
|
||||
- secure: "VE+cFkseFwW4jK6XwkP0yW3h4DixPJ8+Eb3yKcchGZ5iIJxlZ/8i1vKHYxadgPRwSYwPSB14tF70xj2OmiT2keGzZUfphmPXinBaLEhYk+Bde+GZZkoSl5ND109I/LcyNr0nG9dDgtV6pkvFchgchpyP9JnVOOS0+crEZlAz0RE="
|
||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||
- CCACHE_COMPRESS=1
|
||||
- CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742
|
||||
- CCACHE_VERSION=3.3.1
|
||||
- CMAKE_VERSION=3.6.2
|
||||
- CMAKE_VERSION=3.7.2
|
||||
- MASON="$(pwd)/scripts/mason.sh"
|
||||
- ENABLE_NODE_BINDINGS=On
|
||||
- NODE="4"
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -36,26 +49,30 @@ matrix:
|
||||
|
||||
# Debug Builds
|
||||
- os: linux
|
||||
compiler: "gcc-6-debug"
|
||||
compiler: "gcc-6-debug-cov-asan"
|
||||
addons: &gcc6
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON BUILD_COMPONENTS=ON
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- os: linux
|
||||
compiler: "clang-3.8-debug"
|
||||
addons: &clang38
|
||||
compiler: "clang-4.0-debug"
|
||||
addons: &clang40
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CLANG_VERSION='3.8.1' BUILD_TYPE='Debug' RUN_CLANG_FORMAT=ON BUILD_COMPONENTS=ON CUCUMBER_TIMEOUT=60000
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
compiler: "mason-osx-release"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON
|
||||
- os: linux
|
||||
compiler: "mason-linux-debug-asan"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
|
||||
|
||||
# Release Builds
|
||||
- os: linux
|
||||
@@ -64,7 +81,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='3.8.1' BUILD_TYPE='Release' ENABLE_MASON=ON
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release"
|
||||
@@ -72,7 +89,7 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_COMPONENTS=ON
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release'
|
||||
|
||||
- os: linux
|
||||
compiler: "gcc-6-release-i686"
|
||||
@@ -88,14 +105,22 @@ matrix:
|
||||
packages: ['g++-4.9', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev', 'ccache']
|
||||
env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release'
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
compiler: "mason-osx-release"
|
||||
# we use the xcode provides clang and don't install our own
|
||||
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
# Disabled because of CI slowness
|
||||
#- os: linux
|
||||
#- compiler: clang
|
||||
#- addons: &clang38
|
||||
#- addons: &clang40
|
||||
#- apt:
|
||||
#- sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
||||
#- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release'
|
||||
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||
#- packages: ['clang-4.0', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release'
|
||||
|
||||
# Shared Library
|
||||
- os: linux
|
||||
@@ -104,61 +129,183 @@ matrix:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON BUILD_COMPONENTS=ON
|
||||
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
# Disabled because CI slowness
|
||||
#- os: linux
|
||||
#- compiler: clang
|
||||
#- addons: &clang38
|
||||
#- addons: &clang40
|
||||
#- apt:
|
||||
#- sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
|
||||
#- packages: ['clang-3.8', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-3.8' CXXCOMPILER='clang++-3.8' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
#- sources: ['llvm-toolchain-trusty-4.0', 'ubuntu-toolchain-r-test']
|
||||
#- packages: ['clang-4.0', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
|
||||
#- env: CCOMPILER='clang-4.0' CXXCOMPILER='clang++-4.0' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON
|
||||
|
||||
# Node build jobs. These skip running the tests.
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-4-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-4-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-6-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3 NODE="6"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
- os: linux
|
||||
sudo: false
|
||||
compiler: "node-6-mason-linux-release"
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['libstdc++-5-dev']
|
||||
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3 NODE="6"
|
||||
install:
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
script:
|
||||
- npm run nodejs-tests
|
||||
after_success:
|
||||
- ./scripts/travis/publish.sh
|
||||
|
||||
before_install:
|
||||
- source $NVM_DIR/nvm.sh
|
||||
- nvm install $NODE
|
||||
- nvm use $NODE
|
||||
- node --version
|
||||
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export JOBS=$((`nproc` + 1))
|
||||
if [[ -z $JOBS ]]; then
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
export JOBS=$((`nproc` + 1))
|
||||
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
||||
fi
|
||||
fi
|
||||
- |
|
||||
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
||||
${MASON} install clang-format 3.8.1 && PATH=$(${MASON} prefix clang-format 3.8.1)/bin:${PATH} ./scripts/format.sh
|
||||
fi
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
export JOBS=$((`sysctl -n hw.ncpu` + 1))
|
||||
sudo mdutil -i off /
|
||||
fi
|
||||
- |
|
||||
if [[ ! -f $(which yarn) ]]; then
|
||||
npm install -g yarn
|
||||
fi
|
||||
- export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||
- export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off")
|
||||
- echo "Using ${JOBS} jobs"
|
||||
- source ./scripts/install_node.sh 4
|
||||
- npm install -g "npm@>=3" # Upgrade to npm >v2 to reduce size of downloaded dependencies
|
||||
- npm install
|
||||
- ./third_party/mason/mason install ccache ${CCACHE_VERSION}
|
||||
- export PATH=$(./third_party/mason/mason prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
||||
- ./third_party/mason/mason install cmake ${CMAKE_VERSION}
|
||||
- export PATH=$(./third_party/mason/mason prefix cmake ${CMAKE_VERSION})/bin:${PATH}
|
||||
- yarn install --ignore-scripts
|
||||
# Bootstrap cmake to be able to run mason
|
||||
- CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}.tar.gz"
|
||||
- CMAKE_DIR="mason_packages/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}"
|
||||
- mkdir -p ${CMAKE_DIR}
|
||||
- travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} || exit 1
|
||||
- export PATH=${CMAKE_DIR}/bin:${PATH}
|
||||
- ${MASON} install tbb 2017_20161128 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_20161128)/lib/:${LD_LIBRARY_PATH}
|
||||
- ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH}
|
||||
- |
|
||||
if [[ ! -z ${CLANG_VERSION} ]]; then
|
||||
export CCOMPILER='clang'
|
||||
export CXXCOMPILER='clang++'
|
||||
./third_party/mason/mason install clang++ ${CLANG_VERSION}
|
||||
export PATH=$(./third_party/mason/mason prefix clang++ ${CLANG_VERSION})/bin:${PATH}
|
||||
${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH}
|
||||
# we only enable lto for release builds
|
||||
# and therefore don't need to us ld.gold or llvm tools for linking
|
||||
# for debug builds
|
||||
if [[ ${BUILD_TYPE} == 'Release' ]]; then
|
||||
./third_party/mason/mason install binutils 2.27
|
||||
export PATH=$(./third_party/mason/mason prefix binutils 2.27)/bin:${PATH}
|
||||
${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH}
|
||||
fi
|
||||
fi
|
||||
- ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes
|
||||
- export OSRM_INSTALL_DIR="$(pwd)/install-osrm"
|
||||
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- mkdir ${OSRM_BUILD_DIR}
|
||||
|
||||
install:
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
./scripts/check_taginfo.py taginfo.json profiles/car.lua
|
||||
fi
|
||||
- export OSRM_BUILD_DIR="$(pwd)/build-osrm"
|
||||
- mkdir ${OSRM_BUILD_DIR} && pushd ${OSRM_BUILD_DIR}
|
||||
- export CC=${CCOMPILER} CXX=${CXXCOMPILER}
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_MASON=${ENABLE_MASON:-OFF} -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} -DBUILD_TOOLS=ON -DBUILD_COMPONENTS=${BUILD_COMPONENTS:-OFF} -DENABLE_CCACHE=ON
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- |
|
||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \
|
||||
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
|
||||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \
|
||||
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
||||
-DBUILD_TOOLS=ON \
|
||||
-DENABLE_CCACHE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||
- echo "travis_fold:start:MAKE"
|
||||
- make --jobs=${JOBS}
|
||||
- make tests --jobs=${JOBS}
|
||||
@@ -168,37 +315,33 @@ install:
|
||||
- sudo make install
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||
sudo ldconfig
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib
|
||||
fi
|
||||
- popd
|
||||
- mkdir example/build && pushd example/build
|
||||
- export PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig
|
||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||
- make --jobs=${JOBS}
|
||||
- popd
|
||||
- npm run build-api-docs
|
||||
# building docs only works with npm3+ not with yarn or npm2
|
||||
#- yarn run docs
|
||||
|
||||
script:
|
||||
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
|
||||
- echo "travis_fold:start:BENCHMARK"
|
||||
- make -C test/data benchmark
|
||||
- echo "travis_fold:end:BENCHMARK"
|
||||
- ./example/build/osrm-example test/data/monaco.osrm
|
||||
- ./example/build/osrm-example test/data/ch/monaco.osrm
|
||||
# All tests assume to be run from the build directory
|
||||
- pushd ${OSRM_BUILD_DIR}
|
||||
- ./unit_tests/library-tests ../test/data/monaco.osrm
|
||||
- ./unit_tests/library-tests
|
||||
- ./unit_tests/extractor-tests
|
||||
- ./unit_tests/engine-tests
|
||||
- ./unit_tests/util-tests
|
||||
- ./unit_tests/server-tests
|
||||
- ./unit_tests/partition-tests
|
||||
- |
|
||||
if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
|
||||
npm run nodejs-tests
|
||||
fi
|
||||
- popd
|
||||
- npm test
|
||||
- yarn test
|
||||
|
||||
after_success:
|
||||
- |
|
||||
if [ -n "${RUN_CLANG_FORMAT}" ]; then
|
||||
./scripts/format.sh # we don't want to fail just yet
|
||||
fi
|
||||
- |
|
||||
if [ -n "${ENABLE_COVERAGE}" ]; then
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
fi
|
||||
|
||||
+88
-2
@@ -1,3 +1,91 @@
|
||||
# 5.7.0
|
||||
- Changes from 5.6
|
||||
- Bug fixes:
|
||||
- Fixed 505: Invalid distance value for distance as routing weight.
|
||||
- Fixed 3958: Fix traffic light penalties for non-turns
|
||||
- Fixed 3933: crash when collapsing instructions
|
||||
- Algorithm:
|
||||
- OSRM object has new option `algorithm` that allows the selection of a routing algorithm.
|
||||
- New experimental algorithm: Multi-Level Dijkstra with new toolchain:
|
||||
- Allows for fast metric updates in below a minute on continental sized networks (osrm-customize)
|
||||
- Plugins supported: `match` and `route`
|
||||
- Quickstart: `osrm-extract data.osm.pbf`, `osrm-partition data.osrm`, `osrm-customize data.osrm`, `osrm-routed --algorithm=MLD data.osrm`
|
||||
- NodeJs Bindings
|
||||
- Merged https://github.com/Project-OSRM/node-osrm into repository. Build via `cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On`.
|
||||
- `OSRM` object has new option `algorihtm="CH","CoreCH","MLD"`
|
||||
- Internals
|
||||
- Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances
|
||||
- Files
|
||||
- .osrm.datasource_index file was removed. Data is now part of .osrm.geometries.
|
||||
- .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now.
|
||||
- `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore
|
||||
- `osrm-extract` creates new file `.osrm.cnbg` and `.cnbg_to_ebg`
|
||||
- `osrm-partition` creates new file `.osrm.partition` and `.osrm.cells`
|
||||
- `osrm-customize` creates new file `.osrm.mldgr`
|
||||
- Profiles
|
||||
- Added `force_split_edges` flag to global properties. True value guarantees that segment_function will be called for all segments, but also could double memory consumption
|
||||
- Map Matching:
|
||||
- new option `gaps=split|ignore` to enable/disbale track splitting
|
||||
- new option `tidy=true|false` to simplify traces automatically
|
||||
|
||||
# 5.6.3
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- #3790 Fix incorrect speed values in tile plugin
|
||||
|
||||
# 5.6.2
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- Fix incorrect forward datasources getter in facade
|
||||
|
||||
# 5.6.1
|
||||
- Changes from 5.6.0
|
||||
- Bugfixes
|
||||
- Fix #3754 add restricted penalty on NoTurn turns
|
||||
|
||||
# 5.6.0
|
||||
- Changes from 5.5
|
||||
- Bugfixes
|
||||
- Fix #3475 removed an invalid `exit` field from the `arrive` maneuver
|
||||
- Fix #3515 adjusted number of `nodes` in `annotation`
|
||||
- Fix #3605 Fixed a bug that could lead to turns at the end of the road to be suppressed
|
||||
- Fix #2844 handle up to 16777215 code units in OSM names
|
||||
- Infrastructure
|
||||
- Support building rpm packages.
|
||||
- Guidance
|
||||
- No longer emitting turns on ferries, if a ferry should use multiple docking locations
|
||||
- Profiles
|
||||
- Removed the `./profile.lua -> ./profiles/car.lua` symlink. Use specific profiles from the `profiles` directory.
|
||||
- `properties` object has a new `weight_name` field, default value is "duration"
|
||||
- `properties` object has a new `weight_precision` field that specifies a decimal precision of edge weights, default value 1
|
||||
- In `way_function` the filed `forward_rate` and `backward_rate` of `ExtractionWay` can now be set.
|
||||
They have the same interpretation for the way weight as `forward_speed` and `backward_speed` for the edge duration.
|
||||
The unit of rate is meters per weight unit, so higher values will be prefered during routing.
|
||||
- `turn_function` now does not return an integer but takes in a `ExtractionTurn` object and can modify the `weight` and `duration` fields
|
||||
- `segment_function` now takes in a `ExtractionSegment` object and can modify `weight` and `duration` fields
|
||||
- `properties.uturn_penalty` is deprecated. Set it in the `turn_function`. The turn type is exposed as `ExtractionTurn::direction_modifier`.
|
||||
- `properties.traffic_light_penalty` is deprecated. Traffic light penalties now need to be set over in the turn function.
|
||||
Each turn with a traffic light is marked with `ExtractionTurn::has_traffic_light = true`.
|
||||
- Renamed the helper file `profiles/lib/directional.lua` to `profiles/lib/tags.lua` since it now provides more general tags parsing utility functions.
|
||||
- The car and foot profiles now depend on the helper file `profiles/lib/handlers.lua`.
|
||||
- Infrastructure
|
||||
- Disabled link-time optimized (LTO) builds by default. Enable by passing `-DENABLE_LTO=ON` to `cmake` if you need the performance and know what you are doing.
|
||||
- Datafile versioning is now based on OSRM semver values, rather than source code checksums.
|
||||
Datafiles are compatible between patch levels, but incompatible between minor version or higher bumps.
|
||||
- libOSRM now creates an own watcher thread then used in shared memory mode to listen for data updates
|
||||
- Tools:
|
||||
- Added osrm-extract-conditionals tool for checking conditional values in OSM data
|
||||
- Trip Plugin
|
||||
- Added a new feature that finds the optimal route given a list of waypoints, a source and a destination. This does not return a roundtrip and instead returns a one way optimal route from the fixed source to the destination points.
|
||||
|
||||
# 5.5.1
|
||||
- Changes from 5.5.0
|
||||
- API:
|
||||
- Adds `generate_hints=true` (`true` by default) which lets user disable `Hint` generating in the response. Use if you don't need `Hint`s!
|
||||
- Bugfixes
|
||||
- Fix #3418 and ensure we only return bearings in the range 0-359 in API responses
|
||||
- Fixed a bug that could lead to emitting false instructions for staying on a roundabout
|
||||
|
||||
# 5.5.0
|
||||
- Changes from 5.4.0
|
||||
- API:
|
||||
@@ -377,5 +465,3 @@
|
||||
- `properties.use_turn_restrictions`
|
||||
- `properties.u_turn_penalty`
|
||||
- `properties.allow_u_turn_at_via`
|
||||
|
||||
|
||||
|
||||
+177
-71
@@ -17,23 +17,26 @@ endif()
|
||||
option(ENABLE_MASON "Use mason for dependencies" OFF)
|
||||
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||
option(BUILD_COMPONENTS "Build osrm-components" OFF)
|
||||
option(BUILD_PACKAGE "Build OSRM package" OFF)
|
||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
||||
option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||
option(ENABLE_LTO "Use LTO if available" ON)
|
||||
option(ENABLE_LTO "Use LTO if available" OFF)
|
||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
if(ENABLE_MASON)
|
||||
# versions in use
|
||||
set(MASON_BOOST_VERSION "1.61.0")
|
||||
set(MASON_STXXL_VERSION "1.4.1")
|
||||
set(MASON_BOOST_VERSION "1.63.0")
|
||||
set(MASON_STXXL_VERSION "1.4.1-1")
|
||||
set(MASON_EXPAT_VERSION "2.2.0")
|
||||
set(MASON_LUA_VERSION "5.2.4")
|
||||
set(MASON_LUABIND_VERSION "e414c57bcb687bb3091b7c55bbff6947f052e46b")
|
||||
set(MASON_BZIP2_VERSION "1.0.6")
|
||||
set(MASON_TBB_VERSION "43_20150316")
|
||||
set(MASON_TBB_VERSION "2017_20161128")
|
||||
set(MASON_LIBSHP_VERSION "1.3.0")
|
||||
|
||||
message(STATUS "Enabling mason")
|
||||
|
||||
@@ -42,8 +45,7 @@ if(ENABLE_MASON)
|
||||
message(FATAL_ERROR "curl command required with -DENABLE_MASON")
|
||||
endif()
|
||||
|
||||
set(MASON_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/third_party/mason/mason.cmake)
|
||||
include(mason)
|
||||
endif()
|
||||
|
||||
# be compatible with version handling before cmake 3.x
|
||||
@@ -52,7 +54,7 @@ if (POLICY CMP0048)
|
||||
endif()
|
||||
project(OSRM C CXX)
|
||||
set(OSRM_VERSION_MAJOR 5)
|
||||
set(OSRM_VERSION_MINOR 5)
|
||||
set(OSRM_VERSION_MINOR 7)
|
||||
set(OSRM_VERSION_PATCH 0)
|
||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
|
||||
@@ -64,9 +66,11 @@ add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
# include_directories and add_definitions for both
|
||||
# this build and for sharing externally via pkg-config
|
||||
|
||||
function(add_dependency_includes includes)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${includes}")
|
||||
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
function(add_dependency_includes)
|
||||
if(${ARGC} GREATER 0)
|
||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${ARGV}")
|
||||
set(DEPENDENCIES_INCLUDE_DIRS "${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction(add_dependency_includes)
|
||||
|
||||
function(add_dependency_defines defines)
|
||||
@@ -77,8 +81,7 @@ endfunction(add_dependency_defines)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(bitness 32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
@@ -92,17 +95,22 @@ if(WIN32 AND MSVC_VERSION LESS 1900)
|
||||
message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)")
|
||||
endif()
|
||||
|
||||
# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14.
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
|
||||
message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
message(FATAL_ERROR "Clang>=3.4 required. In case you are on Ubuntu upgrade via http://apt.llvm.org")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/)
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/variant/include)
|
||||
|
||||
add_custom_target(FingerPrintConfigure ALL ${CMAKE_COMMAND}
|
||||
"-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FingerPrint-Config.cmake"
|
||||
COMMENT "Configuring revision fingerprint"
|
||||
VERBATIM)
|
||||
|
||||
set(BOOST_COMPONENTS date_time chrono filesystem iostreams program_options regex system thread unit_test_framework)
|
||||
|
||||
configure_file(
|
||||
@@ -111,28 +119,38 @@ configure_file(
|
||||
)
|
||||
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
|
||||
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
|
||||
file(GLOB PartitionerGlob src/partition/*.cpp)
|
||||
file(GLOB CustomizerGlob src/customize/*.cpp)
|
||||
file(GLOB ContractorGlob src/contractor/*.cpp)
|
||||
file(GLOB UpdaterGlob src/updater/*.cpp)
|
||||
file(GLOB StorageGlob src/storage/*.cpp)
|
||||
file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
|
||||
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
|
||||
|
||||
add_library(UTIL OBJECT ${UtilGlob})
|
||||
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
|
||||
add_library(PARTITIONER OBJECT ${PartitionerGlob})
|
||||
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
|
||||
add_library(CONTRACTOR OBJECT ${ContractorGlob})
|
||||
add_library(UPDATER OBJECT ${UpdaterGlob})
|
||||
add_library(STORAGE OBJECT ${StorageGlob})
|
||||
add_library(ENGINE OBJECT ${EngineGlob})
|
||||
add_library(SERVER OBJECT ${ServerGlob})
|
||||
|
||||
add_dependencies(UTIL FingerPrintConfigure)
|
||||
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
add_executable(osrm-extract src/tools/extract.cpp)
|
||||
add_executable(osrm-partition src/tools/partition.cpp)
|
||||
add_executable(osrm-customize src/tools/customize.cpp)
|
||||
add_executable(osrm-contract src/tools/contract.cpp)
|
||||
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:UTIL> $<TARGET_OBJECTS:STORAGE>)
|
||||
add_library(osrm_extract $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_contract $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_partition $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_customize $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:UTIL>)
|
||||
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:UTIL>)
|
||||
|
||||
if(ENABLE_GOLD_LINKER)
|
||||
@@ -155,6 +173,13 @@ if(ENABLE_GOLD_LINKER)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Disable LTO when mason+gcc is detected before testing for / setting any flags.
|
||||
# Mason builds libraries with Clang, mixing does not work in the context of lto.
|
||||
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND ENABLE_LTO)
|
||||
set(ENABLE_LTO OFF)
|
||||
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
|
||||
endif()
|
||||
|
||||
# Explicitly set the build type to Release if no other type is specified
|
||||
# on the command line. Without this, cmake defaults to an unoptimized,
|
||||
# non-debug build, which almost nobody wants.
|
||||
@@ -228,7 +253,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM
|
||||
find_program(GCC_AR gcc-ar)
|
||||
find_program(GCC_RANLIB gcc-ranlib)
|
||||
if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND")
|
||||
message(WARNING "GCC specific binutils not found.")
|
||||
message(WARNING "GCC specific binutils not found. In case of linker issues export env vars: AR=gcc-ar, NM=gcc-nm, RANLIB=gcc-ranlib")
|
||||
else()
|
||||
message(STATUS "Using GCC specific binutils for LTO:")
|
||||
message(STATUS " ${GCC_AR}")
|
||||
@@ -278,11 +303,13 @@ endif()
|
||||
if (ENABLE_SANITIZER)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} -fsanitize=address")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
# Configuring compilers
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024 -Wno-unused-command-line-argument")
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(COLOR_FLAG "-fdiagnostics-color=auto")
|
||||
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
|
||||
@@ -290,17 +317,26 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(COLOR_FLAG "")
|
||||
endif()
|
||||
# using GCC
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wuninitialized -Wunreachable-code -Wstrict-overflow=1 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024")
|
||||
if(WIN32) # using mingw
|
||||
add_dependency_defines(-DWIN32)
|
||||
set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)
|
||||
endif()
|
||||
|
||||
# -fpermissive is required for parallel_do Intel TBB internal issue with GCC < 5
|
||||
# https://github.com/Project-OSRM/osrm-backend/pull/3603#issuecomment-277688589
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||
message(STATUS "Adding -fpermissive for GCC version < 5 bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51048). See #3603.")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||
endif()
|
||||
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
||||
# using Intel C++
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} zlib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # avoid compiler error C1128 from scripting_environment_lua.cpp
|
||||
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
|
||||
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
|
||||
@@ -403,10 +439,6 @@ if(ENABLE_MASON)
|
||||
add_dependency_includes(${MASON_PACKAGE_lua_INCLUDE_DIRS})
|
||||
set(USED_LUA_LIBRARIES ${MASON_PACKAGE_lua_STATIC_LIBS})
|
||||
|
||||
mason_use(luabind_lua524 VERSION ${MASON_LUABIND_VERSION})
|
||||
add_dependency_includes(${MASON_PACKAGE_luabind_lua524_INCLUDE_DIRS})
|
||||
set(LUABIND_LIBRARY ${MASON_PACKAGE_luabind_lua524_STATIC_LIBS})
|
||||
|
||||
mason_use(bzip2 VERSION ${MASON_BZIP2_VERSION})
|
||||
add_dependency_includes(${MASON_PACKAGE_bzip2_INCLUDE_DIRS})
|
||||
set(BZIP2_LIBRARIES ${MASON_PACKAGE_bzip2_STATIC_LIBS})
|
||||
@@ -415,6 +447,10 @@ if(ENABLE_MASON)
|
||||
add_dependency_includes(${MASON_PACKAGE_tbb_INCLUDE_DIRS})
|
||||
set(TBB_LIBRARIES ${MASON_PACKAGE_tbb_LDFLAGS})
|
||||
|
||||
mason_use(libshp2 VERSION ${MASON_LIBSHP_VERSION})
|
||||
set(LIBSHAPEFILE_INCLUDE_DIR ${MASON_PACKAGE_libshp2_INCLUDE_DIRS})
|
||||
set(LIBSHAPEFILE_LIBRARY ${MASON_PACKAGE_libshp2_LDFLAGS})
|
||||
|
||||
if(NOT MASON_PACKAGE_tbb_LIBRARY_DIRS)
|
||||
message(FATAL_ERROR "MASON_PACKAGE_tbb_LIBRARY_DIRS is empty, rpath will not work")
|
||||
endif()
|
||||
@@ -434,10 +470,6 @@ if(ENABLE_MASON)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
message(FATAL_ERROR "BUILD_COMPONENTS is not supported with ENABLE_MASON")
|
||||
endif()
|
||||
|
||||
# current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||
|
||||
@@ -447,18 +479,17 @@ if(ENABLE_MASON)
|
||||
|
||||
else()
|
||||
|
||||
find_package(Boost 1.49.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
|
||||
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
|
||||
endif()
|
||||
|
||||
find_package(TBB REQUIRED)
|
||||
add_dependency_includes(${TBB_INCLUDE_DIR})
|
||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
||||
endif()
|
||||
find_package(Luabind REQUIRED)
|
||||
add_dependency_includes(${LUABIND_INCLUDE_DIR})
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARY})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
find_package(EXPAT REQUIRED)
|
||||
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
||||
@@ -469,9 +500,32 @@ else()
|
||||
find_package(BZip2 REQUIRED)
|
||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
find_package(GDAL)
|
||||
endif()
|
||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
# Now fall back to a lua verison without exact
|
||||
# in case this cmake version also forces patch versions
|
||||
FIND_PACKAGE(Lua 5.2)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
set(USED_LUA_LIBRARIES ${LUA_LIBRARIES})
|
||||
add_dependency_includes(${LUA_INCLUDE_DIR})
|
||||
|
||||
# add a target to generate API documentation with Doxygen
|
||||
find_package(Doxygen)
|
||||
@@ -486,7 +540,9 @@ else()
|
||||
|
||||
# note libosmium depends on expat and bzip2
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
|
||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||
if(NOT OSMIUM_INCLUDE_DIR)
|
||||
set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include")
|
||||
endif()
|
||||
find_package(Osmium REQUIRED COMPONENTS io)
|
||||
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
|
||||
|
||||
@@ -512,7 +568,6 @@ if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
|
||||
add_dependency_defines(-DBOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
@@ -547,6 +602,8 @@ set(BOOST_ENGINE_LIBRARIES
|
||||
# Binaries
|
||||
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
|
||||
|
||||
@@ -556,17 +613,34 @@ set(EXTRACTOR_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${EXPAT_LIBRARIES}
|
||||
${LUABIND_LIBRARY}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${OSMIUM_LIBRARIES}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
${ZLIB_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(PARTITIONER_LIBRARIES
|
||||
${BOOST_ENGINE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES}
|
||||
${ZLIB_LIBRARY})
|
||||
set(CUSTOMIZER_LIBRARIES
|
||||
${BOOST_ENGINE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(UPDATER_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${TBB_LIBRARIES}
|
||||
${MAYBE_RT_LIBRARY}
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
set(CONTRACTOR_LIBRARIES
|
||||
${BOOST_BASE_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${LUABIND_LIBRARY}
|
||||
${USED_LUA_LIBRARIES}
|
||||
${STXXL_LIBRARY}
|
||||
${TBB_LIBRARIES}
|
||||
@@ -593,37 +667,33 @@ set(UTIL_LIBRARIES
|
||||
${MAYBE_COVERAGE_LIBRARIES})
|
||||
# Libraries
|
||||
target_link_libraries(osrm ${ENGINE_LIBRARIES})
|
||||
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
|
||||
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update)
|
||||
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
|
||||
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
|
||||
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update)
|
||||
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
|
||||
|
||||
if(BUILD_COMPONENTS)
|
||||
if(GDAL_FOUND)
|
||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-components ${TBB_LIBRARIES})
|
||||
include_directories(SYSTEM ${GDAL_INCLUDE_DIR})
|
||||
target_link_libraries(osrm-components ${GDAL_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
||||
install(TARGETS osrm-components DESTINATION bin)
|
||||
else()
|
||||
message(WARNING "libgdal and/or development headers not found")
|
||||
endif()
|
||||
endif()
|
||||
# BUILD_COMPONENTS
|
||||
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES})
|
||||
install(TARGETS osrm-components DESTINATION bin)
|
||||
|
||||
if(BUILD_TOOLS)
|
||||
message(STATUS "Activating OSRM internal tools")
|
||||
add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES})
|
||||
add_executable(osrm-unlock-all src/tools/unlock_all_mutexes.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-unlock-all ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(osrm-unlock-all rt)
|
||||
endif()
|
||||
add_executable(osrm-springclean src/tools/springclean.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_link_libraries(osrm-springclean ${BOOST_BASE_LIBRARIES})
|
||||
|
||||
install(TARGETS osrm-io-benchmark DESTINATION bin)
|
||||
install(TARGETS osrm-unlock-all DESTINATION bin)
|
||||
install(TARGETS osrm-springclean DESTINATION bin)
|
||||
|
||||
find_package(Shapefile) # package libshp-dev
|
||||
if(SHAPEFILE_FOUND AND (Boost_VERSION VERSION_GREATER 106000 OR ENABLE_MASON))
|
||||
add_executable(osrm-extract-conditionals src/tools/extract-conditionals.cpp $<TARGET_OBJECTS:UTIL>)
|
||||
target_include_directories(osrm-extract-conditionals PRIVATE ${LIBSHAPEFILE_INCLUDE_DIR})
|
||||
target_link_libraries(osrm-extract-conditionals ${OSMIUM_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${LIBSHAPEFILE_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARY} ${EXPAT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
install(TARGETS osrm-extract-conditionals DESTINATION bin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_ASSERTIONS)
|
||||
@@ -635,6 +705,7 @@ endif()
|
||||
# (i.e., from /usr/local/bin/) the linker can find library dependencies. For
|
||||
# more info see http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-partition PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
@@ -645,30 +716,40 @@ file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
|
||||
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/phantom_node.hpp)
|
||||
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/strong_typedef.hpp include/util/exception.hpp)
|
||||
set(ExtractorHeader include/extractor/extractor.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
|
||||
set(PartitionerHeader include/partition/partitioner.hpp include/partition/partition_config.hpp)
|
||||
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
|
||||
set(StorageHeader include/storage/storage.hpp include/storage/storage_config.hpp)
|
||||
install(FILES ${EngineHeader} DESTINATION include/osrm/engine)
|
||||
install(FILES ${UtilHeader} DESTINATION include/osrm/util)
|
||||
install(FILES ${StorageHeader} DESTINATION include/osrm/storage)
|
||||
install(FILES ${ExtractorHeader} DESTINATION include/osrm/extractor)
|
||||
install(FILES ${PartitionerHeader} DESTINATION include/osrm/partition)
|
||||
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
|
||||
install(FILES ${LibraryGlob} DESTINATION include/osrm)
|
||||
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
|
||||
install(FILES ${VariantGlob} DESTINATION include/mapbox)
|
||||
install(TARGETS osrm-extract DESTINATION bin)
|
||||
install(TARGETS osrm-partition DESTINATION bin)
|
||||
install(TARGETS osrm-contract DESTINATION bin)
|
||||
install(TARGETS osrm-datastore DESTINATION bin)
|
||||
install(TARGETS osrm-routed DESTINATION bin)
|
||||
install(TARGETS osrm DESTINATION lib)
|
||||
install(TARGETS osrm_extract DESTINATION lib)
|
||||
install(TARGETS osrm_partition DESTINATION lib)
|
||||
install(TARGETS osrm_update DESTINATION lib)
|
||||
install(TARGETS osrm_contract DESTINATION lib)
|
||||
install(TARGETS osrm_store DESTINATION lib)
|
||||
|
||||
|
||||
# Install profiles and support library to /usr/local/share/osrm/profiles by default
|
||||
set(DefaultProfilesDir profiles)
|
||||
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
|
||||
|
||||
# Setup exporting variables for pkgconfig and subproject
|
||||
#
|
||||
|
||||
if(BUILD_DEBIAN_PACKAGE)
|
||||
include(CPackDebianConfig)
|
||||
if(BUILD_PACKAGE)
|
||||
include(CPackConfig)
|
||||
include(CPack)
|
||||
endif()
|
||||
|
||||
@@ -706,7 +787,7 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
|
||||
JOIN("${ENGINE_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
# uninstall target
|
||||
configure_file(
|
||||
@@ -722,6 +803,11 @@ add_custom_target(uninstall
|
||||
add_subdirectory(unit_tests)
|
||||
add_subdirectory(src/benchmarks)
|
||||
|
||||
if (ENABLE_NODE_BINDINGS)
|
||||
add_subdirectory(src/nodejs)
|
||||
endif()
|
||||
|
||||
|
||||
if (ENABLE_FUZZING)
|
||||
# Requires libosrm being built with sanitizers; make configurable and default to ubsan
|
||||
set(FUZZ_SANITIZER "undefined" CACHE STRING "Sanitizer to be used for Fuzz testing")
|
||||
@@ -735,3 +821,23 @@ if (ENABLE_FUZZING)
|
||||
|
||||
add_subdirectory(fuzz)
|
||||
endif ()
|
||||
|
||||
|
||||
# add headers sanity check target that includes all headers independently
|
||||
# make sure we have all deps for the nodejs sub project's includes (nan, node)
|
||||
if (ENABLE_NODE_BINDINGS)
|
||||
set(check_headers_dir "${PROJECT_BINARY_DIR}/check-headers")
|
||||
file(GLOB_RECURSE headers_to_check
|
||||
${PROJECT_BINARY_DIR}/*.hpp
|
||||
${PROJECT_SOURCE_DIR}/include/*.hpp)
|
||||
foreach(header ${headers_to_check})
|
||||
get_filename_component(filename ${header} NAME_WE)
|
||||
set(filename "${check_headers_dir}/${filename}.cpp")
|
||||
if (NOT EXISTS ${filename})
|
||||
file(WRITE ${filename} "#include \"${header}\"\n")
|
||||
endif()
|
||||
list(APPEND sources ${filename})
|
||||
endforeach()
|
||||
add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources})
|
||||
set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir})
|
||||
endif()
|
||||
|
||||
@@ -7,6 +7,28 @@ You can add a :+1: emoji to the issue if you want to express interest in this.
|
||||
# Developer
|
||||
|
||||
We use `clang-format` version `3.8` to consistently format the code base. There is a helper script under `scripts/format.sh`.
|
||||
The format is automatically checked by the `mason-linux-release` job of a Travis CI build.
|
||||
To save development time a local hook `.git/hooks/pre-push`
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
remote="$1"
|
||||
if [ x"$remote" = xorigin ] ; then
|
||||
if [ $(git rev-parse --abbrev-ref HEAD) = master ] ; then
|
||||
echo "Rejected push to $remote/master" ; exit 1
|
||||
fi
|
||||
|
||||
./scripts/format.sh
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "Unstaged format changes" ; exit 1
|
||||
fi
|
||||
fi
|
||||
```
|
||||
could check code format, modify a local repository and reject push due to unstaged formatting changes.
|
||||
Also `pre-push` hook rejects direct pushes to `origin/master`.
|
||||
|
||||
⚠️ `scripts/format.sh` checks all local files that match `*.cpp` or `*.hpp` patterns.
|
||||
|
||||
|
||||
In general changes that affect the API and/or increase the memory consumption need to be discussed first.
|
||||
Often we don't include changes that would increase the memory consumption a lot if they are not generally usable (e.g. elevation data is a good example).
|
||||
|
||||
@@ -1,64 +1,122 @@
|
||||
## About
|
||||
## Open Source Routing Machine
|
||||
|
||||
The Open Source Routing Machine is a high performance routing engine written in C++11 designed to run on OpenStreetMap data.
|
||||
| Linux / macOS | Windows | Code Coverage |
|
||||
| ------------- | ------- | ------------- |
|
||||
| [](https://travis-ci.org/Project-OSRM/osrm-backend) | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
|
||||
## Current build status
|
||||
High performance routing engine written in C++14 designed to run on OpenStreetMap data.
|
||||
|
||||
| build config | status |
|
||||
|:-------------|:-------|
|
||||
| Linux | [](https://travis-ci.org/Project-OSRM/osrm-backend) |
|
||||
| Windows | [](https://ci.appveyor.com/project/DennisOSRM/osrm-backend) |
|
||||
| Coverage | [](https://codecov.io/gh/Project-OSRM/osrm-backend) |
|
||||
The following services are available via HTTP API, C++ library interface and NodeJs wrapper:
|
||||
- Nearest - Snaps coordinates to the street network and returns the nearest matches
|
||||
- Route - Finds the fastest route between coordinates
|
||||
- Table - Computes the duration of the fastest route between all pairs of supplied coordinates
|
||||
- Match - Snaps noisy GPS traces to the road network in the most plausible way
|
||||
- Trip - Solves the Traveling Salesman Problem using a greedy heuristic
|
||||
- Tile - Generates Mapbox Vector Tiles with internal routing metadata
|
||||
|
||||
## Contact
|
||||
To quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.
|
||||
|
||||
- IRC: server `irc.oftc.net`, channel: `#osrm` (see: `https://www.oftc.net`, and for a webchat: `https://webchat.oftc.net`)
|
||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||
|
||||
## Building
|
||||
|
||||
For instructions on how to [build](https://github.com/Project-OSRM/osrm-backend/wiki/Building-OSRM) and [run OSRM](https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM), please consult [the Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||
|
||||
To quickly try OSRM use our [free and daily updated online service](http://map.project-osrm.org)
|
||||
Related [Project-OSRM](https://github.com/Project-OSRM) repositories:
|
||||
- [node-osrm](https://github.com/Project-OSRM/node-osrm) - Production-ready NodeJs bindings for the routing engine
|
||||
- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend
|
||||
- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response
|
||||
- [osrm-backend-docker](https://hub.docker.com/r/osrm/osrm-backend/) - Ready to use Docker images
|
||||
|
||||
## Documentation
|
||||
|
||||
### Full documentation
|
||||
|
||||
- [Hosted documentation](http://project-osrm.org)
|
||||
- [osrm-routed HTTP API documentation](docs/http.md)
|
||||
- [libosrm API documentation](docs/libosrm.md)
|
||||
|
||||
### Quick start
|
||||
## Contact
|
||||
|
||||
Building OSRM assuming all dependencies are installed:
|
||||
- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))
|
||||
- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`
|
||||
|
||||
## Quick Start
|
||||
|
||||
The easiest and quickest way to setup your own routing engine is to use Docker images we provide.
|
||||
|
||||
### Using Docker
|
||||
|
||||
We base our Docker images ([backend](https://hub.docker.com/r/osrm/osrm-backend/), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Alpine Linux and make sure they are as lightweight as possible.
|
||||
|
||||
Download OpenStreetMap extracts for example from [Geofabrik](http://download.geofabrik.de/)
|
||||
|
||||
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
||||
|
||||
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
|
||||
|
||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
|
||||
docker run -t -v $(pwd):/data osrm/osrm-backend osrm-contract /data/berlin-latest.osrm
|
||||
|
||||
docker run -t -i -p 5000:5000 -v $(pwd):/data osrm/osrm-backend osrm-routed /data/berlin-latest.osrm
|
||||
|
||||
Make requests against the HTTP server
|
||||
|
||||
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
|
||||
|
||||
Optionally start a user-friendly frontend on port 9966, and open it up in your browser
|
||||
|
||||
docker run -p 9966:9966 osrm/osrm-frontend
|
||||
xdg-open 'http://127.0.0.1:9966'
|
||||
|
||||
In case Docker complains about not being able to connect to the Docker daemon make sure you are in the `docker` group.
|
||||
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
After adding yourself to the `docker` group make sure to log out and back in again with your terminal.
|
||||
|
||||
|
||||
### Building from Source
|
||||
|
||||
The following targets Ubuntu 16.04.
|
||||
For instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).
|
||||
|
||||
Install dependencies
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential git cmake pkg-config \
|
||||
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
|
||||
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
|
||||
```
|
||||
|
||||
Compile and install OSRM binaries
|
||||
|
||||
```bash
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
cmake ..
|
||||
cmake --build .
|
||||
sudo cmake --build . --target install
|
||||
```
|
||||
|
||||
Loading preparing a dataset and starting the server:
|
||||
Grab a `.osm.pbf` extract from [Geofabrik](http://download.geofabrik.de/index.html) or [Mapzen's Metro Extracts](https://mapzen.com/data/metro-extracts/)
|
||||
|
||||
```
|
||||
osrm-extract data.osm.pbf -p profiles/car.lua
|
||||
osrm-contract data.osrm
|
||||
osrm-routed data.osrm
|
||||
```bash
|
||||
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
|
||||
```
|
||||
|
||||
Running a query on your local server:
|
||||
Pre-process the extract and start the HTTP server
|
||||
|
||||
```
|
||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
|
||||
osrm-contract berlin-latest.osrm
|
||||
osrm-routed berlin-latest.osrm
|
||||
```
|
||||
|
||||
### Running a request against the Demo Server
|
||||
Running Queries
|
||||
|
||||
First read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||
```
|
||||
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true
|
||||
```
|
||||
|
||||
Then run simple query with instructions and alternatives on Berlin:
|
||||
### Request Against the Demo Server
|
||||
|
||||
Read the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Api-usage-policy).
|
||||
Simple query with instructions and alternatives on Berlin:
|
||||
|
||||
```
|
||||
curl https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true&alternatives=true
|
||||
@@ -86,4 +144,3 @@ When using the code in a (scientific) publication, please cite
|
||||
address = {New York, NY, USA},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
+31
-2
@@ -10,10 +10,10 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
||||
ECHO cmake^: && cmake --version
|
||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||
|
||||
cmake --version | findstr /C:"3.7.0" && GOTO CMAKE_OK
|
||||
cmake --version | findstr /C:"3.7.1" && GOTO CMAKE_OK
|
||||
|
||||
:CMAKE_NOT_OK
|
||||
SET CMAKE_VERSION=3.7.0-rc2
|
||||
SET CMAKE_VERSION=3.7.1
|
||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||
IF NOT EXIST cm.zip powershell Invoke-WebRequest https://cmake.org/files/v3.7/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
@@ -119,16 +119,45 @@ SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
||||
ECHO running extractor-tests.exe ...
|
||||
unit_tests\%Configuration%\extractor-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running engine-tests.exe ...
|
||||
unit_tests\%Configuration%\engine-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running util-tests.exe ...
|
||||
unit_tests\%Configuration%\util-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running server-tests.exe ...
|
||||
unit_tests\%Configuration%\server-tests.exe
|
||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||
|
||||
ECHO running library-tests.exe ...
|
||||
SET test_region=monaco
|
||||
SET test_region_ch=ch\monaco
|
||||
SET test_region_corech=corech\monaco
|
||||
SET test_region_mld=mld\monaco
|
||||
SET test_osm=%test_region%.osm.pbf
|
||||
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
|
||||
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||
MKDIR ch
|
||||
XCOPY %test_region%.osrm.* ch\
|
||||
XCOPY %test_region%.osrm ch\
|
||||
MKDIR corech
|
||||
XCOPY %test_region%.osrm.* corech\
|
||||
XCOPY %test_region%.osrm corech\
|
||||
MKDIR mld
|
||||
XCOPY %test_region%.osrm.* mld\
|
||||
XCOPY %test_region%.osrm mld\
|
||||
%Configuration%\osrm-contract.exe %test_region_ch%.osrm
|
||||
%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
|
||||
%Configuration%\osrm-partition.exe %test_region_mld%.osrm
|
||||
%Configuration%\osrm-customize.exe %test_region_mld%.osrm
|
||||
XCOPY /Y ch\*.* ..\test\data\ch\
|
||||
XCOPY /Y corech\*.* ..\test\data\corech\
|
||||
XCOPY /Y mld\*.* ..\test\data\mld\
|
||||
unit_tests\%Configuration%\library-tests.exe
|
||||
|
||||
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
|
||||
ECHO ========= CREATING PACKAGES ==========
|
||||
|
||||
|
||||
+11
-1
@@ -3,6 +3,9 @@ environment:
|
||||
- configuration: Release
|
||||
# - configuration: Debug
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 6
|
||||
|
||||
# scripts that are called at very beginning, before repo cloning
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
@@ -17,7 +20,14 @@ platform: x64
|
||||
build_script:
|
||||
- CALL appveyor-build.bat
|
||||
|
||||
test: off
|
||||
before_test:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm install --ignore-scripts
|
||||
- npm link --ignore-scripts
|
||||
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
|
||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||
- npm test
|
||||
|
||||
artifacts:
|
||||
- path: osrm_Release.zip
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Description": "mason bucket resources",
|
||||
"Description": "user for publishing to s3://mapbox-node-binary/osrm",
|
||||
"Resources": {
|
||||
"BuildUser": {
|
||||
"User": {
|
||||
"Type": "AWS::IAM::User",
|
||||
"Properties": {
|
||||
"Policies": [
|
||||
@@ -15,15 +15,20 @@
|
||||
"s3:ListBucket"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::mason-binaries"
|
||||
]
|
||||
"Resource": "arn:aws:s3:::mapbox-node-binary",
|
||||
"Condition": {
|
||||
"StringLike": {
|
||||
"s3:prefix": [
|
||||
"osrm/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"PolicyName": "build",
|
||||
"PolicyName": "publish",
|
||||
"PolicyDocument": {
|
||||
"Statement": [
|
||||
{
|
||||
@@ -35,9 +40,7 @@
|
||||
"s3:PutObjectAcl"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::mason-binaries/*"
|
||||
]
|
||||
"Resource": "arn:aws:s3:::mapbox-node-binary/osrm/*"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -45,11 +48,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"BuildUserKey": {
|
||||
"AccessKey": {
|
||||
"Type": "AWS::IAM::AccessKey",
|
||||
"Properties": {
|
||||
"UserName": {
|
||||
"Ref": "BuildUser"
|
||||
"Ref": "User"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,17 +60,16 @@
|
||||
"Outputs": {
|
||||
"AccessKeyId": {
|
||||
"Value": {
|
||||
"Ref": "BuildUserKey"
|
||||
"Ref": "AccessKey"
|
||||
}
|
||||
},
|
||||
"SecretAccessKey": {
|
||||
"Value": {
|
||||
"Fn::GetAtt": [
|
||||
"BuildUserKey",
|
||||
"AccessKey",
|
||||
"SecretAccessKey"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
var cf = require('@mapbox/cloudfriend');
|
||||
var package_json = require('../package.json')
|
||||
|
||||
module.exports = {
|
||||
AWSTemplateFormatVersion: '2010-09-09',
|
||||
Description: 'user for publishing to s3://mapbox-node-binary/' + package_json.name,
|
||||
Resources: {
|
||||
User: {
|
||||
Type: 'AWS::IAM::User',
|
||||
Properties: {
|
||||
Policies: [
|
||||
{
|
||||
PolicyName: 'list',
|
||||
PolicyDocument: {
|
||||
Statement: [
|
||||
{
|
||||
Action: ['s3:ListBucket'],
|
||||
Effect: 'Allow',
|
||||
Resource: 'arn:aws:s3:::mapbox-node-binary',
|
||||
Condition : {
|
||||
StringLike : {
|
||||
"s3:prefix": [ package_json.name + "/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
PolicyName: 'publish',
|
||||
PolicyDocument: {
|
||||
Statement: [
|
||||
{
|
||||
Action: ['s3:DeleteObject', 's3:GetObject', 's3:GetObjectAcl', 's3:PutObject', 's3:PutObjectAcl'],
|
||||
Effect: 'Allow',
|
||||
Resource: 'arn:aws:s3:::mapbox-node-binary/' + package_json.name + '/*'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
AccessKey: {
|
||||
Type: 'AWS::IAM::AccessKey',
|
||||
Properties: {
|
||||
UserName: cf.ref('User')
|
||||
}
|
||||
}
|
||||
},
|
||||
Outputs: {
|
||||
AccessKeyId: {
|
||||
Value: cf.ref('AccessKey')
|
||||
},
|
||||
SecretAccessKey: {
|
||||
Value: cf.getAtt('AccessKey', 'SecretAccessKey')
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian/RPM packages on non-linux systems.")
|
||||
ENDIF()
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" CPACK_PACKAGE_NAME)
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${OSRM_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${OSRM_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${OSRM_VERSION_PATCH})
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
|
||||
SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||
|
||||
SET(CPACK_STRIP_FILES "TRUE")
|
||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${CPACK_PACKAGE_NAME}/profiles")
|
||||
|
||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||
if(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
execute_process(
|
||||
COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
|
||||
else(DPKG_PROGRAM)
|
||||
find_program(RPM_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||
find_program(RPMBUILD_PROGRAM rpm DOC "rpm RPM-based systems")
|
||||
if(RPMBUILD_PROGRAM)
|
||||
SET(CPACK_GENERATOR "RPM")
|
||||
execute_process(
|
||||
COMMAND ${RPM_PROGRAM} --eval %{_arch}
|
||||
OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
||||
# Exclude /usr/lib64/pkgconfig directory given that it is already owned by the pkg-config rpm package.
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
endif(RPMBUILD_PROGRAM)
|
||||
endif(DPKG_PROGRAM)
|
||||
@@ -1,41 +0,0 @@
|
||||
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
MESSAGE(FATAL_ERROR "Cannot configure CPack to generate Debian packages on non-linux systems.")
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindDebArch)
|
||||
|
||||
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CPACK_RESOURCE_FILE_README}")
|
||||
SET(CPACK_PACKAGE_UPSTREAM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||
SET(CPACK_PACKAGE_DEBIAN_REVISION "1")
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_UPSTREAM_VERSION}-${CPACK_PACKAGE_DEBIAN_REVISION}")
|
||||
|
||||
string(TOLOWER "${CMAKE_PROJECT_NAME}" LOWER_PROJECT_NAME)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${LOWER_PROJECT_NAME}_${CPACK_PACKAGE_UPSTREAM_VERSION}_orig")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM).")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a routing engine.")
|
||||
|
||||
# To create a proper Debian/Ubuntu package, the following CMake
|
||||
# options should be used:
|
||||
|
||||
SET(CPACK_STRIP_FILES "TRUE")
|
||||
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
|
||||
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${VERSION_SUFFIX}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Dennis Luxen <info@project-osrm.org>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
|
||||
It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
|
||||
)
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")
|
||||
|
||||
file(GLOB_RECURSE ProfileGlob ${CMAKE_SOURCE_DIR}/profiles/*)
|
||||
install(FILES ${ProfileGlob} DESTINATION "share/doc/${LOWER_PROJECT_NAME}/profiles")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/copyright;")
|
||||
|
||||
MESSAGE(STATUS "Debian Package: ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_VERSION}) [${CPACK_PACKAGE_FILE_NAME}.deb]")
|
||||
+7
-1
@@ -172,12 +172,18 @@ if (LUA_LIBRARY)
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(LUA_MATH_LIBRARY m)
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||
|
||||
# include dl library for statically-linked Lua library
|
||||
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# For Windows and Mac, don't need to explicitly include the math library
|
||||
else ()
|
||||
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# Locate Luabind library
|
||||
# This module defines
|
||||
# LUABIND_FOUND, if false, do not try to link to Luabind
|
||||
# LUABIND_LIBRARIES
|
||||
# LUABIND_INCLUDE_DIR, where to find luabind.hpp
|
||||
|
||||
# First we try using EXACT but in some verison of
|
||||
# cmake this would also match patch versions
|
||||
FIND_PACKAGE(Lua 5.2 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1 EXACT)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
# Now fall back to a lua verison without exact
|
||||
# in case this cmake version also forces patch versions
|
||||
FIND_PACKAGE(Lua 5.2)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
FIND_PACKAGE(Lua 5.1)
|
||||
IF (LUA_FOUND)
|
||||
MESSAGE(STATUS "Using Lua ${LUA_VERSION_STRING}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Lua 5.1 or 5.2 was not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES luabind include/luabind include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local # DarwinPorts
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY
|
||||
NAMES luabind luabind09
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LUABIND_LIBRARY_DBG
|
||||
NAMES luabindd
|
||||
HINTS
|
||||
$ENV{LUABIND_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt/local
|
||||
/opt
|
||||
)
|
||||
|
||||
IF(LUABIND_LIBRARY)
|
||||
SET( LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
|
||||
ENDIF(LUABIND_LIBRARY)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind DEFAULT_MSG LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
|
||||
|
||||
IF( NOT LUABIND_FIND_QUIETLY )
|
||||
IF( LUABIND_FOUND )
|
||||
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}" )
|
||||
ENDIF()
|
||||
IF( LUABIND_LIBRARY_DBG )
|
||||
MESSAGE(STATUS "Luabind debug library availible: ${LUABIND_LIBRARY_DBG}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY LUABIND_LIBRARY_DBG)
|
||||
@@ -0,0 +1,21 @@
|
||||
# - Try to find Shapefile C Library
|
||||
# http://shapelib.maptools.org/
|
||||
#
|
||||
# Exports:
|
||||
# Shapefile_FOUND
|
||||
# LIBSHAPEFILE_INCLUDE_DIR
|
||||
# LIBSHAPEFILE_LIBRARY
|
||||
# Hints:
|
||||
# LIBSHAPEFILE_LIBRARY_DIR
|
||||
|
||||
find_path(LIBSHAPEFILE_INCLUDE_DIR
|
||||
shapefil.h)
|
||||
|
||||
find_library(LIBSHAPEFILE_LIBRARY
|
||||
NAMES shp
|
||||
HINTS "${LIBSHAPEFILE_LIBRARY_DIR}")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Shapefile DEFAULT_MSG
|
||||
LIBSHAPEFILE_LIBRARY LIBSHAPEFILE_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBSHAPEFILE_INCLUDE_DIR LIBSHAPEFILE_LIBRARY)
|
||||
+13
-11
@@ -57,7 +57,7 @@
|
||||
if (WIN32)
|
||||
# has em64t/vc8 em64t/vc9
|
||||
# has ia32/vc7.1 ia32/vc8 ia32/vc9
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
@@ -102,7 +102,7 @@ if (UNIX)
|
||||
endif(NOT TBB_ARCHITECTURE)
|
||||
else (APPLE)
|
||||
# LINUX
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
|
||||
set(_TBB_DEFAULT_INSTALL_DIR "/usr")
|
||||
set(_TBB_LIB_NAME "tbb")
|
||||
set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
|
||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
|
||||
@@ -185,15 +185,14 @@ set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
|
||||
# containing the headers.
|
||||
find_path(TBB_INCLUDE_DIR
|
||||
tbb/task_scheduler_init.h
|
||||
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
||||
HINTS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
||||
)
|
||||
mark_as_advanced(TBB_INCLUDE_DIR)
|
||||
|
||||
|
||||
#-- Look for libraries
|
||||
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
|
||||
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
||||
set (_TBB_LIBRARY_DIR
|
||||
set (_TBB_LIBRARY_DIR
|
||||
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
|
||||
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
|
||||
)
|
||||
@@ -213,6 +212,11 @@ endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "
|
||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
||||
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
||||
|
||||
if(EXISTS ${_TBB_INSTALL_DIR}/build)
|
||||
file(GLOB _TBB_BUILD_DIR_RELEASE ${_TBB_INSTALL_DIR}/build/*_release)
|
||||
file(GLOB _TBB_BUILD_DIR_DEBUG ${_TBB_INSTALL_DIR}/build/*_debug)
|
||||
endif()
|
||||
|
||||
# Jiri: No reason not to check the default paths. From recent versions,
|
||||
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
|
||||
# variables, which now point to the directories of the lib files.
|
||||
@@ -222,10 +226,8 @@ list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
||||
# and LD_LIBRARY_PATH environment variables is now even more important
|
||||
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
|
||||
# the use of TBB built from sources.
|
||||
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_BUILD_DIR_RELEASE} ${_TBB_LIBRARY_DIR})
|
||||
find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_BUILD_DIR_RELEASE} ${_TBB_LIBRARY_DIR})
|
||||
|
||||
#Extract path from TBB_LIBRARY name
|
||||
get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
|
||||
@@ -236,9 +238,9 @@ mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
|
||||
|
||||
#-- Look for debug libraries
|
||||
# Jiri: Changed the same way as for the release libraries.
|
||||
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_BUILD_DIR_DEBUG} ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
||||
find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_BUILD_DIR_DEBUG} ${_TBB_LIBRARY_DIR}
|
||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
||||
|
||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
set(OLDFILE ${OUTPUT_DIR}/include/util/fingerprint_impl.hpp)
|
||||
set(NEWFILE ${OLDFILE}.tmp)
|
||||
set(INFILE ${SOURCE_DIR}/include/util/fingerprint_impl.hpp.in)
|
||||
file(MD5 ${SOURCE_DIR}/src/tools/contract.cpp MD5PREPARE)
|
||||
file(MD5 ${SOURCE_DIR}/include/util/static_rtree.hpp MD5RTREE)
|
||||
file(MD5 ${SOURCE_DIR}/include/util/graph_loader.hpp MD5GRAPH)
|
||||
file(MD5 ${SOURCE_DIR}/src/storage/storage.cpp MD5OBJECTS)
|
||||
|
||||
CONFIGURE_FILE(${INFILE} ${NEWFILE})
|
||||
|
||||
file(MD5 ${NEWFILE} MD5NEW)
|
||||
|
||||
if (EXISTS ${OLDFILE})
|
||||
file(MD5 ${OLDFILE} MD5OLD)
|
||||
if(NOT ${MD5NEW} STREQUAL ${MD5OLD})
|
||||
file(REMOVE_RECURSE ${OLDFILE})
|
||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||
else()
|
||||
file(REMOVE_RECURSE ${NEWFILE})
|
||||
message(STATUS "Fingerprint unchanged, not regenerating")
|
||||
endif()
|
||||
else()
|
||||
file(RENAME ${NEWFILE} ${OLDFILE})
|
||||
endif()
|
||||
@@ -0,0 +1,627 @@
|
||||
# Vendored NodeJs.cmake to bootstrap our C++ build without
|
||||
# having the user to install Node modules via `npm install`.
|
||||
#
|
||||
# Update via: ../node_modules/.bin/ncmake update
|
||||
|
||||
|
||||
# Defaults for standard Node.js builds
|
||||
set(NODEJS_DEFAULT_URL https://nodejs.org/download/release)
|
||||
set(NODEJS_DEFAULT_VERSION installed)
|
||||
set(NODEJS_VERSION_FALLBACK latest)
|
||||
set(NODEJS_DEFAULT_NAME node)
|
||||
set(NODEJS_DEFAULT_CHECKSUM SHASUMS256.txt)
|
||||
set(NODEJS_DEFAULT_CHECKTYPE SHA256)
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
# Find a path by walking upward from a base directory until the path is
|
||||
# found. Sets the variable ${PATH} to False if the path can't
|
||||
# be determined
|
||||
function(find_path_parent NAME BASE PATH)
|
||||
set(ROOT ${BASE})
|
||||
set(${PATH} ${ROOT}/${NAME} PARENT_SCOPE)
|
||||
set(DRIVE "^[A-Za-z]?:?/$")
|
||||
while(NOT ROOT MATCHES ${DRIVE} AND NOT EXISTS ${ROOT}/${NAME})
|
||||
get_filename_component(ROOT ${ROOT} DIRECTORY)
|
||||
set(${PATH} ${ROOT}/${NAME} PARENT_SCOPE)
|
||||
endwhile()
|
||||
if(ROOT MATCHES ${DRIVE})
|
||||
set(${PATH} False PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Shortcut for finding standard node module locations
|
||||
macro(find_nodejs_module NAME BASE PATH)
|
||||
find_path_parent(node_modules/${NAME} ${BASE} ${PATH})
|
||||
endmacro()
|
||||
|
||||
# Download with a bit of nice output (without spewing progress)
|
||||
function(download_file URL)
|
||||
message(STATUS "Downloading: ${URL}")
|
||||
file(DOWNLOAD
|
||||
${URL}
|
||||
${ARGN}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# Embedded win_delay_load_hook file so that this file can be copied
|
||||
# into projects directly (recommended practice)
|
||||
function(nodejs_generate_delayload_hook OUTPUT)
|
||||
file(WRITE ${OUTPUT} "")
|
||||
file(APPEND ${OUTPUT} "/*\n")
|
||||
file(APPEND ${OUTPUT} " * When this file is linked to a DLL, it sets up a delay-load hook that\n")
|
||||
file(APPEND ${OUTPUT} " * intervenes when the DLL is trying to load 'node.exe' or 'iojs.exe'\n")
|
||||
file(APPEND ${OUTPUT} " * dynamically. Instead of trying to locate the .exe file it'll just return\n")
|
||||
file(APPEND ${OUTPUT} " * a handle to the process image.\n")
|
||||
file(APPEND ${OUTPUT} " *\n")
|
||||
file(APPEND ${OUTPUT} " * This allows compiled addons to work when node.exe or iojs.exe is renamed.\n")
|
||||
file(APPEND ${OUTPUT} " */\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "#ifdef _MSC_VER\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "#ifndef DELAYIMP_INSECURE_WRITABLE_HOOKS\n")
|
||||
file(APPEND ${OUTPUT} "#define DELAYIMP_INSECURE_WRITABLE_HOOKS\n")
|
||||
file(APPEND ${OUTPUT} "#endif\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "#ifndef WIN32_LEAN_AND_MEAN\n")
|
||||
file(APPEND ${OUTPUT} "#define WIN32_LEAN_AND_MEAN\n")
|
||||
file(APPEND ${OUTPUT} "#endif\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "#include <windows.h>\n")
|
||||
file(APPEND ${OUTPUT} "#include <Shlwapi.h>\n")
|
||||
file(APPEND ${OUTPUT} "#include <delayimp.h>\n")
|
||||
file(APPEND ${OUTPUT} "#include <string.h>\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) {\n")
|
||||
file(APPEND ${OUTPUT} " if (event != dliNotePreLoadLibrary) return NULL;\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " if (_stricmp(info->szDll, \"iojs.exe\") != 0 &&\n")
|
||||
file(APPEND ${OUTPUT} " _stricmp(info->szDll, \"node.exe\") != 0 &&\n")
|
||||
file(APPEND ${OUTPUT} " _stricmp(info->szDll, \"node.dll\") != 0)\n")
|
||||
file(APPEND ${OUTPUT} " return NULL;\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " // Get a handle to the current process executable.\n")
|
||||
file(APPEND ${OUTPUT} " HMODULE processModule = GetModuleHandle(NULL);\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " // Get the path to the executable.\n")
|
||||
file(APPEND ${OUTPUT} " TCHAR processPath[_MAX_PATH];\n")
|
||||
file(APPEND ${OUTPUT} " GetModuleFileName(processModule, processPath, _MAX_PATH);\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " // Get the name of the current executable.\n")
|
||||
file(APPEND ${OUTPUT} " LPSTR processName = PathFindFileName(processPath);\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " // If the current process is node or iojs, then just return the proccess \n")
|
||||
file(APPEND ${OUTPUT} " // module.\n")
|
||||
file(APPEND ${OUTPUT} " if (_stricmp(processName, \"node.exe\") == 0 ||\n")
|
||||
file(APPEND ${OUTPUT} " _stricmp(processName, \"iojs.exe\") == 0) {\n")
|
||||
file(APPEND ${OUTPUT} " return (FARPROC) processModule;\n")
|
||||
file(APPEND ${OUTPUT} " }\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " // If it is another process, attempt to load 'node.dll' from the same \n")
|
||||
file(APPEND ${OUTPUT} " // directory.\n")
|
||||
file(APPEND ${OUTPUT} " PathRemoveFileSpec(processPath);\n")
|
||||
file(APPEND ${OUTPUT} " PathAppend(processPath, \"node.dll\");\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " HMODULE nodeDllModule = GetModuleHandle(processPath);\n")
|
||||
file(APPEND ${OUTPUT} " if(nodeDllModule != NULL) {\n")
|
||||
file(APPEND ${OUTPUT} " // This application has a node.dll in the same directory as the executable,\n")
|
||||
file(APPEND ${OUTPUT} " // use that.\n")
|
||||
file(APPEND ${OUTPUT} " return (FARPROC) nodeDllModule;\n")
|
||||
file(APPEND ${OUTPUT} " }\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} " // Fallback to the current executable, which must statically link to \n")
|
||||
file(APPEND ${OUTPUT} " // node.lib\n")
|
||||
file(APPEND ${OUTPUT} " return (FARPROC) processModule;\n")
|
||||
file(APPEND ${OUTPUT} "}\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;\n")
|
||||
file(APPEND ${OUTPUT} "\n")
|
||||
file(APPEND ${OUTPUT} "#endif\n")
|
||||
endfunction()
|
||||
|
||||
# Sets up a project to build Node.js native modules
|
||||
# - Downloads required dependencies and unpacks them to the build directory.
|
||||
# Internet access is required the first invocation but not after (
|
||||
# provided the download is successful)
|
||||
# - Sets up several variables for building against the downloaded
|
||||
# dependencies
|
||||
# - Guarded to prevent multiple executions, so a single project hierarchy
|
||||
# will only call this once
|
||||
function(nodejs_init)
|
||||
# Prevents this function from executing more than once
|
||||
if(NODEJS_INIT)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Regex patterns used by the init function for component extraction
|
||||
set(HEADERS_MATCH "^([A-Fa-f0-9]+)[ \t]+([^-]+)-(headers|v?[0-9.]+)-(headers|v?[0-9.]+)([.]tar[.]gz)$")
|
||||
set(LIB32_MATCH "(^[0-9A-Fa-f]+)[\t ]+(win-x86)?(/)?([^/]*)(.lib)$")
|
||||
set(LIB64_MATCH "(^[0-9A-Fa-f]+)[\t ]+(win-)?(x64/)(.*)(.lib)$")
|
||||
|
||||
# Parse function arguments
|
||||
cmake_parse_arguments(nodejs_init
|
||||
"" "URL;NAME;VERSION;CHECKSUM;CHECKTYPE" "" ${ARGN}
|
||||
)
|
||||
|
||||
# Allow the download URL to be overridden by command line argument
|
||||
# NODEJS_URL
|
||||
if(NODEJS_URL)
|
||||
set(URL ${NODEJS_URL})
|
||||
else()
|
||||
# Use the argument if specified, falling back to the default
|
||||
set(URL ${NODEJS_DEFAULT_URL})
|
||||
if(nodejs_init_URL)
|
||||
set(URL ${nodejs_init_URL})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Allow name to be overridden by command line argument NODEJS_NAME
|
||||
if(NODEJS_NAME)
|
||||
set(NAME ${NODEJS_NAME})
|
||||
else()
|
||||
# Use the argument if specified, falling back to the default
|
||||
set(NAME ${NODEJS_DEFAULT_NAME})
|
||||
if(nodejs_init_NAME)
|
||||
set(NAME ${nodejs_init_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Allow the checksum file to be overridden by command line argument
|
||||
# NODEJS_CHECKSUM
|
||||
if(NODEJS_CHECKSUM)
|
||||
set(CHECKSUM ${NODEJS_CHECKSUM})
|
||||
else()
|
||||
# Use the argument if specified, falling back to the default
|
||||
set(CHECKSUM ${NODEJS_DEFAULT_CHECKSUM})
|
||||
if(nodejs_init_CHECKSUM)
|
||||
set(CHECKSUM ${nodejs_init_CHECKSUM})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Allow the checksum type to be overriden by the command line argument
|
||||
# NODEJS_CHECKTYPE
|
||||
if(NODEJS_CHECKTYPE)
|
||||
set(CHECKTYPE ${NODEJS_CHECKTYPE})
|
||||
else()
|
||||
# Use the argument if specified, falling back to the default
|
||||
set(CHECKTYPE ${NODEJS_DEFAULT_CHECKTYPE})
|
||||
if(nodejs_init_CHECKTYPE)
|
||||
set(CHECKTYPE ${nodejs_init_CHECKTYPE})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Allow the version to be overridden by the command line argument
|
||||
# NODEJS_VERSION
|
||||
if(NODEJS_VERSION)
|
||||
set(VERSION ${NODEJS_VERSION})
|
||||
else()
|
||||
# Use the argument if specified, falling back to the default
|
||||
set(VERSION ${NODEJS_DEFAULT_VERSION})
|
||||
if(nodejs_init_VERSION)
|
||||
set(VERSION ${nodejs_init_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# "installed" is a special version that tries to use the currently
|
||||
# installed version (determined by running node)
|
||||
set(NODEJS_INSTALLED False CACHE BOOL "Node.js install status" FORCE)
|
||||
if(VERSION STREQUAL "installed")
|
||||
if(NOT NAME STREQUAL ${NODEJS_DEFAULT_NAME})
|
||||
message(FATAL_ERROR
|
||||
"'Installed' version identifier can only be used with"
|
||||
"the core Node.js library"
|
||||
)
|
||||
endif()
|
||||
# Fall back to the "latest" version if node isn't installed
|
||||
set(VERSION ${NODEJS_VERSION_FALLBACK})
|
||||
find_program(NODEJS_BINARY NAMES node nodejs)
|
||||
if(NODEJS_BINARY)
|
||||
execute_process(
|
||||
COMMAND ${NODEJS_BINARY} --version
|
||||
RESULT_VARIABLE INSTALLED_VERSION_RESULT
|
||||
OUTPUT_VARIABLE INSTALLED_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(INSTALLED_VERSION_RESULT STREQUAL "0")
|
||||
set(NODEJS_INSTALLED True CACHE BOOL
|
||||
"Node.js install status" FORCE
|
||||
)
|
||||
set(VERSION ${INSTALLED_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Create a temporary download directory
|
||||
set(TEMP ${CMAKE_CURRENT_BINARY_DIR}/temp)
|
||||
if(EXISTS ${TEMP})
|
||||
file(REMOVE_RECURSE ${TEMP})
|
||||
endif()
|
||||
file(MAKE_DIRECTORY ${TEMP})
|
||||
|
||||
# Unless the target is special version "latest", the parameters
|
||||
# necessary to construct the root path are known
|
||||
if(NOT VERSION STREQUAL "latest")
|
||||
set(ROOT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}/${VERSION})
|
||||
# Extract checksums from the existing checksum file
|
||||
set(CHECKSUM_TARGET ${ROOT}/CHECKSUM)
|
||||
endif()
|
||||
|
||||
# If we're trying to determine the version or we haven't saved the
|
||||
# checksum file for this version, download it from the specified server
|
||||
if(VERSION STREQUAL "latest" OR
|
||||
(DEFINED ROOT AND NOT EXISTS ${ROOT}/CHECKSUM))
|
||||
if(DEFINED ROOT)
|
||||
# Clear away the old checksum in case the new one is different
|
||||
# and/or it fails to download
|
||||
file(REMOVE ${ROOT}/CHECKSUM)
|
||||
endif()
|
||||
file(REMOVE ${TEMP}/CHECKSUM)
|
||||
download_file(
|
||||
${URL}/${VERSION}/${CHECKSUM}
|
||||
${TEMP}/CHECKSUM
|
||||
INACTIVITY_TIMEOUT 10
|
||||
STATUS CHECKSUM_STATUS
|
||||
)
|
||||
list(GET CHECKSUM_STATUS 0 CHECKSUM_STATUS)
|
||||
if(CHECKSUM_STATUS GREATER 0)
|
||||
file(REMOVE ${TEMP}/CHECKSUM)
|
||||
message(FATAL_ERROR
|
||||
"Unable to download checksum file"
|
||||
)
|
||||
endif()
|
||||
# Extract checksums from the temporary file
|
||||
set(CHECKSUM_TARGET ${TEMP}/CHECKSUM)
|
||||
endif()
|
||||
|
||||
# Extract the version, name, header archive and archive checksum
|
||||
# from the file. This first extract is what defines / specifies the
|
||||
# actual version number and name.
|
||||
file(STRINGS
|
||||
${CHECKSUM_TARGET} HEADERS_CHECKSUM
|
||||
REGEX ${HEADERS_MATCH}
|
||||
LIMIT_COUNT 1
|
||||
)
|
||||
if(NOT HEADERS_CHECKSUM)
|
||||
file(REMOVE ${TEMP}/CHECKSUM)
|
||||
if(DEFINED ROOT)
|
||||
file(REMOVE ${ROOT}/CHECKSUM)
|
||||
endif()
|
||||
message(FATAL_ERROR "Unable to extract header archive checksum")
|
||||
endif()
|
||||
string(REGEX MATCH ${HEADERS_MATCH} HEADERS_CHECKSUM ${HEADERS_CHECKSUM})
|
||||
set(HEADERS_CHECKSUM ${CMAKE_MATCH_1})
|
||||
set(NAME ${CMAKE_MATCH_2})
|
||||
if(CMAKE_MATCH_3 STREQUAL "headers")
|
||||
set(VERSION ${CMAKE_MATCH_4})
|
||||
else()
|
||||
set(VERSION ${CMAKE_MATCH_3})
|
||||
endif()
|
||||
set(HEADERS_ARCHIVE
|
||||
${CMAKE_MATCH_2}-${CMAKE_MATCH_3}-${CMAKE_MATCH_4}${CMAKE_MATCH_5}
|
||||
)
|
||||
# Make sure that the root directory exists, and that the checksum
|
||||
# file has been moved over from temp
|
||||
if(DEFINED ROOT)
|
||||
set(OLD_ROOT ${ROOT})
|
||||
endif()
|
||||
set(ROOT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}/${VERSION})
|
||||
if(DEFINED OLD_ROOT AND NOT ROOT STREQUAL "${OLD_ROOT}")
|
||||
file(REMOVE ${TEMP}/CHECKSUM)
|
||||
file(REMOVE ${ROOT}/CHECKSUM)
|
||||
message(FATAL_ERROR "Version/Name mismatch")
|
||||
endif()
|
||||
file(MAKE_DIRECTORY ${ROOT})
|
||||
if(EXISTS ${TEMP}/CHECKSUM)
|
||||
file(REMOVE ${ROOT}/CHECKSUM)
|
||||
file(RENAME ${TEMP}/CHECKSUM ${ROOT}/CHECKSUM)
|
||||
endif()
|
||||
|
||||
# Now that its fully resolved, report the name and version of Node.js being
|
||||
# used
|
||||
message(STATUS "NodeJS: Using ${NAME}, version ${VERSION}")
|
||||
|
||||
# Download the headers for the version being used
|
||||
# Theoretically, these could be found by searching the installed
|
||||
# system, but in practice, this can be error prone. They're provided
|
||||
# on the download servers, so just use the ones there.
|
||||
if(NOT EXISTS ${ROOT}/include)
|
||||
file(REMOVE ${TEMP}/${HEADERS_ARCHIVE})
|
||||
download_file(
|
||||
${URL}/${VERSION}/${HEADERS_ARCHIVE}
|
||||
${TEMP}/${HEADERS_ARCHIVE}
|
||||
INACTIVITY_TIMEOUT 10
|
||||
EXPECTED_HASH ${CHECKTYPE}=${HEADERS_CHECKSUM}
|
||||
STATUS HEADERS_STATUS
|
||||
)
|
||||
list(GET HEADERS_STATUS 0 HEADERS_STATUS)
|
||||
if(HEADER_STATUS GREATER 0)
|
||||
file(REMOVE ${TEMP}/${HEADERS_ARCHIVE})
|
||||
message(FATAL_ERROR "Unable to download Node.js headers")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xfz ${TEMP}/${HEADERS_ARCHIVE}
|
||||
WORKING_DIRECTORY ${TEMP}
|
||||
)
|
||||
|
||||
# This adapts the header extraction to support a number of different
|
||||
# header archive contents in addition to the one used by the
|
||||
# default Node.js library
|
||||
unset(NODEJS_HEADERS_PATH CACHE)
|
||||
find_path(NODEJS_HEADERS_PATH
|
||||
NAMES src include
|
||||
PATHS
|
||||
${TEMP}/${NAME}-${VERSION}-headers
|
||||
${TEMP}/${NAME}-${VERSION}
|
||||
${TEMP}/${NODEJS_DEFAULT_NAME}-${VERSION}-headers
|
||||
${TEMP}/${NODEJS_DEFAULT_NAME}-${VERSION}
|
||||
${TEMP}/${NODEJS_DEFAULT_NAME}
|
||||
${TEMP}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
if(NOT NODEJS_HEADERS_PATH)
|
||||
message(FATAL_ERROR "Unable to find extracted headers folder")
|
||||
endif()
|
||||
|
||||
# Move the headers into a standard location with a standard layout
|
||||
file(REMOVE ${TEMP}/${HEADERS_ARCHIVE})
|
||||
file(REMOVE_RECURSE ${ROOT}/include)
|
||||
if(EXISTS ${NODEJS_HEADERS_PATH}/include/node)
|
||||
file(RENAME ${NODEJS_HEADERS_PATH}/include/node ${ROOT}/include)
|
||||
elseif(EXISTS ${NODEJS_HEADERS_PATH}/src)
|
||||
file(MAKE_DIRECTORY ${ROOT}/include)
|
||||
if(NOT EXISTS ${NODEJS_HEADERS_PATH}/src)
|
||||
file(REMOVE_RECURSE ${ROOT}/include)
|
||||
message(FATAL_ERROR "Unable to find core headers")
|
||||
endif()
|
||||
file(COPY ${NODEJS_HEADERS_PATH}/src/
|
||||
DESTINATION ${ROOT}/include
|
||||
)
|
||||
if(NOT EXISTS ${NODEJS_HEADERS_PATH}/deps/uv/include)
|
||||
file(REMOVE_RECURSE ${ROOT}/include)
|
||||
message(FATAL_ERROR "Unable to find libuv headers")
|
||||
endif()
|
||||
file(COPY ${NODEJS_HEADERS_PATH}/deps/uv/include/
|
||||
DESTINATION ${ROOT}/include
|
||||
)
|
||||
if(NOT EXISTS ${NODEJS_HEADERS_PATH}/deps/v8/include)
|
||||
file(REMOVE_RECURSE ${ROOT}/include)
|
||||
message(FATAL_ERROR "Unable to find v8 headers")
|
||||
endif()
|
||||
file(COPY ${NODEJS_HEADERS_PATH}/deps/v8/include/
|
||||
DESTINATION ${ROOT}/include
|
||||
)
|
||||
if(NOT EXISTS ${NODEJS_HEADERS_PATH}/deps/zlib)
|
||||
file(REMOVE_RECURSE ${ROOT}/include)
|
||||
message(FATAL_ERROR "Unable to find zlib headers")
|
||||
endif()
|
||||
file(COPY ${NODEJS_HEADERS_PATH}/deps/zlib/
|
||||
DESTINATION ${ROOT}/include
|
||||
)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${NODEJS_HEADERS_PATH})
|
||||
unset(NODEJS_HEADERS_PATH CACHE)
|
||||
endif()
|
||||
|
||||
# Only download the libraries on windows, since its the only place
|
||||
# its necessary. Note, this requires rerunning CMake if moving
|
||||
# a module from one platform to another (should happen automatically
|
||||
# with most generators)
|
||||
if(WIN32)
|
||||
# Download the win32 library for linking
|
||||
file(STRINGS
|
||||
${ROOT}/CHECKSUM LIB32_CHECKSUM
|
||||
LIMIT_COUNT 1
|
||||
REGEX ${LIB32_MATCH}
|
||||
)
|
||||
if(NOT LIB32_CHECKSUM)
|
||||
message(FATAL_ERROR "Unable to extract x86 library checksum")
|
||||
endif()
|
||||
string(REGEX MATCH ${LIB32_MATCH} LIB32_CHECKSUM ${LIB32_CHECKSUM})
|
||||
set(LIB32_CHECKSUM ${CMAKE_MATCH_1})
|
||||
set(LIB32_PATH win-x86)
|
||||
set(LIB32_NAME ${CMAKE_MATCH_4}${CMAKE_MATCH_5})
|
||||
set(LIB32_TARGET ${CMAKE_MATCH_2}${CMAKE_MATCH_3}${LIB32_NAME})
|
||||
if(NOT EXISTS ${ROOT}/${LIB32_PATH})
|
||||
file(REMOVE_RECURSE ${TEMP}/${LIB32_PATH})
|
||||
download_file(
|
||||
${URL}/${VERSION}/${LIB32_TARGET}
|
||||
${TEMP}/${LIB32_PATH}/${LIB32_NAME}
|
||||
INACTIVITY_TIMEOUT 10
|
||||
EXPECTED_HASH ${CHECKTYPE}=${LIB32_CHECKSUM}
|
||||
STATUS LIB32_STATUS
|
||||
)
|
||||
list(GET LIB32_STATUS 0 LIB32_STATUS)
|
||||
if(LIB32_STATUS GREATER 0)
|
||||
message(FATAL_ERROR
|
||||
"Unable to download Node.js windows library (32-bit)"
|
||||
)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${ROOT}/${LIB32_PATH})
|
||||
file(MAKE_DIRECTORY ${ROOT}/${LIB32_PATH})
|
||||
file(RENAME
|
||||
${TEMP}/${LIB32_PATH}/${LIB32_NAME}
|
||||
${ROOT}/${LIB32_PATH}/${LIB32_NAME}
|
||||
)
|
||||
file(REMOVE_RECURSE ${TEMP}/${LIB32_PATH})
|
||||
endif()
|
||||
|
||||
# Download the win64 library for linking
|
||||
file(STRINGS
|
||||
${ROOT}/CHECKSUM LIB64_CHECKSUM
|
||||
LIMIT_COUNT 1
|
||||
REGEX ${LIB64_MATCH}
|
||||
)
|
||||
if(NOT LIB64_CHECKSUM)
|
||||
message(FATAL_ERROR "Unable to extract x64 library checksum")
|
||||
endif()
|
||||
string(REGEX MATCH ${LIB64_MATCH} LIB64_CHECKSUM ${LIB64_CHECKSUM})
|
||||
set(LIB64_CHECKSUM ${CMAKE_MATCH_1})
|
||||
set(LIB64_PATH win-x64)
|
||||
set(LIB64_NAME ${CMAKE_MATCH_4}${CMAKE_MATCH_5})
|
||||
set(LIB64_TARGET ${CMAKE_MATCH_2}${CMAKE_MATCH_3}${LIB64_NAME})
|
||||
if(NOT EXISTS ${ROOT}/${LIB64_PATH})
|
||||
file(REMOVE_RECURSE ${TEMP}/${LIB64_PATH})
|
||||
download_file(
|
||||
${URL}/${VERSION}/${LIB64_TARGET}
|
||||
${TEMP}/${LIB64_PATH}/${LIB64_NAME}
|
||||
INACTIVITY_TIMEOUT 10
|
||||
EXPECTED_HASH ${CHECKTYPE}=${LIB64_CHECKSUM}
|
||||
STATUS LIB64_STATUS
|
||||
)
|
||||
list(GET LIB64_STATUS 0 LIB64_STATUS)
|
||||
if(LIB64_STATUS GREATER 0)
|
||||
message(FATAL_ERROR
|
||||
"Unable to download Node.js windows library (64-bit)"
|
||||
)
|
||||
endif()
|
||||
file(REMOVE_RECURSE ${ROOT}/${LIB64_PATH})
|
||||
file(MAKE_DIRECTORY ${ROOT}/${LIB64_PATH})
|
||||
file(RENAME
|
||||
${TEMP}/${LIB64_PATH}/${LIB64_NAME}
|
||||
${ROOT}/${LIB64_PATH}/${LIB64_NAME}
|
||||
)
|
||||
file(REMOVE_RECURSE ${TEMP}/${LIB64_PATH})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# The downloaded headers should always be set for inclusion
|
||||
list(APPEND INCLUDE_DIRS ${ROOT}/include)
|
||||
|
||||
# Look for the NAN module, and add it to the includes
|
||||
find_nodejs_module(
|
||||
nan
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
NODEJS_NAN_DIR
|
||||
)
|
||||
if(NODEJS_NAN_DIR)
|
||||
list(APPEND INCLUDE_DIRS ${NODEJS_NAN_DIR})
|
||||
endif()
|
||||
|
||||
# Under windows, we need a bunch of libraries (due to the way
|
||||
# dynamic linking works)
|
||||
if(WIN32)
|
||||
# Generate and use a delay load hook to allow the node binary
|
||||
# name to be changed while still loading native modules
|
||||
set(DELAY_LOAD_HOOK ${CMAKE_CURRENT_BINARY_DIR}/win_delay_load_hook.c)
|
||||
nodejs_generate_delayload_hook(${DELAY_LOAD_HOOK})
|
||||
set(SOURCES ${DELAY_LOAD_HOOK})
|
||||
|
||||
# Necessary flags to get delayload working correctly
|
||||
list(APPEND LINK_FLAGS
|
||||
"-IGNORE:4199"
|
||||
"-DELAYLOAD:iojs.exe"
|
||||
"-DELAYLOAD:node.exe"
|
||||
"-DELAYLOAD:node.dll"
|
||||
)
|
||||
|
||||
# Core system libraries used by node
|
||||
list(APPEND LIBRARIES
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
|
||||
odbc32.lib Shlwapi.lib DelayImp.lib
|
||||
)
|
||||
|
||||
# Also link to the node stub itself (downloaded above)
|
||||
if(CMAKE_CL_64)
|
||||
list(APPEND LIBRARIES ${ROOT}/${LIB64_PATH}/${LIB64_NAME})
|
||||
else()
|
||||
list(APPEND LIBRARIES ${ROOT}/${LIB32_PATH}/${LIB32_NAME})
|
||||
endif()
|
||||
else()
|
||||
# Non-windows platforms should use these flags
|
||||
list(APPEND DEFINITIONS _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64)
|
||||
endif()
|
||||
|
||||
# Special handling for OSX / clang to allow undefined symbols
|
||||
# Define is required by node on OSX
|
||||
if(APPLE)
|
||||
list(APPEND LINK_FLAGS "-undefined dynamic_lookup")
|
||||
list(APPEND DEFINITIONS _DARWIN_USE_64_BIT_INODE=1)
|
||||
endif()
|
||||
|
||||
# Export all settings for use as arguments in the rest of the build
|
||||
set(NODEJS_VERSION ${VERSION} PARENT_SCOPE)
|
||||
set(NODEJS_SOURCES ${SOURCES} PARENT_SCOPE)
|
||||
set(NODEJS_INCLUDE_DIRS ${INCLUDE_DIRS} PARENT_SCOPE)
|
||||
set(NODEJS_LIBRARIES ${LIBRARIES} PARENT_SCOPE)
|
||||
set(NODEJS_LINK_FLAGS ${LINK_FLAGS} PARENT_SCOPE)
|
||||
set(NODEJS_DEFINITIONS ${DEFINITIONS} PARENT_SCOPE)
|
||||
|
||||
# Prevents this function from executing more than once
|
||||
set(NODEJS_INIT TRUE PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Helper function for defining a node module
|
||||
# After nodejs_init, all of the settings and dependencies necessary to do
|
||||
# this yourself are defined, but this helps make sure everything is configured
|
||||
# correctly. Feel free to use it as a model to do this by hand (or to
|
||||
# tweak this configuration if you need something custom).
|
||||
function(add_nodejs_module NAME)
|
||||
# Validate name parameter (must be a valid C identifier)
|
||||
string(MAKE_C_IDENTIFIER ${NAME} ${NAME}_SYMBOL_CHECK)
|
||||
if(NOT "${NAME}" STREQUAL "${${NAME}_SYMBOL_CHECK}")
|
||||
message(FATAL_ERROR
|
||||
"Module name must be a valid C identifier. "
|
||||
"Suggested alternative: '${${NAME}_SYMBOL_CHECK}'"
|
||||
)
|
||||
endif()
|
||||
# Make sure node is initialized (variables set) before defining the module
|
||||
if(NOT NODEJS_INIT)
|
||||
message(FATAL_ERROR
|
||||
"Node.js has not been initialized. "
|
||||
"Call nodejs_init before adding any modules"
|
||||
)
|
||||
endif()
|
||||
# In order to match node-gyp, we need to build into type specific folders
|
||||
# ncmake takes care of this, but be sure to set CMAKE_BUILD_TYPE yourself
|
||||
# if invoking CMake directly
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
message(FATAL_ERROR
|
||||
"Configuration type must be specified. "
|
||||
"Set CMAKE_BUILD_TYPE or use a different generator"
|
||||
)
|
||||
endif()
|
||||
|
||||
# A node module is a shared library
|
||||
add_library(${NAME} SHARED ${NODEJS_SOURCES} ${ARGN})
|
||||
# Add compiler defines for the module
|
||||
# Two helpful ones:
|
||||
# MODULE_NAME must match the name of the build library, define that here
|
||||
# ${NAME}_BUILD is for symbol visibility under windows
|
||||
string(TOUPPER "${NAME}_BUILD" ${NAME}_BUILD_DEF)
|
||||
target_compile_definitions(${NAME}
|
||||
PRIVATE MODULE_NAME=${NAME}
|
||||
PRIVATE ${${NAME}_BUILD_DEF}
|
||||
PUBLIC ${NODEJS_DEFINITIONS}
|
||||
)
|
||||
# This properly defines includes for the module
|
||||
target_include_directories(${NAME} PUBLIC ${NODEJS_INCLUDE_DIRS})
|
||||
|
||||
# Add link flags to the module
|
||||
target_link_libraries(${NAME} ${NODEJS_LIBRARIES})
|
||||
|
||||
# Set required properties for the module to build properly
|
||||
# Correct naming, symbol visiblity and C++ standard
|
||||
set_target_properties(${NAME} PROPERTIES
|
||||
OUTPUT_NAME ${NAME}
|
||||
PREFIX ""
|
||||
SUFFIX ".node"
|
||||
MACOSX_RPATH ON
|
||||
C_VISIBILITY_PRESET hidden
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
CMAKE_CXX_STANDARD_REQUIRED TRUE
|
||||
CXX_STANDARD 11
|
||||
LINK_FLAGS "${NODEJS_LINK_FLAGS}"
|
||||
)
|
||||
|
||||
# Make sure we're buiilding in a build specific output directory
|
||||
# Only necessary on single-target generators (Make, Ninja)
|
||||
# Multi-target generators do this automatically
|
||||
# This (luckily) mirrors node-gyp conventions
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set_property(TARGET ${NAME} PROPERTY
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BUILD_TYPE}
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,72 +1,34 @@
|
||||
string(RANDOM LENGTH 16 MASON_INVOCATION)
|
||||
|
||||
# Directory where Mason packages are located; typically ends with mason_packages
|
||||
if (NOT MASON_PACKAGE_DIR)
|
||||
set(MASON_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/mason_packages")
|
||||
endif()
|
||||
|
||||
# URL prefix of where packages are located.
|
||||
if (NOT MASON_REPOSITORY)
|
||||
set(MASON_REPOSITORY "https://mason-binaries.s3.amazonaws.com")
|
||||
endif()
|
||||
|
||||
# Path to Mason executable
|
||||
if (NOT MASON_COMMAND)
|
||||
set(MASON_COMMAND "${CMAKE_SOURCE_DIR}/.mason/mason")
|
||||
endif()
|
||||
|
||||
# Determine platform
|
||||
# we call uname -s manually here since
|
||||
# CMAKE_HOST_SYSTEM_NAME will not be defined before the project() call
|
||||
execute_process(
|
||||
COMMAND uname -s
|
||||
OUTPUT_VARIABLE UNAME_S
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(NOT MASON_PLATFORM)
|
||||
if (UNAME_S STREQUAL "Darwin")
|
||||
set(MASON_PLATFORM "macos")
|
||||
else()
|
||||
set(MASON_PLATFORM "linux")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Determine platform version string
|
||||
if(MASON_PLATFORM STREQUAL "ios")
|
||||
set(MASON_PLATFORM_VERSION "8.0") # Deployment target version
|
||||
elseif(MASON_PLATFORM STREQUAL "android")
|
||||
if (ANDROID_ABI STREQUAL "armeabi")
|
||||
set(MASON_PLATFORM_VERSION "arm-v5-9")
|
||||
elseif(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||
set(MASON_PLATFORM_VERSION "arm-v8-21")
|
||||
elseif(ANDROID_ABI STREQUAL "x86")
|
||||
set(MASON_PLATFORM_VERSION "x86-9")
|
||||
elseif(ANDROID_ABI STREQUAL "x86_64")
|
||||
set(MASON_PLATFORM_VERSION "x86-64-21")
|
||||
elseif(ANDROID_ABI STREQUAL "mips")
|
||||
set(MASON_PLATFORM_VERSION "mips-9")
|
||||
elseif(ANDROID_ABI STREQUAL "mips64")
|
||||
set(MASON_PLATFORM_VERSION "mips64-21")
|
||||
else()
|
||||
set(MASON_PLATFORM_VERSION "arm-v7-9")
|
||||
endif()
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND uname -m
|
||||
OUTPUT_VARIABLE MASON_PLATFORM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
if(MASON_PLATFORM STREQUAL "macos")
|
||||
set(MASON_PLATFORM "osx")
|
||||
endif()
|
||||
|
||||
set(ENV{MASON_PLATFORM} "${MASON_PLATFORM}")
|
||||
set(ENV{MASON_PLATFORM_VERSION} "${MASON_PLATFORM_VERSION}")
|
||||
# Mason CMake
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
function(mason_detect_platform)
|
||||
# Determine platform
|
||||
if(NOT MASON_PLATFORM)
|
||||
# we call uname -s manually here since
|
||||
# CMAKE_HOST_SYSTEM_NAME will not be defined before the project() call
|
||||
execute_process(
|
||||
COMMAND uname -s
|
||||
OUTPUT_VARIABLE UNAME
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if (UNAME STREQUAL "Darwin")
|
||||
set(MASON_PLATFORM "osx" PARENT_SCOPE)
|
||||
else()
|
||||
set(MASON_PLATFORM "linux" PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Determine platform version string
|
||||
if(NOT MASON_PLATFORM_VERSION)
|
||||
execute_process(
|
||||
COMMAND uname -m
|
||||
OUTPUT_VARIABLE MASON_PLATFORM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(MASON_PLATFORM_VERSION "${MASON_PLATFORM_VERSION}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(mason_use _PACKAGE)
|
||||
if(NOT _PACKAGE)
|
||||
message(FATAL_ERROR "[Mason] No package name given")
|
||||
@@ -103,7 +65,7 @@ function(mason_use _PACKAGE)
|
||||
if (NOT EXISTS "${_CACHE_PATH}")
|
||||
# Download the package
|
||||
set(_URL "${MASON_REPOSITORY}/${_SLUG}.tar.gz")
|
||||
message(STATUS "[Mason] Downloading package ${_URL}...")
|
||||
message("[Mason] Downloading package ${_URL}...")
|
||||
|
||||
set(_FAILED)
|
||||
set(_ERROR)
|
||||
@@ -123,39 +85,16 @@ function(mason_use _PACKAGE)
|
||||
endif()
|
||||
|
||||
# Unpack the package
|
||||
message(STATUS "[Mason] Unpacking package to ${_INSTALL_PATH_RELATIVE}...")
|
||||
message("[Mason] Unpacking package to ${_INSTALL_PATH_RELATIVE}...")
|
||||
file(MAKE_DIRECTORY "${_INSTALL_PATH}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf "${_CACHE_PATH}"
|
||||
WORKING_DIRECTORY "${_INSTALL_PATH}")
|
||||
endif()
|
||||
|
||||
# Create a config file if it doesn't exist in the package
|
||||
# TODO: remove this once all packages have a mason.ini file
|
||||
# Error out if there is no config file.
|
||||
if(NOT EXISTS "${_INSTALL_PATH}/mason.ini")
|
||||
# Change pkg-config files
|
||||
file(GLOB_RECURSE _PKGCONFIG_FILES "${_INSTALL_PATH}/*.pc")
|
||||
foreach(_PKGCONFIG_FILE IN ITEMS ${_PKGCONFIG_FILES})
|
||||
file(READ "${_PKGCONFIG_FILE}" _PKGCONFIG_FILE_CONTENT)
|
||||
string(REGEX REPLACE "(^|\n)prefix=[^\n]*" "\\1prefix=${_INSTALL_PATH}" _PKGCONFIG_FILE_CONTENT "${_PKGCONFIG_FILE_CONTENT}")
|
||||
file(WRITE "${_PKGCONFIG_FILE}" "${_PKGCONFIG_FILE_CONTENT}")
|
||||
endforeach()
|
||||
|
||||
if(NOT EXISTS "${MASON_COMMAND}")
|
||||
message(FATAL_ERROR "[Mason] Could not find Mason command at ${MASON_COMMAND}")
|
||||
endif()
|
||||
|
||||
set(_FAILED)
|
||||
set(_ERROR)
|
||||
execute_process(
|
||||
COMMAND ${MASON_COMMAND} config ${_PACKAGE} ${_VERSION}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_FILE "${_INSTALL_PATH}/mason.ini"
|
||||
RESULT_VARIABLE _FAILED
|
||||
ERROR_VARIABLE _ERROR)
|
||||
if(_FAILED)
|
||||
message(FATAL_ERROR "[Mason] Could not get configuration for package ${_PACKAGE} ${_VERSION}: ${_ERROR}")
|
||||
endif()
|
||||
message(FATAL_ERROR "[Mason] Could not find mason.ini for package ${_PACKAGE} ${_VERSION}")
|
||||
endif()
|
||||
|
||||
set(MASON_PACKAGE_${_PACKAGE}_PREFIX "${_INSTALL_PATH}" CACHE STRING "${_PACKAGE} ${_INSTALL_PATH}" FORCE)
|
||||
@@ -229,3 +168,48 @@ macro(target_add_mason_package _TARGET _VISIBILITY _PACKAGE)
|
||||
target_compile_options(${_TARGET} ${_VISIBILITY} "${MASON_PACKAGE_${_PACKAGE}_OPTIONS}")
|
||||
target_link_libraries(${_TARGET} ${_VISIBILITY} "${MASON_PACKAGE_${_PACKAGE}_LIBRARIES}")
|
||||
endmacro()
|
||||
|
||||
# Setup
|
||||
|
||||
string(RANDOM LENGTH 16 MASON_INVOCATION)
|
||||
|
||||
# Read environment variables if CMake is run in command mode
|
||||
if (CMAKE_ARGC)
|
||||
set(MASON_PLATFORM "$ENV{MASON_PLATFORM}")
|
||||
set(MASON_PLATFORM_VERSION "$ENV{MASON_PLATFORM_VERSION}")
|
||||
set(MASON_PACKAGE_DIR "$ENV{MASON_PACKAGE_DIR}")
|
||||
set(MASON_REPOSITORY "$ENV{MASON_REPOSITORY}")
|
||||
endif()
|
||||
|
||||
# Directory where Mason packages are located; typically ends with mason_packages
|
||||
if (NOT MASON_PACKAGE_DIR)
|
||||
set(MASON_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/mason_packages")
|
||||
endif()
|
||||
|
||||
# URL prefix of where packages are located.
|
||||
if (NOT MASON_REPOSITORY)
|
||||
set(MASON_REPOSITORY "https://mason-binaries.s3.amazonaws.com")
|
||||
endif()
|
||||
|
||||
mason_detect_platform()
|
||||
|
||||
# Execute commands if CMake is run in command mode
|
||||
if (CMAKE_ARGC)
|
||||
# Collect remaining arguments for passing to mason_use
|
||||
set(_MASON_ARGS)
|
||||
if (${CMAKE_ARGC} LESS 5)
|
||||
message(FATAL_ERROR "Usage: mason.sh [install|prefix] PACKAGE VERSION")
|
||||
endif()
|
||||
|
||||
if (${CMAKE_ARGV3} STREQUAL "install")
|
||||
# Install the package
|
||||
mason_use(${CMAKE_ARGV4} VERSION ${CMAKE_ARGV5})
|
||||
elseif (${CMAKE_ARGV3} STREQUAL "prefix")
|
||||
set(PKG_PREFIX "${MASON_PACKAGE_DIR}/${MASON_PLATFORM}-${MASON_PLATFORM_VERSION}/${CMAKE_ARGV4}/${CMAKE_ARGV5}")
|
||||
# CMake can't write to stdout with message()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${PKG_PREFIX}")
|
||||
else()
|
||||
message(FATAL_ERROR "Usage: mason.sh [install|prefix] PACKAGE VERSION")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
@@ -1,7 +1,6 @@
|
||||
coverage:
|
||||
|
||||
ignore:
|
||||
- unit_tests/.*
|
||||
- third_party/.*
|
||||
|
||||
comment: off
|
||||
|
||||
+2
-4
@@ -2,8 +2,6 @@ module.exports = {
|
||||
default: '--strict --tags ~@stress --tags ~@todo --require features/support --require features/step_definitions',
|
||||
verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions',
|
||||
todo: '--strict --tags @todo --require features/support --require features/step_definitions',
|
||||
all: '--strict --require features/support --require features/step_definitions'
|
||||
all: '--strict --require features/support --require features/step_definitions',
|
||||
mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --tags ~@matrix --tags ~@trip --require features/support --require features/step_definitions -f progress'
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+42
-14
@@ -1,18 +1,46 @@
|
||||
FROM ubuntu:14.04
|
||||
FROM alpine:3.5
|
||||
|
||||
RUN apt-get update -y && apt-get install -y software-properties-common
|
||||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
RUN apt-get update -y && apt-get install -y g++-5 libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev libtbb-dev libgdal-dev libluabind-dev libboost-all-dev ccache
|
||||
RUN apt-get -y install curl cmake cmake-curses-gui git
|
||||
ARG DOCKER_TAG
|
||||
|
||||
RUN mkdir /src
|
||||
COPY . /src
|
||||
|
||||
RUN mkdir /opt
|
||||
WORKDIR /opt
|
||||
RUN git clone --depth 1 --branch v0.31.0 https://github.com/creationix/nvm.git
|
||||
RUN /bin/bash -c "source /opt/nvm/nvm.sh && nvm install v4"
|
||||
RUN NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
|
||||
case ${DOCKER_TAG} in *"-debug"*) BUILD_TYPE="Debug";; *) BUILD_TYPE="Release";; esac && \
|
||||
\
|
||||
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
||||
apk update && \
|
||||
apk upgrade && \
|
||||
apk add git cmake wget make libc-dev gcc g++ bzip2-dev boost-dev zlib-dev expat-dev lua5.1-dev libtbb@testing libtbb-dev@testing && \
|
||||
\
|
||||
echo "Building libstxxl" && \
|
||||
cd /opt && \
|
||||
git clone --depth 1 --branch 1.4.1 https://github.com/stxxl/stxxl.git && \
|
||||
cd stxxl && \
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||
make -j${NPROC} && \
|
||||
make install && \
|
||||
\
|
||||
echo "Building OSRM ${DOCKER_TAG}" && \
|
||||
cd /src && \
|
||||
mkdir build && \
|
||||
cd build && \
|
||||
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_LTO=On .. && \
|
||||
make -j${NPROC} install && \
|
||||
cd ../profiles && \
|
||||
cp -r * /opt && \
|
||||
\
|
||||
echo "Cleaning up" && \
|
||||
strip /usr/local/bin/* && \
|
||||
rm /usr/local/lib/libstxxl* && \
|
||||
cd /opt && \
|
||||
apk del boost-dev && \
|
||||
apk del g++ cmake libc-dev expat-dev zlib-dev bzip2-dev lua5.1-dev git make gcc && \
|
||||
apk add boost-filesystem boost-program_options boost-regex boost-iostreams boost-thread libgomp lua5.1 expat && \
|
||||
rm -rf /src /opt/stxxl /usr/local/bin/stxxl_tool /usr/local/lib/libosrm*
|
||||
|
||||
RUN useradd -ms /bin/bash mapbox
|
||||
USER mapbox
|
||||
ENV HOME /home/mapbox
|
||||
WORKDIR /home/mapbox
|
||||
|
||||
RUN echo "source /opt/nvm/nvm.sh" > .bashrc
|
||||
RUN echo "source /home/mapbox/.bashrc" > .profile
|
||||
EXPOSE 5000
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# Docker based continious integration
|
||||
|
||||
Run ```./docker/build-image.sh``` to build a docker image.
|
||||
The image contains all the build dependencies and the state of the local git repository.
|
||||
|
||||
Run ```./docker/run-gcc.sh``` to build OSRM with g++ and run all tests.
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
docker build \
|
||||
-t mapbox/osrm:linux \
|
||||
docker/
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# We've placed the Dockerfile under docker/ so that the generically named
|
||||
# hooks/ directory doesn't pollute the main directory. Because we need to
|
||||
# COPY the source into the container, we need to use some -f gymnastics to
|
||||
# ensure that "COPY . /src" is referring to the repo root, not the directory
|
||||
# that contains the Dockerfile.
|
||||
# This script gets executed with a pwd of wherever the Dockerfile is.
|
||||
docker build --build-arg DOCKER_TAG=${DOCKER_TAG} -t $IMAGE_NAME -f Dockerfile ..
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
docker run \
|
||||
-i \
|
||||
-e "CXX=clang++" \
|
||||
-v `pwd`:/home/mapbox/osrm-backend \
|
||||
-t mapbox/osrm:linux \
|
||||
/bin/bash -lc "osrm-backend/docker/test.sh"
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
docker run \
|
||||
-i \
|
||||
-e "CXX=g++-5" \
|
||||
-e "CC=gcc-5" \
|
||||
-v `pwd`:/home/mapbox/osrm-backend \
|
||||
-t mapbox/osrm:linux \
|
||||
/bin/bash -lc "osrm-backend/docker/test.sh"
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
export CMAKEOPTIONS="-DCMAKE_BUILD_TYPE=Release"
|
||||
|
||||
cd /home/mapbox/osrm-backend
|
||||
[ -d build ] && rm -rf build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. $CMAKEOPTIONS -DBUILD_TOOLS=1
|
||||
|
||||
make -j`nproc`
|
||||
make tests -j`nproc`
|
||||
#./unit_tests/server-tests
|
||||
#./unit_tests/library-tests
|
||||
#./unit_tests/extractor-tests
|
||||
#./unit_tests/util-tests
|
||||
cd ..
|
||||
npm test
|
||||
@@ -20,6 +20,7 @@ A guard (ScopedGeojsonLoggerGuard) requires a logging policy. Per default we pro
|
||||
|
||||
The initialisation to do so looks like this:
|
||||
`util::ScopedGeojsonLoggerGuard<util::NodeIdVectorToLineString> geojson_guard( "debug.geojson", data-for-conversion);`
|
||||
Make sure to give the guar a name, so it actually gets a lifetime.
|
||||
|
||||
The field `data-for-conversion` can be an arbitrary long set of features and needs to match the parameters used for constructing our policy (in this case `util::NodeIdVectorToLineString`).
|
||||
|
||||
|
||||
+109
-60
@@ -24,11 +24,12 @@ To pass parameters to each location some options support an array like encoding:
|
||||
|
||||
**Request options**
|
||||
|
||||
| Option | Values | Description |
|
||||
|------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|
||||
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|
||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|
||||
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|
||||
| Option | Values | Description |
|
||||
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|
||||
|bearings |`{bearing};{bearing}[;{bearing} ...]` |Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
|
||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Limits the search to given radius in meters. |
|
||||
|generate\_hints |`true` (default), `false` |Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. |
|
||||
|hints |`{hint};{hint}[;{hint} ...]` |Hint from previous request to derive position in street network. |
|
||||
|
||||
Where the elements follow the following format:
|
||||
|
||||
@@ -55,14 +56,14 @@ Example: 2nd location use the default value for `option`:
|
||||
```curl
|
||||
# Query on Berlin with three coordinates:
|
||||
curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'
|
||||
|
||||
|
||||
# Using polyline:
|
||||
curl 'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'
|
||||
```
|
||||
|
||||
### Responses
|
||||
|
||||
Every response object has a `code` field containing one of the strings below or a service dependent code:
|
||||
Every response object has a `code` property containing one of the strings below or a service dependent code:
|
||||
|
||||
| Type | Description |
|
||||
|-------------------|----------------------------------------------------------------------------------|
|
||||
@@ -171,10 +172,10 @@ In addition to the [general options](#general-options) the following options are
|
||||
|------------|---------------------------------------------|-------------------------------------------------------------------------------|
|
||||
|alternatives|`true`, `false` (default) |Search for alternative routes and return as well.\* |
|
||||
|steps |`true`, `false` (default) |Return route steps for each route leg |
|
||||
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
||||
|continue\_straight |`default` (default), `true`, `false` |Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. |
|
||||
|
||||
\* Please note that even if an alternative route is requested, a result cannot be guaranteed.
|
||||
|
||||
@@ -190,7 +191,7 @@ In case of error the following `code`s are supported in addition to the general
|
||||
|-------------------|-----------------|
|
||||
| `NoRoute` | No route found. |
|
||||
|
||||
All other fields might be undefined.
|
||||
All other properties might be undefined.
|
||||
|
||||
#### Example Request
|
||||
|
||||
@@ -246,7 +247,7 @@ curl 'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHu
|
||||
|
||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||
- `durations` array of arrays that stores the matrix in row-major order. `durations[i][j]` gives the travel time from
|
||||
the i-th waypoint to the j-th waypoint. Values are given in seconds.
|
||||
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be `null` if no route between `i` and `j` can be found.
|
||||
- `sources` array of `Waypoint` objects describing all sources in order
|
||||
- `destinations` array of `Waypoint` objects describing all destinations in order
|
||||
|
||||
@@ -256,7 +257,7 @@ In case of error the following `code`s are supported in addition to the general
|
||||
|-------------------|-----------------|
|
||||
| `NoTable` | No route found. |
|
||||
|
||||
All other fields might be undefined.
|
||||
All other properties might be undefined.
|
||||
|
||||
### Match service
|
||||
|
||||
@@ -274,10 +275,12 @@ In addition to the [general options](#general-options) the following options are
|
||||
|------------|------------------------------------------------|------------------------------------------------------------------------------------------|
|
||||
|steps |`true`, `false` (default) |Return route steps for each route |
|
||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||
|timestamps |`{timestamp};{timestamp}[;{timestamp} ...]` |Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing. |
|
||||
|radiuses |`{radius};{radius}[;{radius} ...]` |Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.|
|
||||
|gaps |`split` (default), `ignore` |Allows the input track splitting based on huge timestamp gaps between points. |
|
||||
|tidy |`true`, `false` (default) |Allows the input track modification to obtain better matching quality for noisy tracks. |
|
||||
|
||||
|Parameter |Values |
|
||||
|------------|-----------------------------------|
|
||||
@@ -297,6 +300,7 @@ The area to search is chosen such that the correct candidate should be considere
|
||||
Each `Waypoint` object has the following additional properties:
|
||||
- `matchings_index`: Index to the `Route` object in `matchings` the sub-trace was matched to.
|
||||
- `waypoint_index`: Index of the waypoint inside the matched route.
|
||||
- `alternatives_count`: number of alternative routes leading to the destination from this trace point. 0 means there are no other routes reaching destination. Greater values mean that there are different routes available and different route can be selected if you provide more coordinates.
|
||||
- `matchings`: An array of `Route` objects that assemble the trace. Each `Route` object has the following additional properties:
|
||||
- `confidence`: Confidence of the matching. `float` value between 0 and 1. 1 is very confident that the matching is correct.
|
||||
|
||||
@@ -306,31 +310,66 @@ In case of error the following `code`s are supported in addition to the general
|
||||
|-------------------|---------------------|
|
||||
| `NoMatch` | No matchings found. |
|
||||
|
||||
All other fields might be undefined.
|
||||
All other properties might be undefined.
|
||||
|
||||
### Trip service
|
||||
|
||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm).
|
||||
The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation.
|
||||
Note that if the input coordinates can not be joined by a single trip (e.g. the coordinates are on several disconnected islands)
|
||||
multiple trips for each connected component are returned.
|
||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
|
||||
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation.
|
||||
Note that all input coordinates have to be connected for the trip service to work.
|
||||
|
||||
```endpoint
|
||||
GET /trip/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
|
||||
GET /trip/v1/{profile}/{coordinates}?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'
|
||||
```
|
||||
|
||||
In addition to the [general options](#general-options) the following options are supported for this service:
|
||||
|
||||
|Option |Values |Description |
|
||||
|------------|------------------------------------------------|---------------------------------------------------------------------------|
|
||||
|roundtrip |`true` (default), `false` |Return route is a roundtrip (route returns to first location) |
|
||||
|source |`any` (default), `first` |Return route starts at `any` or `first` coordinate |
|
||||
|destination |`any` (default), `last` |Return route ends at `any` or `last` coordinate |
|
||||
|steps |`true`, `false` (default) |Return route instructions for each trip |
|
||||
|annotations |`true`, `false` (default) |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|annotations |`true`, `false` (default), `nodes`, `distance`, `duration`, `datasources`, `weight`, `speed` |Returns additional metadata for each coordinate along the route geometry. |
|
||||
|geometries |`polyline` (default), `polyline6`, `geojson` |Returned route geometry format (influences overview and per step) |
|
||||
|overview |`simplified` (default), `full`, `false` |Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.|
|
||||
|
||||
**Response**
|
||||
**Fixing Start and End Points**
|
||||
|
||||
- `code` if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||
It is possible to explicitely set the start or end coordinate of the trip.
|
||||
When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
|
||||
|
||||
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
|
||||
|
||||
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
||||
Right now, the following combinations are possible:
|
||||
|
||||
| roundtrip | source | destination | supported |
|
||||
| :-- | :-- | :-- | :-- |
|
||||
| true | first | last | **yes** |
|
||||
| true | first | any | **yes** |
|
||||
| true | any | last | **yes** |
|
||||
| true | any | any | **yes** |
|
||||
| false | first | last | **yes** |
|
||||
| false | first | any | no |
|
||||
| false | any | last | no |
|
||||
| false | any | any | no |
|
||||
|
||||
#### Example Requests
|
||||
|
||||
```curl
|
||||
# Round trip in Berlin with three stops:
|
||||
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'
|
||||
```
|
||||
|
||||
```curl
|
||||
# Round trip in Berlin with four stops, starting at the first stop, ending at the last:
|
||||
curl 'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
- `code`: if the request was successful `Ok` otherwise see the service dependent and general status codes.
|
||||
- `waypoints`: Array of `Waypoint` objects representing all waypoints in input order. Each `Waypoint` object has the following additional properties:
|
||||
- `trips_index`: Index to `trips` of the sub-trip the point was matched to.
|
||||
- `waypoint_index`: Index of the point in the trip.
|
||||
@@ -340,9 +379,10 @@ In case of error the following `code`s are supported in addition to the general
|
||||
|
||||
| Type | Description |
|
||||
|-------------------|---------------------|
|
||||
| `NoTrips` | No trips found. |
|
||||
| `NoTrips` | No trips found because input coordinates are not connected.|
|
||||
| `NotImplemented` | This request is not supported |
|
||||
|
||||
All other fields might be undefined.
|
||||
All other properties might be undefined.
|
||||
|
||||
### Tile service
|
||||
|
||||
@@ -372,7 +412,7 @@ Vector tiles contain two layers:
|
||||
|
||||
`speeds` layer:
|
||||
|
||||
| Field | Type | Description |
|
||||
| Property | Type | Description |
|
||||
| ------------ | --------- | ---------------------------------------- |
|
||||
| `speed` | `integer` | the speed on that road segment, in km/h |
|
||||
| `is_small` | `boolean` | whether this segment belongs to a small (< 1000 node) [strongly connected component](https://en.wikipedia.org/wiki/Strongly_connected_component) |
|
||||
@@ -382,7 +422,7 @@ Vector tiles contain two layers:
|
||||
|
||||
`turns` layer:
|
||||
|
||||
| Field | Type | Description |
|
||||
| Property | Type | Description |
|
||||
| ------------ | --------- | ---------------------------------------- |
|
||||
| `bearing_in` | `integer` | the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East |
|
||||
| `turn_angle` | `integer` | the angle of the turn, relative to the `bearing_in`. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right |
|
||||
@@ -399,14 +439,16 @@ Represents a route through (potentially multiple) waypoints.
|
||||
|
||||
- `distance`: The distance traveled by the route, in `float` meters.
|
||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` field for a parameter documentation.
|
||||
|
||||
- `geometry`: The whole geometry of the route value depending on `overview` parameter, format depending on the `geometries` parameter. See `RouteStep`'s `geometry` property for a parameter documentation.
|
||||
- `weight`: The calculated weight of the route.
|
||||
- `weight_name`: The name of the weight profile used during extraction phase.
|
||||
|
||||
| overview | Description |
|
||||
|------------|-----------------------------|
|
||||
| simplified | Geometry is simplified according to the highest zoom level it can still be displayed on full. |
|
||||
| full | Geometry is not simplified. |
|
||||
| false | Geometry is not added. |
|
||||
|
||||
|
||||
- `legs`: The legs between the given waypoints, an array of `RouteLeg` objects.
|
||||
|
||||
#### Example
|
||||
@@ -417,6 +459,8 @@ Three input coordinates, `geometry=geojson`, `steps=false`:
|
||||
{
|
||||
"distance": 90.0,
|
||||
"duration": 300.0,
|
||||
"weight": 300.0,
|
||||
"weight_name": "duration",
|
||||
"geometry": {"type": "LineString", "coordinates": [[120.0, 10.0], [120.1, 10.0], [120.2, 10.0], [120.3, 10.0]]},
|
||||
"legs": [
|
||||
{
|
||||
@@ -441,15 +485,16 @@ Represents a route between two waypoints.
|
||||
|
||||
- `distance`: The distance traveled by this route leg, in `float` meters.
|
||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||
- `summary`: Summary of the route taken as `string`. Depends on the `steps` parameter:
|
||||
|
||||
| steps | |
|
||||
- `weight`: The calculated weight of the route leg.
|
||||
- `summary`: Summary of the route taken as `string`. Depends on the `summary` parameter:
|
||||
|
||||
| summary | |
|
||||
|--------------|-----------------------------------------------------------------------|
|
||||
| true | Names of the two major roads used. Can be empty if route is too short.|
|
||||
| false | empty `string` |
|
||||
|
||||
- `steps`: Depends on the `steps` parameter.
|
||||
|
||||
|
||||
| steps | |
|
||||
|--------------|-----------------------------------------------------------------------|
|
||||
| true | array of `RouteStep` objects describing the turn-by-turn instructions |
|
||||
@@ -459,8 +504,8 @@ Represents a route between two waypoints.
|
||||
|
||||
| annotations | |
|
||||
|--------------|-----------------------------------------------------------------------|
|
||||
| true | An `Annotation` object containing node ids, durations and distances |
|
||||
| false | `undefined` |
|
||||
| true | An `Annotation` object containing node ids, durations distances and |
|
||||
| false | weights `undefined` |
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -470,12 +515,14 @@ With `steps=false` and `annotations=true`:
|
||||
{
|
||||
"distance": 30.0,
|
||||
"duration": 100.0,
|
||||
"weight": 100.0,
|
||||
"steps": [],
|
||||
"annotation": {
|
||||
"distance": [5,5,10,5,5],
|
||||
"duration": [15,15,40,15,15],
|
||||
"datasources": [1,0,0,0,1],
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||
"speed": [0.3, 0.3, 0.3, 0.3, 0.3]
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -490,6 +537,8 @@ Annotation of the whole route leg with fine-grained information about each segme
|
||||
- `duration`: The duration between each pair of coordinates, in seconds
|
||||
- `datasources`: The index of the datasource for the speed between each pair of coordinates. `0` is the default profile, other values are supplied via `--segment-speed-file` to `osrm-contract`
|
||||
- `nodes`: The OSM node ID for each coordinate along the route, excluding the first/last user-supplied coordinates
|
||||
- `weight`: The weights between each pair of coordinates
|
||||
- `speed`: Convenience field, calculation of `distance / duration` rounded to one decimal place
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -498,7 +547,8 @@ Annotation of the whole route leg with fine-grained information about each segme
|
||||
"distance": [5,5,10,5,5],
|
||||
"duration": [15,15,40,15,15],
|
||||
"datasources": [1,0,0,0,1],
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802]
|
||||
"nodes": [49772551,49772552,49786799,49786800,49786801,49786802],
|
||||
"weight": [15,15,40,15,15]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -514,6 +564,7 @@ step.
|
||||
- `distance`: The distance of travel from the maneuver to the subsequent step, in `float` meters.
|
||||
- `duration`: The estimated travel time, in `float` number of seconds.
|
||||
- `geometry`: The unsimplified geometry of the route segment, depending on the `geometries` parameter.
|
||||
- `weight`: The calculated weight of the step.
|
||||
|
||||
| `geometry` | |
|
||||
|------------|--------------------------------------------------------------------|
|
||||
@@ -528,6 +579,8 @@ step.
|
||||
- `mode`: A string signifying the mode of transportation.
|
||||
- `maneuver`: A `StepManeuver` object representing the maneuver.
|
||||
- `intersections`: A list of `Intersection` objects that are passed along the segment, the very first belonging to the StepManeuver
|
||||
- `rotary_name`: The name for the rotary. Optionally included, if the step is a rotary and a rotary name is available.
|
||||
- `rotary_pronunciation`: The pronunciation hint of the rotary name. Optionally included, if the step is a rotary and a rotary pronunciation is available.
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -536,6 +589,7 @@ step.
|
||||
"geometry" : "{lu_IypwpAVrAvAdI",
|
||||
"mode" : "driving",
|
||||
"duration" : 15.6,
|
||||
"weight" : 15.6,
|
||||
"intersections" : [
|
||||
{ "bearings" : [ 10, 92, 184, 270 ],
|
||||
"lanes" : [
|
||||
@@ -577,12 +631,12 @@ step.
|
||||
|
||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||
- `bearing_before`: The clockwise angle from true north to the
|
||||
direction of travel immediately before the maneuver.
|
||||
direction of travel immediately before the maneuver. Range 0-359.
|
||||
- `bearing_after`: The clockwise angle from true north to the
|
||||
direction of travel immediately after the maneuver.
|
||||
direction of travel immediately after the maneuver. Range 0-359.
|
||||
- `type` A string indicating the type of maneuver. **new identifiers might be introduced without API change**
|
||||
Types unknown to the client should be handled like the `turn` type, the existance of correct `modifier` values is guranteed.
|
||||
|
||||
Types unknown to the client should be handled like the `turn` type, the existence of correct `modifier` values is guranteed.
|
||||
|
||||
| `type` | Description |
|
||||
|------------------|--------------------------------------------------------------|
|
||||
| `turn` | a basic turn into direction of the `modifier` |
|
||||
@@ -597,8 +651,8 @@ step.
|
||||
| `end of road` | road ends in a T intersection turn in direction of `modifier`|
|
||||
| `use lane` | going straight on a specific lane |
|
||||
| `continue` | Turn in direction of `modifier` to stay on the same road |
|
||||
| `roundabout` | traverse roundabout, has additional field `exit` with NR if the roundabout is left. `the modifier specifies the direction of entering the roundabout` |
|
||||
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. |
|
||||
| `roundabout` | traverse roundabout, has additional property `exit` with NR if the roundabout is left. The modifier specifies the direction of entering the roundabout. |
|
||||
| `rotary` | a traffic circle. While very similar to a larger version of a roundabout, it does not necessarily follow roundabout rules for right of way. It can offer `rotary_name` and/or `rotary_pronunciation` parameters (located in the RouteStep object) in addition to the `exit` parameter (located on the StepManeuver object). |
|
||||
| `roundabout turn`| Describes a turn at a small roundabout that should be treated as normal turn. The `modifier` indicates the turn direciton. Example instruction: `At the roundabout turn left`. |
|
||||
| `notification` | not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the `modifier` describes the direction |
|
||||
|
||||
@@ -606,7 +660,7 @@ step.
|
||||
between all instructions. They only offer a fallback in case nothing else is to report.
|
||||
|
||||
- `modifier` An optional `string` indicating the direction change of the maneuver.
|
||||
|
||||
|
||||
| `modifier` | Description |
|
||||
|-------------------|-------------------------------------------|
|
||||
| `uturn` | indicates reversal of direction |
|
||||
@@ -617,22 +671,18 @@ step.
|
||||
| `slight left` | a slight turn to the left |
|
||||
| `left` | a normal turn to the left |
|
||||
| `sharp left` | a sharp turn to the left |
|
||||
|
||||
|
||||
The list of turns without a modifier is limited to: `depart/arrive`. If the source/target location is close enough to the `depart/arrive` location, no modifier will be given.
|
||||
|
||||
The meaning depends on the `type` field.
|
||||
|
||||
|
||||
The meaning depends on the `type` property.
|
||||
|
||||
| `type` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| `turn` | `modifier` indicates the change in direction accomplished through the turn |
|
||||
| `depart`/`arrive` | `modifier` indicates the position of departure point and arrival point in relation to the current direction of travel |
|
||||
|
||||
- `exit` An optional `integer` indicating number of the exit to take. The field exists for the following `type` field:
|
||||
|
||||
| `type` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| `roundabout`/`rotary` | Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout. |
|
||||
| else | Indicates the number of intersections passed until the turn. Example instruction: `at the fourth intersection, turn left` |
|
||||
|
||||
- `exit` An optional `integer` indicating number of the exit to take. The property exists for the `roundabout` / `rotary` property:
|
||||
Number of the roundabout exit to take. If exit is `undefined` the destination is on the roundabout.
|
||||
|
||||
|
||||
New properties (potentially depending on `type`) may be introduced in the future without an API version change.
|
||||
@@ -644,7 +694,7 @@ A `Lane` represents a turn lane at the corresponding turn location.
|
||||
**Properties**
|
||||
|
||||
- `indications`: a indication (e.g. marking on the road) specifying the turn lane. A road can have multiple indications (e.g. an arrow pointing straight and left). The indications are given in an array, each containing one of the following types. Further indications might be added on without an API version change.
|
||||
|
||||
|
||||
| `value` | Description |
|
||||
|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| `none` | No dedicated indication is shown. |
|
||||
@@ -656,7 +706,7 @@ A `Lane` represents a turn lane at the corresponding turn location.
|
||||
| `slight left` | An indication indicating a slight left turn (i.e. slightly bend arrow). |
|
||||
| `left` | An indication indicating a left turn (i.e. bend arrow). |
|
||||
| `sharp left` | An indication indicating a sharp left turn (i.e. strongly bend arrow). |
|
||||
|
||||
|
||||
- `valid`: a boolean flag indicating whether the lane is a valid choice in the current maneuver
|
||||
|
||||
#### Example
|
||||
@@ -676,7 +726,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
||||
**Properties**
|
||||
|
||||
- `location`: A `[longitude, latitude]` pair describing the location of the turn.
|
||||
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection.
|
||||
- `bearings`: A list of bearing values (e.g. [0,90,180,270]) that are available at the intersection. The bearings describe all available roads at the intersection. Values are between 0-359 (0=true north)
|
||||
- `entry`: A list of entry flags, corresponding in a 1:1 relationship to the bearings. A value of `true` indicates that the respective road could be entered on a valid route.
|
||||
`false` indicates that the turn onto the respective road would violate a restriction.
|
||||
- `in`: index into bearings/entry array. Used to calculate the bearing just before the turn. Namely, the clockwise angle from true north to the
|
||||
@@ -694,7 +744,7 @@ location of the StepManeuver. Further intersections are listed for every cross-w
|
||||
"in":0,
|
||||
"out":2,
|
||||
"bearings":[60,150,240,330],
|
||||
"entry":["false","true","true","true"]
|
||||
"entry":["false","true","true","true"],
|
||||
"lanes":{
|
||||
"indications": ["left", "straight"],
|
||||
"valid": "false"
|
||||
@@ -710,7 +760,6 @@ Object used to describe waypoint on a route.
|
||||
|
||||
- `name` Name of the street the coordinate snapped to
|
||||
- `location` Array that contains the `[longitude, latitude]` pair of the snapped coordinate
|
||||
- `distance` The distance of the snapped point from the original
|
||||
- `hint` Unique internal identifier of the segment (ephemeral, not constant over data updates)
|
||||
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
|
||||
E.g. you can use the `hint` value obtained by the `nearest` query as `hint` values for `route` inputs.
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
# OSRM
|
||||
|
||||
The `OSRM` method is the main constructor for creating an OSRM instance. An OSRM instance requires a `.osrm` network,
|
||||
which is prepared by the OSRM Backend C++ library.
|
||||
|
||||
You can create such a `.osrm` file by running the OSRM binaries we ship in `node_modules/osrm/lib/binding/` and default
|
||||
profiles (e.g. for setting speeds and determining road types to route on) in `node_modules/osrm/profiles/`:
|
||||
|
||||
node_modules/osrm/lib/binding/osrm-extract data.osm.pbf -p node_modules/osrm/profiles/car.lua
|
||||
node_modules/osrm/lib/binding/osrm-contract data.osrm
|
||||
|
||||
Consult the [osrm-backend](https://github.com/Project-OSRM/osrm-backend) documentation or further details.
|
||||
|
||||
Once you have a complete `network.osrm` file, you can calculate networks in javascript with this library using the
|
||||
methods below. To create an OSRM instance with your network you need to construct an instance like this:
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
```
|
||||
|
||||
#### Methods
|
||||
|
||||
| Service | Description |
|
||||
| -------------------------- | --------------------------------------------------------- |
|
||||
| [`osrm.route`](#route) | shortest path between given coordinates |
|
||||
| [`osrm.nearest`](#nearest) | returns the nearest street segment for a given coordinate |
|
||||
| [`osrm.table`](#table) | computes distance tables for given coordinates |
|
||||
| [`osrm.match`](#match) | matches given coordinates to the road network |
|
||||
| [`osrm.trip`](#trip) | Compute the shortest trip between given coordinates |
|
||||
| [`osrm.tile`](#tile) | Return vector tiles containing debugging info |
|
||||
|
||||
#### General Options
|
||||
|
||||
Each OSRM method (except for `OSRM.tile()`) has set of general options as well as unique options, outlined below.
|
||||
|
||||
| Option | Values | Description | Format |
|
||||
| --------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| coordinates | `array` of `coordinate` elements: `[{coordinate}, ...]` | The coordinates this request will use. | `array` with `[{lon},{lat}]` values, in decimal degrees |
|
||||
| bearings | `array` of `bearing` elements: `[{bearing}, ...]` | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. | `null` or `array` with `[{value},{range}]` `integer 0 .. 360,integer 0 .. 180` |
|
||||
| radiuses | `array` of `radius` elements: `[{radius}, ...]` | Limits the search to given radius in meters. | `null` or `double >= 0` or `unlimited` (default) |
|
||||
| hints | `array` of `hint` elements: `[{hint}, ...]` | Hint to derive position in street network. | Base64 `string` |
|
||||
| generate\_hints | `true` (default) or `false` | Adds a Hint to the response which can be used in subsequent requests, see `hints` parameter. | `Boolean` |
|
||||
|
||||
## route
|
||||
|
||||
Returns the fastest route between two or more coordinates while visiting the waypoints in order.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the route query.
|
||||
- `options.alternatives` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Search for alternative routes and return as well. _Please note that even if an alternative route is requested, a result cannot be guaranteed._ (optional, default `false`)
|
||||
- `options.steps` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route steps for each route leg. (optional, default `false`)
|
||||
- `options.annotations` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)] or \[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** Return annotations for each route leg for duration, nodes, distance, weight, datasources and/or speed. Annotations can be `false` or `true` (no/full annotations) or an array of strings with `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed`. (optional, default `false`)
|
||||
- `options.geometries` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Add overview geometry either `full`, `simplified` according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.continue_straight` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile. `null`/`true`/`false`
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM("berlin-latest.osrm");
|
||||
osrm.route({coordinates: [[13.438640,52.519930], [13.415852, 52.513191]]}, function(err, result) {
|
||||
if(err) throw err;
|
||||
console.log(result.waypoints); // array of Waypoint objects representing all waypoints in order
|
||||
console.log(result.routes); // array of Route objects ordered by descending recommendation rank
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** An array of [Waypoint](#waypoint) objects representing all waypoints in order AND an array of [`Route`](#route) objects ordered by descending recommendation rank.
|
||||
|
||||
## nearest
|
||||
|
||||
Snaps a coordinate to the street network and returns the nearest n matches.
|
||||
|
||||
Note: `coordinates` in the general options only supports a single `{longitude},{latitude}` entry.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the nearest query.
|
||||
- `options.number` **\[[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** Number of nearest segments that should be returned.
|
||||
Must be an integer greater than or equal to `1`. (optional, default `1`)
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [[13.388860,52.517037]],
|
||||
number: 3,
|
||||
bearings: [[0,20]]
|
||||
};
|
||||
osrm.nearest(options, function(err, response) {
|
||||
console.log(response.waypoints); // array of Waypoint objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints`.
|
||||
**`waypoints`**: array of [`Ẁaypoint`](#waypoint) objects sorted by distance to the input coordinate.
|
||||
Each object has an additional `distance` property, which is the distance in meters to the supplied
|
||||
input coordinate.
|
||||
|
||||
## table
|
||||
|
||||
Computes duration tables for the given locations. Allows for both symmetric and asymmetric tables.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the table query.
|
||||
- `options.sources` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** An array of `index` elements (`0 <= integer < #coordinates`) to use
|
||||
location with given index as source. Default is to use all.
|
||||
- `options.destinations` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** An array of `index` elements (`0 <= integer < #coordinates`) to use location with given index as destination. Default is to use all.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.388860,52.517037],
|
||||
[13.397634,52.529407],
|
||||
[13.428555,52.523219]
|
||||
]
|
||||
};
|
||||
osrm.table(options, function(err, response) {
|
||||
console.log(response.durations); // array of arrays, matrix in row-major order
|
||||
console.log(response.sources); // array of Waypoint objects
|
||||
console.log(response.destinations); // array of Waypoint objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `durations`, `sources`, and `destinations`.
|
||||
**`durations`**: array of arrays that stores the matrix in row-major order. `durations[i][j]`
|
||||
gives the travel time from the i-th waypoint to the j-th waypoint. Values are given in seconds.
|
||||
**`sources`**: array of [`Ẁaypoint`](#waypoint) objects describing all sources in order.
|
||||
**`destinations`**: array of [`Ẁaypoint`](#waypoint) objects describing all destinations in order.
|
||||
|
||||
## tile
|
||||
|
||||
This generates [Mapbox Vector Tiles](https://mapbox.com/vector-tiles) that can be viewed with a
|
||||
vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can
|
||||
be used to examine the routing graph. The tiles are generated directly from the data in-memory,
|
||||
so are in sync with actual routing results, and let you examine which roads are actually routable,
|
||||
and what weights they have applied.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `ZXY` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** an array consisting of `x`, `y`, and `z` values representing tile coordinates like
|
||||
[wiki.openstreetmap.org/wiki/Slippy_map_tilenames](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames)
|
||||
and are supported by vector tile viewers like [Mapbox GL JS]\(<https://www.mapbox.com/mapbox-gl-js/api/>.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
osrm.tile([0, 0, 0], function(err, response) {
|
||||
if (err) throw err;
|
||||
fs.writeFileSync('./tile.vector.pbf', response); // write the buffer to a file
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Buffer](https://nodejs.org/api/buffer.html)** contains a Protocol Buffer encoded vector tile.
|
||||
|
||||
## match
|
||||
|
||||
Map matching matches given GPS points to the road network in the most plausible way.
|
||||
Please note the request might result multiple sub-traces. Large jumps in the timestamps
|
||||
(>60s) or improbable transitions lead to trace splits if a complete matching could
|
||||
not be found. The algorithm might not be able to match all points. Outliers are removed
|
||||
if they can not be matched successfully.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the match query.
|
||||
- `options.steps` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)] or \[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** Return annotations for each route leg for duration, nodes, distance, weight, datasources and/or speed. Annotations can be `false` or `true` (no/full annotations) or an array of strings with `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed`. (optional, default `false`)
|
||||
- `options.geometries` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Returned route geometry format (influences overview
|
||||
and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Add overview geometry either `full`, `simplified`
|
||||
according to highest zoom level it could be display on, or not at all (`false`). (optional, default `simplified`)
|
||||
- `options.timestamps` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>]** Timestamp of the input location (integers, UNIX-like timestamp).
|
||||
- `options.radiuses` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** Standard deviation of GPS precision used for map matching.
|
||||
If applicable use GPS accuracy (`double >= 0`, default `5m`).
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [[13.393252,52.542648],[13.39478,52.543079],[13.397389,52.542107]],
|
||||
timestamps: [1424684612, 1424684616, 1424684620]
|
||||
};
|
||||
osrm.match(options, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.tracepoints); // array of Waypoint objects
|
||||
console.log(response.matchings); // array of Route objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `tracepoints` and `matchings`.
|
||||
**`tracepoints`** Array of [`Ẁaypoint`](#waypoint) objects representing all points of the trace in order.
|
||||
If the trace point was ommited by map matching because it is an outlier, the entry will be null. Each
|
||||
`Waypoint` object includes two additional properties, 1) `matchings_index`: Index to the
|
||||
[`Route`](#route) object in matchings the sub-trace was matched to, 2) `waypoint_index`: Index of
|
||||
the waypoint inside the matched route.
|
||||
**`matchings`** is an array of [`Route`](#route) objects that
|
||||
assemble the trace. Each `Route` object has an additional `confidence` property, which is the confidence of
|
||||
the matching. float value between `0` and `1`. `1` is very confident that the matching is correct.
|
||||
|
||||
## trip
|
||||
|
||||
The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm). The returned path does not have to be the fastest path, as TSP is NP-hard it is only an approximation. Note that all input coordinates have to be connected for the trip service to work.
|
||||
|
||||
**Parameters**
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Object literal containing parameters for the trip query.
|
||||
- `options.roundtrip` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route is a roundtrip. (optional, default `true`)
|
||||
- `options.source` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Return route starts at `any` coordinate. Can also be `first`. (optional, default `any`)
|
||||
- `options.destination` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Return route ends at `any` coordinate. Can also be `last`. (optional, default `any`)
|
||||
- `options.steps` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Return route steps for each route. (optional, default `false`)
|
||||
- `options.annotations` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)] or \[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>]** Return annotations for each route leg for duration, nodes, distance, weight, datasources and/or speed. Annotations can be `false` or `true` (no/full annotations) or an array of strings with `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed`. (optional, default `false`)
|
||||
- `options.geometries` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Returned route geometry format (influences overview
|
||||
and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||
- `options.overview` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Add overview geometry either `full`, `simplified` (optional, default `simplified`)
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)**
|
||||
|
||||
**Fixing Start and End Points**
|
||||
|
||||
It is possible to explicitly set the start or end coordinate of the trip. When source is set to `first`, the first coordinate is used as start coordinate of the trip in the output. When destination is set to `last`, the last coordinate will be used as destination of the trip in the returned output. If you specify `any`, any of the coordinates can be used as the first or last coordinate in the output.
|
||||
|
||||
However, if `source=any&destination=any` the returned round-trip will still start at the first input coordinate by default.
|
||||
|
||||
Currently, not all combinations of `roundtrip`, `source` and `destination` are supported.
|
||||
Right now, the following combinations are possible:
|
||||
|
||||
| roundtrip | source | destination | supported |
|
||||
| :-- | :-- | :-- | :-- |
|
||||
| true | first | last | **yes** |
|
||||
| true | first | any | **yes** |
|
||||
| true | any | last | **yes** |
|
||||
| true | any | any | **yes** |
|
||||
| false | first | last | **yes** |
|
||||
| false | first | any | no |
|
||||
| false | any | last | no |
|
||||
| false | any | any | no |
|
||||
|
||||
**Examples**
|
||||
|
||||
Roundtrip Request
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.36761474609375, 52.51663871100423],
|
||||
[13.374481201171875, 52.506191342034576]
|
||||
]
|
||||
}
|
||||
osrm.trip(options, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.waypoints); // array of Waypoint objects
|
||||
console.log(response.trips); // array of Route objects
|
||||
});
|
||||
```
|
||||
|
||||
Non Roundtrip Request
|
||||
```javascript
|
||||
var osrm = new OSRM('network.osrm');
|
||||
var options = {
|
||||
coordinates: [
|
||||
[13.36761474609375, 52.51663871100423],
|
||||
[13.374481201171875, 52.506191342034576]
|
||||
],
|
||||
source: "first",
|
||||
destination: "last",
|
||||
roundtrip: false
|
||||
}
|
||||
osrm.trip(options, function(err, response) {
|
||||
if (err) throw err;
|
||||
console.log(response.waypoints); // array of Waypoint objects
|
||||
console.log(response.trips); // array of Route objects
|
||||
});
|
||||
```
|
||||
|
||||
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** containing `waypoints` and `trips`.
|
||||
**`waypoints`**: an array of [`Ẁaypoint`](#waypoint) objects representing all waypoints in input order.
|
||||
Each Waypoint object has the following additional properties, 1) `trips_index`: index to trips of the
|
||||
sub-trip the point was matched to, and 2) `waypoint_index`: index of the point in the trip.
|
||||
**`trips`**: an array of [`Route`](#route) objects that assemble the trace.
|
||||
|
||||
# Responses
|
||||
|
||||
Responses
|
||||
|
||||
## Route
|
||||
|
||||
Represents a route through (potentially multiple) waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#route)
|
||||
|
||||
## RouteLeg
|
||||
|
||||
Represents a route between two waypoints.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#routeleg)
|
||||
|
||||
## RouteStep
|
||||
|
||||
A step consists of a maneuver such as a turn or merge, followed by a distance of travel along a single way to the subsequent step.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#routestep)
|
||||
|
||||
## StepManeuver
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#stepmanuever)
|
||||
|
||||
## Waypoint
|
||||
|
||||
Object used to describe waypoint on a route.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `exteral` **documentation** in [`osrm-backend`](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#waypoint)
|
||||
@@ -0,0 +1,86 @@
|
||||
# Releasing
|
||||
|
||||
Releasing a new version of `node-osrm` is mostly automated using Travis CI.
|
||||
|
||||
The version of `node-osrm` is locked to the same version as `osrm-backend`. Every `node-osrm` should have a `osrm-backend` release of the same version. Of course, only release a `node-osrm` after the release has been tagged in `osrm-backend`.
|
||||
|
||||
These steps all happen on `master`. After the release is out, create a branch using the MAJOR.MINOR version of the release to document code changes made for that version.
|
||||
|
||||
### Steps to release
|
||||
|
||||
1. Update the `osrm_release` field in `package.json` to the corresonding git tag in `osrm-backend.`
|
||||
|
||||
Confirm the desired OSRM branch and commit to `master`.
|
||||
|
||||
1. Bump node-osrm version
|
||||
|
||||
Update the `CHANGELOG.md` and the `package.json` version if needed.
|
||||
|
||||
1. Check that Travis CI [builds are passing](https://travis-ci.org/Project-OSRM/node-osrm) for the latest commit on `master`.
|
||||
|
||||
1. Publishing binaries
|
||||
|
||||
If travis builds are passing then it's time to publish binaries by committing with a message containing `[publish binary]`. Use an empty commit for this.
|
||||
|
||||
```
|
||||
git commit --allow-empty -m "[publish binary] vMAJOR.MINOR.PATCH"
|
||||
```
|
||||
|
||||
1. Test
|
||||
|
||||
Locally you can now test binaries. Cleanup, re-install, and run the tests like:
|
||||
|
||||
```
|
||||
make clean
|
||||
npm install # will pull remote binaries
|
||||
npm ls # confirm deps are correct
|
||||
make test
|
||||
```
|
||||
|
||||
1. Tag
|
||||
|
||||
Once binaries are published for Linux and OS X then its time to tag a new release and add the changelog to the tag:
|
||||
|
||||
```
|
||||
git tag vMAJOR.MINOR.PATCH -a
|
||||
git push --tags
|
||||
```
|
||||
|
||||
1. Publish node-osrm. **we only do this for stable releases**
|
||||
|
||||
First ensure your local `node-pre-gyp` is up to date:
|
||||
|
||||
```
|
||||
npm ls
|
||||
```
|
||||
|
||||
This is important because it is bundled during packaging.
|
||||
|
||||
If you see any errors then do:
|
||||
|
||||
```
|
||||
rm -rf node_modules/node-pre-gyp
|
||||
npm install node-pre-gyp
|
||||
```
|
||||
|
||||
Now we're ready to publish `node-osrm` to <https://www.npmjs.org/package/osrm>:
|
||||
|
||||
```
|
||||
npm publish
|
||||
```
|
||||
|
||||
Dependent apps can now pull from the npm registry like:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"osrm": "^MAJOR.MINOR.PATCH"
|
||||
}
|
||||
```
|
||||
|
||||
Or can still pull from the github tag like:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"osrm": "https://github.com/Project-OSRM/node-osrm/archive/vMAJOR.MINOR.PATCH.tar.gz"
|
||||
}
|
||||
```
|
||||
+80
-3
@@ -25,6 +25,19 @@ As you scroll down the file you'll see local variables, and then local functions
|
||||
|
||||
`way_function` and `node_function` are the important functions which are called when extracting OpenStreetMap data with `osrm-extract`.
|
||||
|
||||
The following global properties can be set in your profile:
|
||||
|
||||
Attribute | Type | Notes
|
||||
------------------------------|----------|----------------------------------------------------------------------------
|
||||
weight_name | String | Name used in output for the routing weight property (default 'duration')
|
||||
weight_precision | Unsigned | Decimal precision of edge weights (default 1)
|
||||
left_hand_driving | Boolean | Are vehicles assumed to drive on the left? (used in guidance)
|
||||
use_turn_restrictions | Boolean | Are turn instructions followed?
|
||||
continue_straight_at_waypoint | Boolean | Must the route continue straight on at a via point, or are U-turns allowed?
|
||||
max_speed_for_map_matching | Float | Maximum vehicle speed to be assumed in matching (in m/s)
|
||||
max_turn_weight | Float | Maximum turn penalty weight
|
||||
force_split_edges | Boolean | True value forces a split of forward and backward edges of extracted ways and guarantees that segment_function will be called for all segments
|
||||
|
||||
## way_function
|
||||
|
||||
Given an OpenStreetMap way, the way_function will either return nothing (meaning we are not going to route over this way at all), or it will set up a result hash to be returned. The most important thing it will do is set the value of `result.forward_speed` and `result.backward_speed` as a suitable integer value representing the speed for traversing the way.
|
||||
@@ -33,15 +46,79 @@ All other calculations stem from that, including the returned timings in driving
|
||||
|
||||
Using the power of the scripting language you wouldn't typically see something as simple as a `result.forward_speed = 20` line within the way_function. Instead a way_function will examine the tagging (e.g. `way:get_value_by_key("highway")` and many others), process this information in various ways, calling other local functions, referencing the global variables and look-up hashes, before arriving at the result.
|
||||
|
||||
## Guidance
|
||||
The following attributes can be set on the result in way_function:
|
||||
|
||||
Attribute | Type | Notes
|
||||
----------------------------------------|----------|--------------------------------------------------------------------------
|
||||
forward_speed | Float | Speed on this way in km/h
|
||||
backward_speed | Float | " "
|
||||
forward_rate | Float | Routing weight, expressed as meters/*weight* (e.g. for a fastest-route weighting, you would want this to be meters/second, so set it to forward_speed/3.6)
|
||||
backward_rate | Float | " "
|
||||
forward_mode | Enum | Mode of travel (e.g. car, ferry). Defined in include/extractor/travel_mode.hpp
|
||||
backward_mode | Enum | " "
|
||||
duration | Float | Alternative setter for duration of the whole way in both directions
|
||||
weight | Float | Alternative setter for weight of the whole way in both directions
|
||||
turn_lanes_forward | String | Directions for individual lanes (normalised OSM turn:lanes value)
|
||||
turn_lanes_backward | String | " "
|
||||
forward_restricted | Boolean | Is this a restricted access road? (e.g. private, or deliveries only; used to enable high turn penalty, so that way is only chosen for start/end of route)
|
||||
backward_restricted | Boolean | " "
|
||||
is_startpoint | Boolean | Can a journey start on this way? (e.g. ferry; if false, prevents snapping the start point to this way)
|
||||
roundabout | Boolean | Is this part of a roundabout?
|
||||
circular | Boolean | Is this part of a non-roundabout circular junction?
|
||||
name | String | Name of the way
|
||||
ref | String | Road number
|
||||
pronunciation | String | Name pronunciation
|
||||
road_classification.motorway_class | Boolean | Guidance: way is a motorway
|
||||
road_classification.link_class | Boolean | Guidance: way is a slip/link road
|
||||
road_classification.road_priority_class | Enum | Guidance: order in priority list. Defined in include/extractor/guidance/road_classification.hpp
|
||||
road_classification.may_be_ignored | Boolean | Guidance: way is non-highway
|
||||
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
|
||||
|
||||
### Guidance
|
||||
|
||||
The guidance parameters in profiles are currently a work in progress. They can and will change.
|
||||
Please be aware of this when using guidance configuration possibilities.
|
||||
|
||||
### Road Classification
|
||||
|
||||
Guidance uses road classes to decide on when/if to emit specific instructions and to discover which road is obvious when following a route.
|
||||
Classification uses three flags and a priority-category.
|
||||
The flags indicate whether a road is a motorway (required for on/off ramps), a link type (the ramps itself, if also a motorway) and whether a road may be omittted in considerations (is considered purely for connectivity).
|
||||
The priority-category influences the decision which road is considered the obvious choice and which roads can be seen as fork.
|
||||
Forks can be emitted between roads of similar priority category only. Obvious choices follow a major priority road, if the priority difference is large.
|
||||
|
||||
## node_function
|
||||
|
||||
The following attributes can be set on the result in node_function:
|
||||
|
||||
Attribute | Type | Notes
|
||||
----------------|---------|-------------------------------------------------------
|
||||
barrier | Boolean | Is it an impassable barrier?
|
||||
traffic_lights | Boolean | Is it a traffic light (incurs delay in turn_function)?
|
||||
|
||||
## segment_function
|
||||
|
||||
The following attributes can be read and set on the result in segment_function:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
-------------------|-------------|---------|------------------------------------------------------
|
||||
source.lon | Read | Float | Co-ordinates of segment start
|
||||
source.lat | Read | Float | " "
|
||||
target.lon | Read | Float | Co-ordinates of segment end
|
||||
target.lat | Read | Float | " "
|
||||
target.distance | Read | Float | Length of segment
|
||||
weight | Read/write | Float | Routing weight for this segment
|
||||
duration | Read/write | Float | Duration for this segment
|
||||
|
||||
## turn_function
|
||||
|
||||
The following attributes can be read and set on the result in turn_function:
|
||||
|
||||
Attribute | Read/write? | Type | Notes
|
||||
-------------------|-------------|---------|------------------------------------------------------
|
||||
direction_modifier | Read | Enum | Geometry of turn. Defined in include/extractor/guidance/turn_instruction.hpp
|
||||
turn_type | Read | Enum | Priority of turn. Defined in include/extractor/guidance/turn_instruction.hpp
|
||||
has_traffic_light | Read | Boolean | Is a traffic light present at this turn?
|
||||
source_restricted | Read | Boolean | Is it from a restricted access road? (See definition in way_function)
|
||||
target_restricted | Read | Boolean | Is it to a restricted access road? (See definition in way_function)
|
||||
angle | Read | Float | Angle of turn in degrees (0-360: 0=u-turn, 180=straight on)
|
||||
duration | Read/write | Float | Penalty to be applied for this turn (duration in deciseconds)
|
||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
||||
|
||||
+13
-9
@@ -32,21 +32,25 @@ We may introduce forward-compatible changes: query parameters and response prope
|
||||
|
||||
- The `master` branch is for the bleeding edge development
|
||||
- We create and maintain release branches `x.y` to control the release flow
|
||||
- We create the release branch once we tagged the final version `x.y.0` version, RCs go on master
|
||||
- We create the release branch once we create release branches once we want to release the first RC
|
||||
- RCs go in the release branch, commits needs to be cherry-picked from master
|
||||
- No minor or major version will be released without a code-equal release candidates
|
||||
- For quality assurance, release candidates will be run on the demo server for 24 hours before releaseing the version proper
|
||||
- For quality assurance, release candidates need to be staged beforing tagging a final release
|
||||
- Patch versions may be released without a release candidate
|
||||
- We may backport fixes to older versions and release them as patch versions
|
||||
|
||||
## Releasing a version
|
||||
|
||||
1. Check out the appropriate release branch `x.y`
|
||||
2. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||
3. Make sure `CHANGELOG.md` is up to date.
|
||||
4. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||
5. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||
6. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||
6. Push tags and commits: `git push; git push --tags`
|
||||
8. Proceede with the `node-osrm` release as [outlined in the repository](https://github.com/Project-OSRM/node-osrm/blob/master/docs/releasing.md).
|
||||
2. Make sure `CHANGELOG.md` is up to date.
|
||||
3. Make sure the OSRM version in `CMakeLists.txt` is up to date
|
||||
4. Make sure the `package.json` is up to date.
|
||||
5. Make sure all tests are passing (e.g. Travis CI gives you a :thumbs_up:)
|
||||
6. Use an annotated tag to mark the release: `git tag vx.y.z -a` Body of the tag description should be the changelog entries.
|
||||
7. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
|
||||
8. Push tags and commits: `git push; git push --tags`
|
||||
9. If not a release-candidate: Write a mailing-list post to osrm-talk@openstreetmap.org to announce the release
|
||||
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
|
||||
`rm -rf node_modules && npm install` locally.
|
||||
11. For final releases run `npm publish` or `npm publish --tag next` for release candidates.
|
||||
|
||||
|
||||
+18
-1
@@ -1,6 +1,6 @@
|
||||
# Testsuite
|
||||
|
||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucucmber.js for scenario driven testing.
|
||||
OSRM comes with a testsuite containing both unit-tests using the Boost library and cucumber.js for scenario driven testing.
|
||||
|
||||
## Unit Tests
|
||||
|
||||
@@ -28,6 +28,23 @@ This dataset is a small extract and may not even contain all tags or edge cases.
|
||||
Furthermore this dataset is not in sync with what you see in up-to-date OSM maps or on the demo server.
|
||||
See the library tests for how to add new dataset dependent tests.
|
||||
|
||||
To prepare the test data simply `cd test/data/` and then run `make`.
|
||||
|
||||
### Running Tests
|
||||
|
||||
To build the unit tests:
|
||||
|
||||
```
|
||||
cd build
|
||||
cmake ..
|
||||
make tests
|
||||
```
|
||||
|
||||
You should see the compiled binaries in `build/unit_tests`, you can then run each suite individually:
|
||||
|
||||
```
|
||||
./engine-tests
|
||||
```
|
||||
|
||||
## Cucumber
|
||||
|
||||
|
||||
+2
-2
@@ -58,8 +58,8 @@ int main(int argc, const char *argv[])
|
||||
const auto distance = route.values["distance"].get<json::Number>().value;
|
||||
const auto duration = route.values["duration"].get<json::Number>().value;
|
||||
|
||||
// Warn users if extract does not contain the default Berlin coordinates from above
|
||||
if (distance == 0 or duration == 0)
|
||||
// Warn users if extract does not contain the default coordinates from above
|
||||
if (distance == 0 || duration == 0)
|
||||
{
|
||||
std::cout << "Note: distance or duration is zero. ";
|
||||
std::cout << "You are probably doing a query outside of the OSM extract.\n\n";
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
process.env.UV_THREADPOOL_SIZE = Math.ceil(require('os').cpus().length * 1.5);
|
||||
|
||||
var express = require('express');
|
||||
var OSRM = require('..');
|
||||
var path = require('path');
|
||||
|
||||
var app = express();
|
||||
var osrm = new OSRM(path.join(__dirname,"../test/data/ch/monaco.osrm"));
|
||||
|
||||
// Accepts a query like:
|
||||
// http://localhost:8888?start=13.414307,52.521835&end=13.402290,52.523728
|
||||
app.get('/', function(req, res) {
|
||||
if (!req.query.start || !req.query.end) {
|
||||
return res.json({"error":"invalid start and end query"});
|
||||
}
|
||||
var coordinates = [];
|
||||
var start = req.query.start.split(',');
|
||||
coordinates.push([+start[0],+start[1]]);
|
||||
var end = req.query.end.split(',');
|
||||
coordinates.push([+end[0],+end[1]]);
|
||||
var query = {
|
||||
coordinates: coordinates,
|
||||
alternateRoute: req.query.alternatives !== 'false'
|
||||
};
|
||||
osrm.route(query, function(err, result) {
|
||||
if (err) return res.json({"error":err.message});
|
||||
return res.json(result);
|
||||
});
|
||||
});
|
||||
|
||||
console.log('Listening on port: ' + 8888);
|
||||
app.listen(8888);
|
||||
+150
-149
@@ -7,178 +7,179 @@ Feature: Bike - Access tags on ways
|
||||
|
||||
Scenario: Bike - Access tag hierarchy on ways
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| | | | | x |
|
||||
| | yes | | | x |
|
||||
| | no | | | |
|
||||
| | | yes | | x |
|
||||
| | | no | | |
|
||||
| | no | yes | | x |
|
||||
| | yes | no | | |
|
||||
| | | | yes | x |
|
||||
| | | | no | |
|
||||
| | no | | yes | x |
|
||||
| | yes | | no | |
|
||||
| | | no | yes | x |
|
||||
| | | yes | no | |
|
||||
| runway | | | | |
|
||||
| runway | yes | | | x |
|
||||
| runway | no | | | |
|
||||
| runway | | yes | | x |
|
||||
| runway | | no | | |
|
||||
| runway | no | yes | | x |
|
||||
| runway | yes | no | | |
|
||||
| runway | | | yes | x |
|
||||
| runway | | | no | |
|
||||
| runway | no | | yes | x |
|
||||
| runway | yes | | no | |
|
||||
| runway | | no | yes | x |
|
||||
| runway | | yes | no | |
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| primary | | | | cycling |
|
||||
| primary | yes | | | cycling |
|
||||
| primary | no | | | |
|
||||
| primary | | yes | | cycling |
|
||||
| primary | | no | | |
|
||||
| primary | no | yes | | cycling |
|
||||
| primary | yes | no | | |
|
||||
| primary | | | yes | cycling |
|
||||
| primary | | | no | |
|
||||
| primary | no | | yes | cycling |
|
||||
| primary | yes | | no | |
|
||||
| primary | | no | yes | cycling |
|
||||
| primary | | yes | no | |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Access tag in forward direction
|
||||
Then routability should be
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| | | | | x | |
|
||||
| | yes | | | x | |
|
||||
| | no | | | | |
|
||||
| | | yes | | x | |
|
||||
| | | no | | | |
|
||||
| | no | yes | | x | |
|
||||
| | yes | no | | | |
|
||||
| | | | yes | x | |
|
||||
| | | | no | | |
|
||||
| | no | | yes | x | |
|
||||
| | yes | | no | | |
|
||||
| | | no | yes | x | |
|
||||
| | | yes | no | | |
|
||||
| runway | | | | x | |
|
||||
| runway | yes | | | x | |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | x | |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | x | |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | x | |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | x | |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | x | |
|
||||
| runway | | yes | no | | |
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| primary | | | | cycling | |
|
||||
| primary | yes | | | cycling | |
|
||||
| primary | no | | | | |
|
||||
| primary | | yes | | cycling | |
|
||||
| primary | | no | | | |
|
||||
| primary | no | yes | | cycling | |
|
||||
| primary | yes | no | | | |
|
||||
| primary | | | yes | cycling | |
|
||||
| primary | | | no | | |
|
||||
| primary | no | | yes | cycling | |
|
||||
| primary | yes | | no | | |
|
||||
| primary | | no | yes | cycling | |
|
||||
| primary | | yes | no | | |
|
||||
| runway | | | | cycling | |
|
||||
| runway | yes | | | cycling | |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | cycling | |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | cycling | |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | cycling | |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | cycling | |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | cycling | |
|
||||
| runway | | yes | no | | |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Access tag in backward direction
|
||||
Then routability should be
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| | | | | | x |
|
||||
| | yes | | | | x |
|
||||
| | no | | | | |
|
||||
| | | yes | | | x |
|
||||
| | | no | | | |
|
||||
| | no | yes | | | x |
|
||||
| | yes | no | | | |
|
||||
| | | | yes | | x |
|
||||
| | | | no | | |
|
||||
| | no | | yes | | x |
|
||||
| | yes | | no | | |
|
||||
| | | no | yes | | x |
|
||||
| | | yes | no | | |
|
||||
| runway | | | | | x |
|
||||
| runway | yes | | | | x |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | | x |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | | x |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | | x |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | | x |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | | x |
|
||||
| runway | | yes | no | | |
|
||||
| highway | access:forward | vehicle:forward | bicycle:forward | forw | backw |
|
||||
| primary | | | | | cycling |
|
||||
| primary | yes | | | | cycling |
|
||||
| primary | no | | | | |
|
||||
| primary | | yes | | | cycling |
|
||||
| primary | | no | | | |
|
||||
| primary | no | yes | | | cycling |
|
||||
| primary | yes | no | | | |
|
||||
| primary | | | yes | | cycling |
|
||||
| primary | | | no | | |
|
||||
| primary | no | | yes | | cycling |
|
||||
| primary | yes | | no | | |
|
||||
| primary | | no | yes | | cycling |
|
||||
| primary | | yes | no | | |
|
||||
| runway | | | | | cycling |
|
||||
| runway | yes | | | | cycling |
|
||||
| runway | no | | | | |
|
||||
| runway | | yes | | | cycling |
|
||||
| runway | | no | | | |
|
||||
| runway | no | yes | | | cycling |
|
||||
| runway | yes | no | | | |
|
||||
| runway | | | yes | | cycling |
|
||||
| runway | | | no | | |
|
||||
| runway | no | | yes | | cycling |
|
||||
| runway | yes | | no | | |
|
||||
| runway | | no | yes | | cycling |
|
||||
| runway | | yes | no | | |
|
||||
|
||||
Scenario: Bike - Overwriting implied acccess on ways
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| cycleway | | | | x |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | x |
|
||||
| runway | | yes | | x |
|
||||
| runway | | | yes | x |
|
||||
| highway | access | vehicle | bicycle | bothw |
|
||||
| cycleway | | | | cycling |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | cycling |
|
||||
| runway | | yes | | cycling |
|
||||
| runway | | | yes | cycling |
|
||||
|
||||
Scenario: Bike - Access tags on ways
|
||||
Then routability should be
|
||||
| access | vehicle | bicycle | bothw |
|
||||
| | | | x |
|
||||
| yes | | | x |
|
||||
| permissive | | | x |
|
||||
| designated | | | x |
|
||||
| some_tag | | | x |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | x |
|
||||
| | permissive | | x |
|
||||
| | designated | | x |
|
||||
| | some_tag | | x |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | x |
|
||||
| | | permissive | x |
|
||||
| | | designated | x |
|
||||
| | | some_tag | x |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
| access | vehicle | bicycle | bothw |
|
||||
| | | | cycling |
|
||||
| yes | | | cycling |
|
||||
| permissive | | | cycling |
|
||||
| designated | | | cycling |
|
||||
| some_tag | | | cycling |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | cycling |
|
||||
| | permissive | | cycling |
|
||||
| | designated | | cycling |
|
||||
| | some_tag | | cycling |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | cycling |
|
||||
| | | permissive | cycling |
|
||||
| | | designated | cycling |
|
||||
| | | some_tag | cycling |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
|
||||
Scenario: Bike - Access tags on both node and way
|
||||
Then routability should be
|
||||
| access | node/access | bothw |
|
||||
| yes | yes | x |
|
||||
| yes | no | |
|
||||
| yes | some_tag | x |
|
||||
| no | yes | |
|
||||
| no | no | |
|
||||
| no | some_tag | |
|
||||
| some_tag | yes | x |
|
||||
| some_tag | no | |
|
||||
| some_tag | some_tag | x |
|
||||
| access | node/access | bothw |
|
||||
| yes | yes | cycling |
|
||||
| yes | no | |
|
||||
| yes | some_tag | cycling |
|
||||
| no | yes | |
|
||||
| no | no | |
|
||||
| no | some_tag | |
|
||||
| some_tag | yes | cycling |
|
||||
| some_tag | no | |
|
||||
| some_tag | some_tag | cycling |
|
||||
|
||||
Scenario: Bike - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | vehicle | bicycle | forw | backw |
|
||||
| runway | private | | yes | x | x |
|
||||
| footway | | no | permissive | x | x |
|
||||
| motorway | | | yes | x | |
|
||||
| track | forestry | | permissive | x | x |
|
||||
| cycleway | yes | designated | no | | |
|
||||
| primary | | yes | private | | |
|
||||
| residential | permissive | | no | | |
|
||||
| highway | access | vehicle | bicycle | forw | backw |
|
||||
| runway | private | | yes | cycling | cycling |
|
||||
| footway | | no | permissive | cycling | cycling |
|
||||
| motorway | | | yes | cycling | |
|
||||
| track | forestry | | permissive | cycling | cycling |
|
||||
| cycleway | yes | designated | no | | |
|
||||
| primary | | yes | private | | |
|
||||
| residential | permissive | | no | | |
|
||||
|
||||
Scenario: Bike - Ignore access tags for other modes
|
||||
Then routability should be
|
||||
| highway | boat | motor_vehicle | moped | bothw |
|
||||
| river | yes | | | |
|
||||
| cycleway | no | | | x |
|
||||
| runway | | yes | | |
|
||||
| cycleway | | no | | x |
|
||||
| runway | | | yes | |
|
||||
| cycleway | | | no | x |
|
||||
| highway | boat | motor_vehicle | moped | bothw |
|
||||
| river | yes | | | |
|
||||
| cycleway | no | | | cycling |
|
||||
| runway | | yes | | |
|
||||
| cycleway | | no | | cycling |
|
||||
| runway | | | yes | |
|
||||
| cycleway | | | no | cycling |
|
||||
|
||||
Scenario: Bike - Bridleways when access is explicit
|
||||
Then routability should be
|
||||
| highway | horse | foot | bicycle | bothw |
|
||||
| bridleway | | | yes | x |
|
||||
| bridleway | | yes | | x |
|
||||
| bridleway | designated | | | |
|
||||
| bridleway | | | | |
|
||||
| highway | horse | foot | bicycle | bothw |
|
||||
| bridleway | | | yes | cycling |
|
||||
| bridleway | | yes | | pushing bike |
|
||||
| bridleway | designated | | | |
|
||||
| bridleway | | | | |
|
||||
|
||||
Scenario: Bike - Tram with oneway when access is implicit
|
||||
Then routability should be
|
||||
| highway | railway | access | oneway | forw | backw |
|
||||
| residential | tram | | yes | cycling | pushing bike |
|
||||
| service | tram | psv | yes | cycling | pushing bike |
|
||||
|
||||
Scenario: Bike - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | cycling |
|
||||
| steps | permissive | cycling |
|
||||
| footway | permissive | cycling |
|
||||
| garbagetag | permissive | cycling |
|
||||
|
||||
@@ -7,62 +7,62 @@ Feature: Bike - Access tags on nodes
|
||||
|
||||
Scenario: Bike - Access tag hierarchy on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
||||
| | | | | x |
|
||||
| yes | | | | x |
|
||||
| no | | | | |
|
||||
| | yes | | | x |
|
||||
| | no | | | |
|
||||
| no | yes | | | x |
|
||||
| yes | no | | | |
|
||||
| | | yes | | x |
|
||||
| | | no | | |
|
||||
| | | no | crossing | x |
|
||||
| no | | yes | | x |
|
||||
| yes | | no | | |
|
||||
| | no | yes | | x |
|
||||
| | yes | no | | |
|
||||
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
|
||||
| | | | | cycling |
|
||||
| yes | | | | cycling |
|
||||
| no | | | | |
|
||||
| | yes | | | cycling |
|
||||
| | no | | | |
|
||||
| no | yes | | | cycling |
|
||||
| yes | no | | | |
|
||||
| | | yes | | cycling |
|
||||
| | | no | | |
|
||||
| | | no | crossing | cycling |
|
||||
| no | | yes | | cycling |
|
||||
| yes | | no | | |
|
||||
| | no | yes | | cycling |
|
||||
| | yes | no | | |
|
||||
|
||||
Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way
|
||||
Then routability should be
|
||||
| highway | node/access | node/vehicle | node/bicycle | bothw |
|
||||
| cycleway | | | | x |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | |
|
||||
| runway | | yes | | |
|
||||
| runway | | | yes | |
|
||||
| highway | node/access | node/vehicle | node/bicycle | bothw |
|
||||
| cycleway | | | | cycling |
|
||||
| runway | | | | |
|
||||
| cycleway | no | | | |
|
||||
| cycleway | | no | | |
|
||||
| cycleway | | | no | |
|
||||
| runway | yes | | | |
|
||||
| runway | | yes | | |
|
||||
| runway | | | yes | |
|
||||
|
||||
Scenario: Bike - Access tags on nodes
|
||||
Then routability should be
|
||||
| node/access | node/vehicle | node/bicycle | bothw |
|
||||
| | | | x |
|
||||
| yes | | | x |
|
||||
| permissive | | | x |
|
||||
| designated | | | x |
|
||||
| some_tag | | | x |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | x |
|
||||
| | permissive | | x |
|
||||
| | designated | | x |
|
||||
| | some_tag | | x |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | x |
|
||||
| | | permissive | x |
|
||||
| | | designated | x |
|
||||
| | | some_tag | x |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
| node/access | node/vehicle | node/bicycle | bothw |
|
||||
| | | | cycling |
|
||||
| yes | | | cycling |
|
||||
| permissive | | | cycling |
|
||||
| designated | | | cycling |
|
||||
| some_tag | | | cycling |
|
||||
| no | | | |
|
||||
| private | | | |
|
||||
| agricultural | | | |
|
||||
| forestry | | | |
|
||||
| delivery | | | |
|
||||
| | yes | | cycling |
|
||||
| | permissive | | cycling |
|
||||
| | designated | | cycling |
|
||||
| | some_tag | | cycling |
|
||||
| | no | | |
|
||||
| | private | | |
|
||||
| | agricultural | | |
|
||||
| | forestry | | |
|
||||
| | delivery | | |
|
||||
| | | yes | cycling |
|
||||
| | | permissive | cycling |
|
||||
| | | designated | cycling |
|
||||
| | | some_tag | cycling |
|
||||
| | | no | |
|
||||
| | | private | |
|
||||
| | | agricultural | |
|
||||
| | | forestry | |
|
||||
| | | delivery | |
|
||||
|
||||
@@ -71,17 +71,17 @@ Feature: Bike - Squares and other areas
|
||||
| abcda | (nil) | parking |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| x | y | xa,abcda,by,by |
|
||||
| y | x | by,abcda,xa,xa |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| from | to | route |
|
||||
| x | y | xa,abcda,by |
|
||||
| y | x | by,abcda,xa |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
|
||||
|
||||
@train @platform
|
||||
@@ -99,14 +99,14 @@ Feature: Bike - Squares and other areas
|
||||
| abcda | (nil) | platform |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| x | y | xa,abcda,by,by |
|
||||
| y | x | by,abcda,xa,xa |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| from | to | route |
|
||||
| x | y | xa,abcda,by |
|
||||
| y | x | by,abcda,xa |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
| c | b | abcda,abcda |
|
||||
| c | d | abcda,abcda |
|
||||
| d | c | abcda,abcda |
|
||||
| d | a | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
|
||||
@@ -7,9 +7,9 @@ Feature: Bicycle - Handle cycling
|
||||
Scenario: Bicycle - Use a ferry route
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -19,22 +19,22 @@ Feature: Bicycle - Handle cycling
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| from | to | route | modes |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling |
|
||||
| e | c | cde,cde | cycling,cycling |
|
||||
| e | c | cde,cde | cycling,cycling |
|
||||
| e | b | cde,abc,abc | cycling,cycling,cycling |
|
||||
| e | a | cde,abc,abc | cycling,cycling,cycling |
|
||||
| c | e | cde,cde | cycling,cycling |
|
||||
| c | e | cde,cde | cycling,cycling |
|
||||
| c | f | cde,efg,efg | cycling,cycling,cycling |
|
||||
| c | g | cde,efg,efg | cycling,cycling,cycling |
|
||||
|
||||
Scenario: Bicycle - Properly handle durations
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -44,8 +44,8 @@ Feature: Bicycle - Handle cycling
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 4 km/h |
|
||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 6 km/h |
|
||||
| b | f | abc,cde,efg,efg | cycling,cycling,cycling,cycling | 5 km/h |
|
||||
| c | e | cde,cde | cycling,cycling | 2 km/h |
|
||||
| e | c | cde,cde | cycling,cycling | 2 km/h |
|
||||
|
||||
@@ -79,3 +79,19 @@ Feature: Bike - Cycle tracks/lanes
|
||||
| residential | lane | yes | x | x |
|
||||
| footway | lane | yes | x | x |
|
||||
| cycleway | lane | yes | x | x |
|
||||
|
||||
Scenario: Bike - Cycleway on oneways, modes
|
||||
Then routability should be
|
||||
| highway | cycleway | oneway | forw | backw |
|
||||
| motorway | track | yes | cycling | |
|
||||
| residential | track | yes | cycling | pushing bike |
|
||||
| cycleway | track | yes | cycling | pushing bike |
|
||||
| footway | track | yes | pushing bike | pushing bike |
|
||||
|
||||
Scenario: Bike - Cycleway on oneways, speeds
|
||||
Then routability should be
|
||||
| highway | cycleway | oneway | forw | backw |
|
||||
| motorway | track | yes | 15 km/h | |
|
||||
| residential | track | yes | 15 km/h | 6 km/h |
|
||||
| cycleway | track | yes | 15 km/h | 6 km/h |
|
||||
| footway | track | yes | 6 km/h +-1 | 6 km/h +-1 |
|
||||
|
||||
@@ -64,6 +64,6 @@ Feature: Bike - Handle ferry routes
|
||||
| abcd | | ferry | yes | 1:00 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s +-10 |
|
||||
| d | a | abcd,abcd | 3600s +-10 |
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s |
|
||||
| d | a | abcd,abcd | 3600s |
|
||||
|
||||
@@ -7,15 +7,15 @@ Feature: Bike - Max speed restrictions
|
||||
|
||||
Scenario: Bicycle - Respect maxspeeds when lower that way type speed
|
||||
Then routability should be
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h +- 1 |
|
||||
| residential | 10 | 10 km/h +- 1 |
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h |
|
||||
| residential | 10 | 9 km/h |
|
||||
|
||||
Scenario: Bicycle - Ignore maxspeed when higher than way speed
|
||||
Then routability should be
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h +- 1 |
|
||||
| residential | 80 | 15 km/h |
|
||||
| highway | maxspeed | bothw |
|
||||
| residential | | 15 km/h |
|
||||
| residential | 80 | 15 km/h |
|
||||
|
||||
@todo
|
||||
Scenario: Bicycle - Maxspeed formats
|
||||
@@ -63,14 +63,14 @@ Feature: Bike - Max speed restrictions
|
||||
| snail | 720s ~10% |
|
||||
|
||||
Then routability should be
|
||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| | | | 15 km/h +- 1 | 15 km/h +- 1 |
|
||||
| 10 | | | 10 km/h +- 1 | 10 km/h +- 1 |
|
||||
| | 10 | | 10 km/h +- 1 | 15 km/h +- 1 |
|
||||
| | | 10 | 15 km/h | 10 km/h +- 1 |
|
||||
| 2 | 10 | | 10 km/h +- 1 | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 10 km/h +- 1 |
|
||||
| 2 | 5 | 10 | 5 km/h | 10 km/h +- 1 |
|
||||
| maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| | | | 15 km/h | 15 km/h |
|
||||
| 10 | | | 9 km/h | 9 km/h |
|
||||
| | 10 | | 9 km/h | 15 km/h |
|
||||
| | | 10 | 14 km/h | 9 km/h |
|
||||
| 2 | 10 | | 9 km/h | 2 km/h |
|
||||
| 2 | | 10 | 2 km/h | 9 km/h |
|
||||
| 2 | 5 | 10 | 5 km/h | 9 km/h |
|
||||
|
||||
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
|
||||
Then routability should be
|
||||
|
||||
@@ -159,7 +159,7 @@ Feature: Bike - Mode flag
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| a | c | ab,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
||||
| b | d | bc,cd,cd | pushing bike,cycling,cycling |
|
||||
|
||||
Scenario: Bicycle - Modes when starting on forward oneway
|
||||
Given the node map
|
||||
|
||||
@@ -17,8 +17,8 @@ Feature: Bike - Street names in instructions
|
||||
| bc | Your Way | A7 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way,Your Way | A6,A7,A7 |
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way | A6,A7 |
|
||||
|
||||
@unnamed
|
||||
Scenario: Bike - No longer use way type to describe unnamed ways, see #3231
|
||||
|
||||
@@ -8,13 +8,15 @@ Feature: Bike - Oneway streets
|
||||
|
||||
Scenario: Bike - Simple oneway
|
||||
Then routability should be
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | yes | x | |
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | yes | cycling | |
|
||||
| primary | | yes | cycling | pushing bike |
|
||||
|
||||
Scenario: Simple reverse oneway
|
||||
Then routability should be
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | -1 | | x |
|
||||
| highway | foot | oneway | forw | backw |
|
||||
| primary | no | -1 | | cycling |
|
||||
| primary | | -1 | pushing bike | cycling |
|
||||
|
||||
Scenario: Bike - Around the Block
|
||||
Given the node map
|
||||
@@ -39,83 +41,83 @@ Feature: Bike - Oneway streets
|
||||
|
||||
Scenario: Bike - Handle various oneway tag values
|
||||
Then routability should be
|
||||
| foot | oneway | forw | backw |
|
||||
| no | | x | x |
|
||||
| no | nonsense | x | x |
|
||||
| no | no | x | x |
|
||||
| no | false | x | x |
|
||||
| no | 0 | x | x |
|
||||
| no | yes | x | |
|
||||
| no | true | x | |
|
||||
| no | 1 | x | |
|
||||
| no | -1 | | x |
|
||||
| foot | oneway | forw | backw |
|
||||
| no | | cycling | cycling |
|
||||
| no | nonsense | cycling | cycling |
|
||||
| no | no | cycling | cycling |
|
||||
| no | false | cycling | cycling |
|
||||
| no | 0 | cycling | cycling |
|
||||
| no | yes | cycling | |
|
||||
| no | true | cycling | |
|
||||
| no | 1 | cycling | |
|
||||
| no | -1 | | cycling |
|
||||
|
||||
Scenario: Bike - Implied oneways
|
||||
Then routability should be
|
||||
| highway | foot | bicycle | junction | forw | backw | # |
|
||||
| | no | | | x | x | |
|
||||
| | no | | roundabout | x | | |
|
||||
| motorway | no | yes | | x | | |
|
||||
| motorway_link | no | yes | | x | x | does not imply oneway |
|
||||
| motorway | no | yes | roundabout | x | | |
|
||||
| motorway_link | no | yes | roundabout | x | | |
|
||||
| highway | foot | bicycle | junction | forw | backw | # |
|
||||
| | no | | | cycling | cycling | |
|
||||
| | no | | roundabout | cycling | | |
|
||||
| motorway | no | yes | | cycling | | |
|
||||
| motorway_link | no | yes | | cycling | cycling | does not imply oneway |
|
||||
| motorway | no | yes | roundabout | cycling | | |
|
||||
| motorway_link | no | yes | roundabout | cycling | | |
|
||||
|
||||
Scenario: Bike - Overriding implied oneways
|
||||
Then routability should be
|
||||
| highway | foot | junction | oneway | forw | backw |
|
||||
| primary | no | roundabout | no | x | x |
|
||||
| primary | no | roundabout | yes | x | |
|
||||
| motorway_link | no | | -1 | | |
|
||||
| trunk_link | no | | -1 | | |
|
||||
| primary | no | roundabout | -1 | | x |
|
||||
| highway | foot | junction | oneway | forw | backw |
|
||||
| primary | no | roundabout | no | cycling | cycling |
|
||||
| primary | no | roundabout | yes | cycling | |
|
||||
| motorway_link | no | | -1 | | |
|
||||
| trunk_link | no | | -1 | | |
|
||||
| primary | no | roundabout | -1 | | cycling |
|
||||
|
||||
Scenario: Bike - Oneway:bicycle should override normal oneways tags
|
||||
Then routability should be
|
||||
| foot | oneway:bicycle | oneway | junction | forw | backw |
|
||||
| no | yes | | | x | |
|
||||
| no | yes | yes | | x | |
|
||||
| no | yes | no | | x | |
|
||||
| no | yes | -1 | | x | |
|
||||
| no | yes | | roundabout | x | |
|
||||
| no | no | | | x | x |
|
||||
| no | no | yes | | x | x |
|
||||
| no | no | no | | x | x |
|
||||
| no | no | -1 | | x | x |
|
||||
| no | no | | roundabout | x | x |
|
||||
| no | -1 | | | | x |
|
||||
| no | -1 | yes | | | x |
|
||||
| no | -1 | no | | | x |
|
||||
| no | -1 | -1 | | | x |
|
||||
| no | -1 | | roundabout | | x |
|
||||
| foot | oneway:bicycle | oneway | junction | forw | backw |
|
||||
| no | yes | | | cycling | |
|
||||
| no | yes | yes | | cycling | |
|
||||
| no | yes | no | | cycling | |
|
||||
| no | yes | -1 | | cycling | |
|
||||
| no | yes | | roundabout | cycling | |
|
||||
| no | no | | | cycling | cycling |
|
||||
| no | no | yes | | cycling | cycling |
|
||||
| no | no | no | | cycling | cycling |
|
||||
| no | no | -1 | | cycling | cycling |
|
||||
| no | no | | roundabout | cycling | cycling |
|
||||
| no | -1 | | | | cycling |
|
||||
| no | -1 | yes | | | cycling |
|
||||
| no | -1 | no | | | cycling |
|
||||
| no | -1 | -1 | | | cycling |
|
||||
| no | -1 | | roundabout | | cycling |
|
||||
|
||||
Scenario: Bike - Contra flow
|
||||
Then routability should be
|
||||
| foot | oneway | cycleway | forw | backw |
|
||||
| no | yes | opposite | x | x |
|
||||
| no | yes | opposite_track | x | x |
|
||||
| no | yes | opposite_lane | x | x |
|
||||
| no | -1 | opposite | x | x |
|
||||
| no | -1 | opposite_track | x | x |
|
||||
| no | -1 | opposite_lane | x | x |
|
||||
| no | no | opposite | x | x |
|
||||
| no | no | opposite_track | x | x |
|
||||
| no | no | opposite_lane | x | x |
|
||||
| foot | oneway | cycleway | forw | backw |
|
||||
| no | yes | opposite | cycling | cycling |
|
||||
| no | yes | opposite_track | cycling | cycling |
|
||||
| no | yes | opposite_lane | cycling | cycling |
|
||||
| no | -1 | opposite | cycling | cycling |
|
||||
| no | -1 | opposite_track | cycling | cycling |
|
||||
| no | -1 | opposite_lane | cycling | cycling |
|
||||
| no | no | opposite | cycling | cycling |
|
||||
| no | no | opposite_track | cycling | cycling |
|
||||
| no | no | opposite_lane | cycling | cycling |
|
||||
|
||||
Scenario: Bike - Should not be affected by car tags
|
||||
Then routability should be
|
||||
| foot | junction | oneway | oneway:car | forw | backw |
|
||||
| no | | yes | yes | x | |
|
||||
| no | | yes | no | x | |
|
||||
| no | | yes | -1 | x | |
|
||||
| no | | no | yes | x | x |
|
||||
| no | | no | no | x | x |
|
||||
| no | | no | -1 | x | x |
|
||||
| no | | -1 | yes | | x |
|
||||
| no | | -1 | no | | x |
|
||||
| no | | -1 | -1 | | x |
|
||||
| no | roundabout | | yes | x | |
|
||||
| no | roundabout | | no | x | |
|
||||
| no | roundabout | | -1 | x | |
|
||||
| foot | junction | oneway | oneway:car | forw | backw |
|
||||
| no | | yes | yes | cycling | |
|
||||
| no | | yes | no | cycling | |
|
||||
| no | | yes | -1 | cycling | |
|
||||
| no | | no | yes | cycling | cycling |
|
||||
| no | | no | no | cycling | cycling |
|
||||
| no | | no | -1 | cycling | cycling |
|
||||
| no | | -1 | yes | | cycling |
|
||||
| no | | -1 | no | | cycling |
|
||||
| no | | -1 | -1 | | cycling |
|
||||
| no | roundabout | | yes | cycling | |
|
||||
| no | roundabout | | no | cycling | |
|
||||
| no | roundabout | | -1 | cycling | |
|
||||
|
||||
Scenario: Bike - Two consecutive oneways
|
||||
Given the node map
|
||||
|
||||
@@ -3,34 +3,30 @@ Feature: Bike - Accessability of different way types
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given the shortcuts
|
||||
| key | value |
|
||||
| bike | 15 km/h ~20% |
|
||||
| foot | 5 km/h ~20% |
|
||||
|
||||
Scenario: Bike - Pushing bikes on pedestrian-only ways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| cycleway | | bike | bike |
|
||||
| primary | | bike | bike |
|
||||
| pedestrian | | foot | foot |
|
||||
| footway | | foot | foot |
|
||||
| primary | yes | bike | foot |
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| cycleway | | cycling | cycling |
|
||||
| primary | | cycling | cycling |
|
||||
| pedestrian | | pushing bike | pushing bike |
|
||||
| cycleway | | cycling | cycling |
|
||||
| primary | yes | cycling | pushing bike |
|
||||
|
||||
Scenario: Bike - Pushing bikes against normal oneways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | yes | bike | foot |
|
||||
| pedestrian | yes | foot | foot |
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | yes | cycling | pushing bike |
|
||||
| pedestrian | yes | pushing bike | pushing bike |
|
||||
|
||||
Scenario: Bike - Pushing bikes against reverse oneways
|
||||
Then routability should be
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | -1 | foot | bike |
|
||||
| pedestrian | -1 | foot | foot |
|
||||
| highway | oneway | forw | backw |
|
||||
| (nil) | | | |
|
||||
| primary | -1 | pushing bike | cycling |
|
||||
| pedestrian | -1 | pushing bike | pushing bike |
|
||||
|
||||
@square
|
||||
Scenario: Bike - Push bikes on pedestrian areas
|
||||
@@ -47,7 +43,7 @@ Feature: Bike - Accessability of different way types
|
||||
| abcda | yes | pedestrian |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| from | to | route |
|
||||
| a | b | abcda,abcda |
|
||||
| a | d | abcda,abcda |
|
||||
| b | c | abcda,abcda |
|
||||
@@ -59,19 +55,19 @@ Feature: Bike - Accessability of different way types
|
||||
|
||||
Scenario: Bike - Pushing bikes on ways with foot=yes
|
||||
Then routability should be
|
||||
| highway | foot | forw | backw |
|
||||
| motorway | | | |
|
||||
| motorway | yes | foot | |
|
||||
| runway | | | |
|
||||
| runway | yes | foot | foot |
|
||||
| highway | foot | forw | backw |
|
||||
| motorway | | | |
|
||||
| motorway | yes | pushing bike | |
|
||||
| runway | | | |
|
||||
| runway | yes | pushing bike | pushing bike |
|
||||
|
||||
@todo
|
||||
Scenario: Bike - Pushing bikes on ways with foot=yes in one direction
|
||||
Then routability should be
|
||||
| highway | foot:forward | foot:backward | forw | backw |
|
||||
| motorway | | | | |
|
||||
| motorway | yes | | foot | |
|
||||
| motorway | | yes | | foot |
|
||||
| highway | foot:forward | foot:backward | forw | backw |
|
||||
| motorway | | | | |
|
||||
| motorway | yes | | pushing bike | |
|
||||
| motorway | | yes | | pushing bike |
|
||||
|
||||
@construction
|
||||
Scenario: Bike - Don't allow routing on ways still under construction
|
||||
@@ -104,11 +100,11 @@ Feature: Bike - Accessability of different way types
|
||||
| cf | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
| from | to | route | modes |
|
||||
| a | d | ab,bc,cd,cd | cycling,cycling,cycling,cycling |
|
||||
| d | a | cd,bc,ab,ab | cycling,pushing bike,cycling,cycling |
|
||||
| c | a | bc,ab,ab | pushing bike,cycling,cycling |
|
||||
| d | b | cd,bc,bc | cycling,pushing bike,pushing bike |
|
||||
|
||||
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
|
||||
Given the node map
|
||||
|
||||
@@ -5,6 +5,7 @@ Feature: Bike - Turn restrictions
|
||||
|
||||
Background:
|
||||
Given the profile "bicycle"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
@no_turning
|
||||
Scenario: Bike - No left turn
|
||||
|
||||
@@ -6,27 +6,28 @@ Feature: Bike - Surfaces
|
||||
|
||||
Scenario: Bicycle - Slow surfaces
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | asphalt | 47.9 s|
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | cobblestone | 120 s |
|
||||
| cycleway | fine_gravel | 120 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120 s |
|
||||
| cycleway | dirt | 120 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240 s |
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| cycleway | asphalt | 48 s |
|
||||
| cycleway | cobblestone:flattened | 72 s |
|
||||
| cycleway | paving_stones | 72 s |
|
||||
| cycleway | compacted | 72 s |
|
||||
| cycleway | cobblestone | 120 s |
|
||||
| cycleway | fine_gravel | 120 s |
|
||||
| cycleway | gravel | 120 s |
|
||||
| cycleway | pebblestone | 120.1 s |
|
||||
| cycleway | dirt | 120 s |
|
||||
| cycleway | earth | 120 s |
|
||||
| cycleway | grass | 120 s |
|
||||
| cycleway | mud | 240 s |
|
||||
| cycleway | sand | 240.1 s |
|
||||
| cycleway | sett | 72 s |
|
||||
|
||||
Scenario: Bicycle - Good surfaces on small paths
|
||||
Then routability should be
|
||||
| highway | surface | bothw |
|
||||
| cycleway | | 48 s |
|
||||
| path | | 59.9 s|
|
||||
| path | | 60 s |
|
||||
| track | | 60 s |
|
||||
| track | asphalt | 60 s |
|
||||
| path | asphalt | 60 s |
|
||||
|
||||
@@ -7,33 +7,33 @@ Feature: Bike - Handle ferry routes
|
||||
|
||||
Scenario: Bike - Bringing bikes on trains
|
||||
Then routability should be
|
||||
| highway | railway | bicycle | bothw |
|
||||
| primary | | | x |
|
||||
| (nil) | train | | |
|
||||
| (nil) | train | no | |
|
||||
| (nil) | train | yes | x |
|
||||
| (nil) | railway | | |
|
||||
| (nil) | railway | no | |
|
||||
| (nil) | railway | yes | x |
|
||||
| (nil) | subway | | |
|
||||
| (nil) | subway | no | |
|
||||
| (nil) | subway | yes | x |
|
||||
| (nil) | tram | | |
|
||||
| (nil) | tram | no | |
|
||||
| (nil) | tram | yes | x |
|
||||
| (nil) | light_rail | | |
|
||||
| (nil) | light_rail | no | |
|
||||
| (nil) | light_rail | yes | x |
|
||||
| (nil) | monorail | | |
|
||||
| (nil) | monorail | no | |
|
||||
| (nil) | monorail | yes | x |
|
||||
| (nil) | some_tag | | |
|
||||
| (nil) | some_tag | no | |
|
||||
| (nil) | some_tag | yes | x |
|
||||
| highway | railway | bicycle | bothw |
|
||||
| primary | | | cycling |
|
||||
| (nil) | train | | |
|
||||
| (nil) | train | no | |
|
||||
| (nil) | train | yes | train |
|
||||
| (nil) | railway | | |
|
||||
| (nil) | railway | no | |
|
||||
| (nil) | railway | yes | train |
|
||||
| (nil) | subway | | |
|
||||
| (nil) | subway | no | |
|
||||
| (nil) | subway | yes | train |
|
||||
| (nil) | tram | | |
|
||||
| (nil) | tram | no | |
|
||||
| (nil) | tram | yes | train |
|
||||
| (nil) | light_rail | | |
|
||||
| (nil) | light_rail | no | |
|
||||
| (nil) | light_rail | yes | train |
|
||||
| (nil) | monorail | | |
|
||||
| (nil) | monorail | no | |
|
||||
| (nil) | monorail | yes | train |
|
||||
| (nil) | some_tag | | |
|
||||
| (nil) | some_tag | no | |
|
||||
| (nil) | some_tag | yes | cycling |
|
||||
|
||||
@construction
|
||||
Scenario: Bike - Don't route on railways under construction
|
||||
Then routability should be
|
||||
| highway | railway | bicycle | bothw |
|
||||
| primary | | | x |
|
||||
| (nil) | construction | yes | |
|
||||
| highway | railway | bicycle | bothw |
|
||||
| primary | | | cycling |
|
||||
| (nil) | construction | yes | |
|
||||
|
||||
@@ -3,6 +3,7 @@ Feature: Turn Penalties
|
||||
|
||||
Background:
|
||||
Given the profile "turnbot"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Scenario: Bike - turns should incur a delay that depend on the angle
|
||||
|
||||
@@ -26,10 +27,10 @@ Feature: Turn Penalties
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time | distance |
|
||||
| s | a | sj,ja,ja | 39s +-1 | 242m +-1 |
|
||||
| s | b | sj,jb,jb | 30s +-1 | 200m +-1 |
|
||||
| s | c | sj,jc,jc | 29s +-1 | 242m +-1 |
|
||||
| s | d | sj,jd,jd | 20s +-1 | 200m +-1 |
|
||||
| s | e | sj,je,je | 29s +-1 | 242m +-1 |
|
||||
| s | f | sj,jf,jf | 30s +-1 | 200m +-1 |
|
||||
| s | g | sj,jg,jg | 39s +-1 | 242m +-1 |
|
||||
| s | a | sj,ja,ja | 63s +-1 | 483m +-1 |
|
||||
| s | b | sj,jb,jb | 50s +-1 | 400m +-1 |
|
||||
| s | c | sj,jc,jc | 54s +-1 | 483m +-1 |
|
||||
| s | d | sj,jd,jd | 40s +-1 | 400m +-1 |
|
||||
| s | e | sj,je,je | 53s +-1 | 483m +-1 |
|
||||
| s | f | sj,jf,jf | 50s +-1 | 400m +-1 |
|
||||
| s | g | sj,jg,jg | 63s +-1 | 483m +-1 |
|
||||
|
||||
+113
-41
@@ -119,12 +119,13 @@ Feature: Car - Restricted access
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | |
|
||||
| private | x |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | |
|
||||
| delivery | x |
|
||||
| some_tag | x |
|
||||
| destination | x |
|
||||
|
||||
|
||||
Scenario: Car - Access tags on nodes
|
||||
@@ -134,11 +135,11 @@ Feature: Car - Restricted access
|
||||
| permissive | x |
|
||||
| designated | x |
|
||||
| no | |
|
||||
| private | |
|
||||
| private | x |
|
||||
| agricultural | |
|
||||
| forestry | |
|
||||
| psv | |
|
||||
| delivery | |
|
||||
| delivery | x |
|
||||
| some_tag | x |
|
||||
|
||||
Scenario: Car - Access tags on both node and way
|
||||
@@ -156,15 +157,15 @@ Feature: Car - Restricted access
|
||||
|
||||
Scenario: Car - Access combinations
|
||||
Then routability should be
|
||||
| highway | accesss | vehicle | motor_vehicle | motorcar | bothw |
|
||||
| runway | private | | | permissive | x |
|
||||
| primary | forestry | | yes | | x |
|
||||
| cycleway | | | designated | | x |
|
||||
| residential | | yes | no | | |
|
||||
| motorway | yes | permissive | | private | |
|
||||
| trunk | agricultural | designated | permissive | no | |
|
||||
| pedestrian | | | | | |
|
||||
| pedestrian | | | | destination | x |
|
||||
| highway | access | vehicle | motor_vehicle | motorcar | forw | backw | # |
|
||||
| runway | private | | | permissive | x | x | |
|
||||
| primary | forestry | | yes | | x | x | |
|
||||
| cycleway | | | designated | | x | x | |
|
||||
| residential | | yes | no | | | | |
|
||||
| motorway | yes | permissive | | private | x | | implied oneway |
|
||||
| trunk | agricultural | designated | permissive | no | | | |
|
||||
| pedestrian | | | | | | | |
|
||||
| pedestrian | | | | destination | | | temporary disabled #3773 |
|
||||
|
||||
Scenario: Car - Ignore access tags for other modes
|
||||
Then routability should be
|
||||
@@ -179,34 +180,45 @@ Feature: Car - Restricted access
|
||||
| primary | | | | no | x |
|
||||
|
||||
@hov
|
||||
Scenario: Car - only designated HOV ways are ignored by default
|
||||
Scenario: Car - designated HOV ways are rated low
|
||||
Then routability should be
|
||||
| highway | hov | bothw |
|
||||
| primary | designated | |
|
||||
| primary | yes | x |
|
||||
| primary | no | x |
|
||||
| highway | hov | bothw | forw_rate | backw_rate |
|
||||
| primary | designated | x | 18 | 18 |
|
||||
| primary | yes | x | 18 | 18 |
|
||||
| primary | no | x | 18 | 18 |
|
||||
|
||||
# Models:
|
||||
# https://www.openstreetmap.org/way/124891268
|
||||
# https://www.openstreetmap.org/way/237173472
|
||||
@hov
|
||||
Scenario: Car - I-66 use HOV-only roads with heavy penalty
|
||||
Then routability should be
|
||||
| highway | hov | hov:lanes | lanes | access | oneway | forw | backw | forw_rate |
|
||||
| motorway | designated | designated\|designated\|designated | 3 | hov | yes | x | | 25 |
|
||||
| motorway | lane | | 3 | designated | yes | x | | 25 |
|
||||
|
||||
@hov
|
||||
Scenario: Car - a way with all lanes HOV-designated is inaccessible by default (similar to hov=designated)
|
||||
Scenario: Car - a way with all lanes HOV-designated is highly penalized by default (similar to hov=designated)
|
||||
Then routability should be
|
||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw |
|
||||
| primary | designated | designated | | | | |
|
||||
| primary | | designated | | | x | |
|
||||
| primary | designated | | | | | x |
|
||||
| primary | designated\|designated | designated\|designated | | | | |
|
||||
| primary | designated\|no | designated\|no | | | x | x |
|
||||
| primary | yes\|no | yes\|no | | | x | x |
|
||||
| primary | | | | | x | x |
|
||||
| primary | designated | | | -1 | | x |
|
||||
| primary | | designated | | -1 | | |
|
||||
| primary | | | designated | yes | | |
|
||||
| primary | | | designated | -1 | | |
|
||||
| primary | | | designated\| | yes | x | |
|
||||
| primary | | | designated\| | -1 | | x |
|
||||
| primary | | | designated\|designated | yes | | |
|
||||
| primary | | | designated\|designated | -1 | | |
|
||||
| primary | | | designated\|yes | yes | x | |
|
||||
| primary | | | designated\|no | -1 | | x |
|
||||
| highway | hov:lanes:forward | hov:lanes:backward | hov:lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | designated | designated | | | x | x | 18 | 18 |
|
||||
# This test is flaky because non-deterministic turn generation sometimes emits a NoTurn here that is marked as restricted. #3769
|
||||
#| primary | | designated | | | x | x | 18 | 18 |
|
||||
#| primary | designated | | | | x | x | 18 | 18 |
|
||||
| primary | designated\|designated | designated\|designated | | | x | x | 18 | 18 |
|
||||
| primary | designated\|no | designated\|no | | | x | x | 18 | 18 |
|
||||
| primary | yes\|no | yes\|no | | | x | x | 18 | 18 |
|
||||
| primary | | | | | x | x | 18 | 18 |
|
||||
| primary | designated | | | -1 | | x | | 18 |
|
||||
| primary | | designated | | -1 | | x | | 18 |
|
||||
| primary | | | designated | yes | x | | 18 | |
|
||||
| primary | | | designated | -1 | | x | | 18 |
|
||||
| primary | | | designated\| | yes | x | | 18 | |
|
||||
| primary | | | designated\| | -1 | | x | | 18 |
|
||||
| primary | | | designated\|designated | yes | x | | 18 | |
|
||||
| primary | | | designated\|designated | -1 | | x | | 18 |
|
||||
| primary | | | designated\|yes | yes | x | | 18 | |
|
||||
| primary | | | designated\|no | -1 | | x | | 18 |
|
||||
|
||||
Scenario: Car - these toll roads always work
|
||||
Then routability should be
|
||||
@@ -214,12 +226,10 @@ Feature: Car - Restricted access
|
||||
| primary | no | x |
|
||||
| primary | snowmobile | x |
|
||||
|
||||
# To test this we need issue #2781
|
||||
@todo
|
||||
Scenario: Car - only toll=yes ways are ignored by default
|
||||
Scenario: Car - toll=yes ways are enabled by default
|
||||
Then routability should be
|
||||
| highway | toll | bothw |
|
||||
| primary | yes | |
|
||||
| primary | yes | x |
|
||||
|
||||
Scenario: Car - directional access tags
|
||||
Then routability should be
|
||||
@@ -232,3 +242,65 @@ Feature: Car - Restricted access
|
||||
| primary | no | | yes | | x |
|
||||
| primary | no | yes | | x | |
|
||||
| primary | no | yes | yes | x | x |
|
||||
|
||||
|
||||
Scenario: Car - barrier=gate should be routed over unless explicitely forbidden
|
||||
Then routability should be
|
||||
| node/barrier | access | bothw |
|
||||
| gate | | x |
|
||||
| gate | no | |
|
||||
| gate | yes | x |
|
||||
| gate | permissive | x |
|
||||
| gate | designated | x |
|
||||
| gate | private | x |
|
||||
| gate | garbagetag | x |
|
||||
|
||||
Scenario: Car - a way with conditional access
|
||||
Then routability should be
|
||||
| highway | vehicle:forward | vehicle:backward:conditional | forw | backw |
|
||||
| pedestrian | yes | delivery @ (20:00-11:00) | x | |
|
||||
|
||||
Scenario: Car - a way with a list of tags
|
||||
Then routability should be
|
||||
| highway | motor_vehicle | motor_vehicle:forward | motor_vehicle:backward | forw | backw | # |
|
||||
| primary | | no | destination | | x | |
|
||||
| primary | destination;agricultural | destination | | x | x | |
|
||||
| footway | | | destination | | | temporary #3373 |
|
||||
| track | destination;agricultural | destination | | | x | temporary #3373 |
|
||||
|
||||
Scenario: Car - Don't route over steps even if marked as accessible
|
||||
Then routability should be
|
||||
| highway | access | forw | backw |
|
||||
| steps | yes | | |
|
||||
| steps | no | | |
|
||||
| primary | | x | x |
|
||||
|
||||
Scenario: Car - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | x |
|
||||
| steps | permissive | |
|
||||
| footway | permissive | x |
|
||||
| garbagetag | permissive | x |
|
||||
|
||||
Scenario: Car - Access private blacklist
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| footway | yes | x |
|
||||
| pedestrian | private | |
|
||||
| footway | private | |
|
||||
| service | private | |
|
||||
| cycleway | private | |
|
||||
| track | private | |
|
||||
| footway | customers | |
|
||||
|
||||
Scenario: Car - Access blacklist
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | | x |
|
||||
| primary | emergency | |
|
||||
| primary | forestry | |
|
||||
| primary | agricultural | |
|
||||
| primary | psv | |
|
||||
| primary | no | |
|
||||
| primary | customers | x |
|
||||
|
||||
@@ -29,14 +29,14 @@ Feature: Car - Barriers
|
||||
| gate | permissive | x |
|
||||
| gate | designated | x |
|
||||
| gate | no | |
|
||||
| gate | private | |
|
||||
| gate | private | x |
|
||||
| gate | agricultural | |
|
||||
| wall | | |
|
||||
| wall | yes | x |
|
||||
| wall | permissive | x |
|
||||
| wall | designated | x |
|
||||
| wall | no | |
|
||||
| wall | private | |
|
||||
| wall | private | x |
|
||||
| wall | agricultural | |
|
||||
|
||||
Scenario: Car - Rising bollard exception for barriers
|
||||
|
||||
@@ -3,6 +3,7 @@ Feature: Car - Handle driving
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Scenario: Car - Use a ferry route
|
||||
Given the node map
|
||||
@@ -15,7 +16,7 @@ Feature: Car - Handle driving
|
||||
And the ways
|
||||
| nodes | highway | bridge | bicycle |
|
||||
| abc | primary | | |
|
||||
| cde | | movable | yes |
|
||||
| cde | primary | movable | yes |
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
@@ -29,6 +30,27 @@ Feature: Car - Handle driving
|
||||
| c | f | cde,efg,efg | driving,driving,driving |
|
||||
| c | g | cde,efg,efg | driving,driving,driving |
|
||||
|
||||
Scenario: Car - Control test without durations, osrm uses movable bridge speed to calculate duration
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | bridge |
|
||||
| abc | primary | |
|
||||
| cde | primary | movable |
|
||||
| efg | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 13 km/h | 340s +-1 |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 9 km/h | 318s +-1 |
|
||||
| c | e | cde,cde | driving,driving | 5 km/h | 295s +-1 |
|
||||
| e | c | cde,cde | driving,driving | 5 km/h | 295s +-1 |
|
||||
|
||||
Scenario: Car - Properly handle durations
|
||||
Given the node map
|
||||
"""
|
||||
@@ -40,12 +62,12 @@ Feature: Car - Handle driving
|
||||
And the ways
|
||||
| nodes | highway | bridge | duration |
|
||||
| abc | primary | | |
|
||||
| cde | | movable | 00:05:00 |
|
||||
| cde | primary | movable | 00:10:00 |
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 6 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 4 km/h |
|
||||
| a | g | abc,cde,efg,efg | driving,driving,driving,driving | 7 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,driving,driving,driving | 5 km/h |
|
||||
| c | e | cde,cde | driving,driving | 2 km/h |
|
||||
| e | c | cde,cde | driving,driving | 2 km/h |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@routing @car @destination @todo
|
||||
@routing @car @destination
|
||||
Feature: Car - Destination only, no passing through
|
||||
|
||||
Background:
|
||||
@@ -23,11 +23,11 @@ Feature: Car - Destination only, no passing through
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bcd,bcd |
|
||||
| a | c | ab,bcd |
|
||||
| a | d | ab,bcd,bcd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,bcd,bcd |
|
||||
| e | c | de,bcd |
|
||||
| e | b | de,bcd,bcd |
|
||||
| e | a | axye,axye |
|
||||
|
||||
@@ -51,12 +51,12 @@ Feature: Car - Destination only, no passing through
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | b | ab,ab |
|
||||
| a | c | ab,bc,bc |
|
||||
| a | d | ab,bc,cd,cd |
|
||||
| a | c | ab,bc |
|
||||
| a | d | ab,cd |
|
||||
| a | e | axye,axye |
|
||||
| e | d | de,de |
|
||||
| e | c | de,cd,cd |
|
||||
| e | b | de,cd,bc,bc |
|
||||
| e | c | de,cd |
|
||||
| e | b | de,bc |
|
||||
| e | a | axye,axye |
|
||||
|
||||
Scenario: Car - Routing inside a destination only area
|
||||
@@ -81,3 +81,53 @@ Feature: Car - Destination only, no passing through
|
||||
| e | a | de,cd,bc,ab,ab |
|
||||
| b | d | bc,cd,cd |
|
||||
| d | b | cd,bc,bc |
|
||||
|
||||
Scenario: Car - Routing around a way that becomes destination only
|
||||
Given the node map
|
||||
"""
|
||||
b
|
||||
\
|
||||
|
|
||||
e++d++++++c--i
|
||||
| \
|
||||
\ h--a
|
||||
\ |
|
||||
\___________g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | access | oneway |
|
||||
| ah | | no |
|
||||
| ihg | | no |
|
||||
| eg | | no |
|
||||
| icde | | no |
|
||||
| cde | destination | no |
|
||||
| eb | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | # |
|
||||
| i | b | ihg,eg,eb,eb | # goes around access=destination, though restricted way starts at two node intersection |
|
||||
| b | d | eb,cde,cde | # ends in restricted way correctly |
|
||||
| b | i | eb,eg,ihg,ihg | # goes around restricted way correctly |
|
||||
|
||||
Scenario: Car - Routing around a way that becomes destination only
|
||||
Given the node map
|
||||
"""
|
||||
a---c---b
|
||||
+ \
|
||||
+ |
|
||||
d |
|
||||
\___e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | access | oneway |
|
||||
| acbe | | no |
|
||||
| cd | destination | no |
|
||||
| de | | no |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| e | a | acbe,acbe |
|
||||
| d | a | de,acbe,acbe |
|
||||
| c | d | cd,cd |
|
||||
|
||||
+31
-10
@@ -29,6 +29,27 @@ Feature: Car - Handle ferry routes
|
||||
| c | f | cde,efg,efg | ferry,driving,driving |
|
||||
| c | g | cde,efg,efg | ferry,driving,driving |
|
||||
|
||||
|
||||
Scenario: Car - Use default speeds to calculate duration if no duration given
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route |
|
||||
| abc | primary | |
|
||||
| cde | | ferry |
|
||||
| efg | primary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 12 km/h | 173.4s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 9 km/h | 162.4s |
|
||||
| c | e | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
||||
| e | c | cde,cde | ferry,ferry | 5 km/h | 151.4s |
|
||||
Scenario: Car - Properly handle simple durations
|
||||
Given the node map
|
||||
"""
|
||||
@@ -44,11 +65,11 @@ Feature: Car - Handle ferry routes
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
|
||||
Scenario: Car - Properly handle ISO 8601 durations
|
||||
Given the node map
|
||||
@@ -65,8 +86,8 @@ Feature: Car - Handle ferry routes
|
||||
| efg | primary | | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | modes | speed |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 23 km/h |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h |
|
||||
| from | to | route | modes | speed | time |
|
||||
| a | g | abc,cde,efg,efg | driving,ferry,driving,driving | 24 km/h | 89.4s |
|
||||
| b | f | abc,cde,efg,efg | driving,ferry,driving,driving | 18 km/h | 78.4s |
|
||||
| c | e | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
| e | c | cde,cde | ferry,ferry | 11 km/h | 67.4s |
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
@routing @car @hov
|
||||
Feature: Car - Handle driving
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
And a grid size of 100 meters
|
||||
|
||||
Scenario: Car - Avoid hov when not on hov
|
||||
Given the node map
|
||||
"""
|
||||
b=========c========================e====j
|
||||
~ ~ ~
|
||||
a ~ f----m
|
||||
| i |
|
||||
| | ----------------l
|
||||
| | /
|
||||
g_______________h______k_____n
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | hov |
|
||||
| ab | motorway_link | |
|
||||
| bcej | motorway | designated |
|
||||
| ag | primary | |
|
||||
| ghkn | primary | |
|
||||
| ih | primary | |
|
||||
| kl | secondary | |
|
||||
| lf | secondary | |
|
||||
| ci | motorway_link | |
|
||||
| ef | motorway_link | |
|
||||
| fm | secondary | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| a | m | ag,ghkn,kl,lf,fm,fm |
|
||||
| c | m | bcej,ef,fm,fm |
|
||||
@@ -6,7 +6,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
Given the profile "car"
|
||||
Given a grid size of 1000 meters
|
||||
|
||||
Scenario: Car - Respect maxspeeds when lower that way type speed
|
||||
Scenario: Car - Respect maxspeeds when lower than way type speed
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e f g
|
||||
@@ -23,7 +23,7 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 68 km/h |
|
||||
| a | b | ab,ab | 85 km/h |
|
||||
| b | c | bc,bc | 48 km/h |
|
||||
| c | d | cd,cd | 40 km/h |
|
||||
| d | e | de,de | 64 km/h |
|
||||
@@ -37,26 +37,30 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | maxspeed |
|
||||
| ab | residential | |
|
||||
| bc | residential | 90 |
|
||||
| cd | living_street | FR:urban |
|
||||
| nodes | highway | maxspeed | # |
|
||||
| ab | residential | | default residential speed is 25 |
|
||||
| bc | residential | 90 | |
|
||||
| cd | living_street | FR:urban | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab,ab | 20 km/h |
|
||||
| a | b | ab,ab | 25 km/h |
|
||||
# default residential speed is 25, don't mess with this
|
||||
| b | c | bc,bc | 72 km/h |
|
||||
# parsed maxspeeds are scaled by profile's speed_reduction value
|
||||
| c | d | cd,cd | 40 km/h |
|
||||
# symbolic posted speeds without explicit exceptions are parsed
|
||||
# from the profile's maxspeed_table_default table
|
||||
|
||||
Scenario: Car - Forward/backward maxspeed
|
||||
Scenario: Car - Forward/backward maxspeed are scaled by profile's speed_reduction if explicitly set
|
||||
Given a grid size of 100 meters
|
||||
|
||||
Then routability should be
|
||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| primary | | | | 52 km/h | 52 km/h |
|
||||
| primary | | | | 65 km/h | 65 km/h |
|
||||
| primary | 60 | | | 48 km/h | 48 km/h |
|
||||
| primary | | 60 | | 48 km/h | 48 km/h +- 5 |
|
||||
| primary | | | 60 | 52 km/h | 52 km/h +- 5 |
|
||||
| primary | | 60 | | 48 km/h | 65 km/h |
|
||||
| primary | | | 60 | 65 km/h | 48 km/h |
|
||||
| primary | 15 | 60 | | 48 km/h | 12 km/h |
|
||||
| primary | 15 | | 60 | 12 km/h | 48 km/h |
|
||||
| primary | 15 | 30 | 60 | 24 km/h | 48 km/h |
|
||||
@@ -81,56 +85,55 @@ OSRM will use 4/5 of the projected free-flow speed.
|
||||
Scenario: Car - Too narrow streets should be ignored or incur a penalty
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| primary | | | | | 52 km/h | 52 km/h |
|
||||
| primary | | 3 | | | 32 km/h | 32 km/h |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 3 | | | 29 km/h | 29 km/h |
|
||||
| primary | | | 60 | | 47 km/h | 52 km/h |
|
||||
| primary | | 3 | 60 | | 29 km/h | 32 km/h |
|
||||
| primary | | | | 60 | 52 km/h | 47 km/h |
|
||||
| primary | | 3 | | 60 | 32 km/h | 29 km/h |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h |
|
||||
| primary | 15 | 3 | 60 | | 29 km/h | 7 km/h |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
||||
| primary | 15 | 3 | | 60 | 7 km/h | 29 km/h |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
||||
| primary | 15 | 3 | 30 | 60 | 14 km/h | 29 km/h |
|
||||
| highway | maxspeed | width | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||
| primary | | 3 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
||||
| primary | 60 | 3 | | | 47 km/h | 47 km/h | 7 | 7 |
|
||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
||||
| primary | | 3 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
||||
| primary | | 3 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
||||
| primary | 15 | 3 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
||||
| primary | 15 | 3 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
||||
| primary | 15 | 3 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
||||
|
||||
Scenario: Car - Single lane streets be ignored or incur a penalty
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw |
|
||||
| primary | | | | | 52 km/h | 52 km/h |
|
||||
| primary | | 1 | | | 32 km/h | 32 km/h |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 1 | | | 29 km/h | 29 km/h |
|
||||
| primary | | | 60 | | 47 km/h | 52 km/h |
|
||||
| primary | | 1 | 60 | | 29 km/h | 32 km/h |
|
||||
| primary | | | | 60 | 52 km/h | 47 km/h |
|
||||
| primary | | 1 | | 60 | 32 km/h | 29 km/h |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h |
|
||||
| primary | 15 | 1 | 60 | | 29 km/h | 7 km/h |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h |
|
||||
| primary | 15 | 1 | | 60 | 7 km/h | 29 km/h |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h |
|
||||
| primary | 15 | 1 | 30 | 60 | 14 km/h | 29 km/h |
|
||||
| highway | maxspeed | lanes | maxspeed:forward | maxspeed:backward | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | | 64 km/h | 64 km/h | 18 | 18 |
|
||||
| primary | | 1 | | | 64 km/h | 64 km/h | 9 | 9 |
|
||||
| primary | 60 | | | | 47 km/h | 47 km/h | 13 | 13 |
|
||||
| primary | 60 | 1 | | | 47 km/h | 47 km/h | 7 | 7 |
|
||||
| primary | | | 60 | | 47 km/h | 64 km/h | 13 | 18 |
|
||||
| primary | | 1 | 60 | | 47 km/h | 64 km/h | 7 | 9 |
|
||||
| primary | | | | 60 | 64 km/h | 47 km/h | 18 | 13 |
|
||||
| primary | | 1 | | 60 | 64 km/h | 47 km/h | 9 | 7 |
|
||||
| primary | 15 | | 60 | | 47 km/h | 11 km/h | 13 | 3 |
|
||||
| primary | 15 | 1 | 60 | | 48 km/h | 12 km/h | 7 | 2 |
|
||||
| primary | 15 | | | 60 | 12 km/h | 47 km/h | 3 | 13 |
|
||||
| primary | 15 | 1 | | 60 | 12 km/h | 47 km/h | 2 | 7 |
|
||||
| primary | 15 | | 30 | 60 | 23 km/h | 47 km/h | 7 | 13 |
|
||||
| primary | 15 | 1 | 30 | 60 | 23 km/h | 47 km/h | 3 | 7 |
|
||||
|
||||
Scenario: Car - Single lane streets only incure a penalty for two-way streets
|
||||
Scenario: Car - Single lane streets only incur a penalty for two-way streets
|
||||
Then routability should be
|
||||
| highway | maxspeed | lanes | oneway | forw | backw |
|
||||
| primary | 30 | 1 | yes | 23 km/h | |
|
||||
| primary | 30 | 1 | -1 | | 23 km/h |
|
||||
| primary | 30 | 1 | | 15 km/h | 15 km/h |
|
||||
| primary | 30 | 2 | | 23 km/h | 23 km/h |
|
||||
| highway | maxspeed | lanes | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | 30 | 1 | yes | 23 km/h | | 7 | |
|
||||
| primary | 30 | 1 | -1 | | 23 km/h | | 7 |
|
||||
| primary | 30 | 1 | | 23 km/h | 23 km/h | 3 | 3 |
|
||||
| primary | 30 | 2 | | 23 km/h | 23 km/h | 7 | 7 |
|
||||
|
||||
Scenario: Car - Forwward/backward maxspeed on reverse oneways
|
||||
Scenario: Car - Forward/backward maxspeed on reverse oneways
|
||||
Then routability should be
|
||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw |
|
||||
| primary | | | | -1 | | 52 km/h |
|
||||
| primary | 30 | | | -1 | | 23 km/h |
|
||||
| primary | | 30 | | -1 | | 52 km/h |
|
||||
| primary | | | 30 | -1 | | 23 km/h |
|
||||
| primary | 20 | 30 | | -1 | | 16 km/h |
|
||||
| primary | 20 | | 30 | -1 | | 23 km/h |
|
||||
|
||||
| highway | maxspeed | maxspeed:forward | maxspeed:backward | oneway | forw | backw | forw_rate | backw_rate |
|
||||
| primary | | | | -1 | | 64 km/h | | 18 |
|
||||
| primary | 30 | | | -1 | | 23 km/h | | 7 |
|
||||
| primary | | 30 | | -1 | | 64 km/h | | 18 |
|
||||
| primary | | | 30 | -1 | | 23 km/h | | 7 |
|
||||
| primary | 20 | 30 | | -1 | | 15 km/h | | 4 |
|
||||
| primary | 20 | | 30 | -1 | | 23 km/h | | 7 |
|
||||
|
||||
@@ -18,8 +18,8 @@ Feature: Car - Street names in instructions
|
||||
| bc | Your Way | A1 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way,Your Way | ,A1,A1|
|
||||
| from | to | route | ref |
|
||||
| a | c | My Way,Your Way | ,A1|
|
||||
|
||||
Scenario: Car - A named street with pronunciation
|
||||
Given the node map
|
||||
@@ -36,9 +36,9 @@ Feature: Car - Street names in instructions
|
||||
| cd | Your Way | yourewaye | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | pronunciations | ref |
|
||||
| a | d | My Way,My Way,My Way | ,meyeway,meyeway | ,A1,A1 |
|
||||
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
|
||||
| from | to | route | pronunciations | ref |
|
||||
| a | d | My Way,My Way | ,meyeway | ,A1 |
|
||||
| 1 | c | Your Way,Your Way | yourewaye,yourewaye | , |
|
||||
|
||||
# See #2860
|
||||
Scenario: Car - same street name but different pronunciation
|
||||
|
||||
@@ -15,6 +15,22 @@ Feature: Car - Oneway streets
|
||||
| highway | oneway | forw | backw |
|
||||
| primary | -1 | | x |
|
||||
|
||||
Scenario: Car - Mode specific oneway
|
||||
Then routability should be
|
||||
| highway | oneway:motorcar | oneway:motor_vehicle | oneway:vehicle | oneway | forw | backw |
|
||||
| primary | | | | | x | x |
|
||||
| primary | yes | | | | x | |
|
||||
| primary | | yes | | | x | |
|
||||
| primary | | | yes | | x | |
|
||||
| primary | | | | yes | x | |
|
||||
| primary | yes | no | | | x | |
|
||||
| primary | | yes | no | | x | |
|
||||
| primary | | | yes | no | x | |
|
||||
| primary | | | | yes | x | |
|
||||
| primary | no | yes | | | x | x |
|
||||
| primary | | no | yes | | x | x |
|
||||
| primary | | | no | yes | x | x |
|
||||
|
||||
Scenario: Car - Implied oneways
|
||||
Then routability should be
|
||||
| highway | junction | forw | backw | # |
|
||||
|
||||
@@ -4,11 +4,11 @@ Feature: Car - Surfaces
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Surface should reduce speed
|
||||
Scenario: Car - Ways tagged service should reduce speed
|
||||
Then routability should be
|
||||
| highway | service | forw | backw |
|
||||
| service | alley | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | emergency_access | | |
|
||||
| service | driveway | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | drive-through | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| service | parking | 5 km/h +-1 | 5 km/h +-1 |
|
||||
| highway | service | forw | backw | forw_rate |
|
||||
| service | alley | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
| service | emergency_access | | | |
|
||||
| service | driveway | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
| service | drive-through | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
| service | parking | 15 km/h +-1 | 15 km/h +-1 | 2 |
|
||||
|
||||
@@ -9,13 +9,10 @@ Feature: Testbot - side bias
|
||||
"""
|
||||
|
||||
Scenario: Left hand bias
|
||||
Given the profile file "testbot" extended with
|
||||
Given the profile file "car" extended with
|
||||
"""
|
||||
properties.left_hand_driving = true
|
||||
function turn_function (angle)
|
||||
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
|
||||
return (angle >= 0) and k * 1.2 or k / 1.2
|
||||
end
|
||||
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
||||
"""
|
||||
Given the node map
|
||||
"""
|
||||
@@ -31,17 +28,14 @@ Feature: Testbot - side bias
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| d | a | bd,ab,ab | 82s +-1 |
|
||||
| d | c | bd,bc,bc | 100s +-1 |
|
||||
| d | a | bd,ab,ab | 24s +-1 |
|
||||
| d | c | bd,bc,bc | 27s +-1 |
|
||||
|
||||
Scenario: Right hand bias
|
||||
Given the profile file "testbot" extended with
|
||||
Given the profile file "car" extended with
|
||||
"""
|
||||
properties.left_hand_driving = false
|
||||
function turn_function (angle)
|
||||
local k = 10 * angle * angle * 50 / (90.0 * 90.0)
|
||||
return (angle >= 0) and k / 1.2 or k * 1.2
|
||||
end
|
||||
profile.turn_bias = properties.left_hand_driving and 1/1.075 or 1.075
|
||||
"""
|
||||
And the node map
|
||||
"""
|
||||
@@ -57,8 +51,9 @@ Feature: Testbot - side bias
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| d | a | bd,ab,ab | 100s +-1 |
|
||||
| d | c | bd,bc,bc | 82s +-1 |
|
||||
| d | a | bd,ab,ab | 27s +-1 |
|
||||
# should be inverse of left hand bias
|
||||
| d | c | bd,bc,bc | 24s +-1 |
|
||||
|
||||
Scenario: Roundabout exit counting for left sided driving
|
||||
And a grid size of 10 meters
|
||||
+40
-24
@@ -5,33 +5,49 @@ Feature: Car - speeds
|
||||
Given the profile "car"
|
||||
And a grid size of 1000 meters
|
||||
|
||||
# should more or less match default speeds in car profile, but may be different due to rounding errors
|
||||
Scenario: Car - speed of various way types
|
||||
Then routability should be
|
||||
| highway | oneway | bothw |
|
||||
| motorway | no | 71 km/h |
|
||||
| motorway_link | no | 36 km/h |
|
||||
| trunk | no | 68 km/h |
|
||||
| trunk_link | no | 31 km/h |
|
||||
| primary | no | 52 km/h |
|
||||
| primary_link | no | 23 km/h |
|
||||
| secondary | no | 44 km/h |
|
||||
| secondary_link | no | 19 km/h |
|
||||
| tertiary | no | 31 km/h |
|
||||
| tertiary_link | no | 16 km/h |
|
||||
| unclassified | no | 19 km/h |
|
||||
| residential | no | 19 km/h |
|
||||
| living_street | no | 8 km/h |
|
||||
| service | no | 11 km/h |
|
||||
| motorway | no | 89 km/h |
|
||||
| motorway_link | no | 44 km/h |
|
||||
| trunk | no | 85 km/h |
|
||||
| trunk_link | no | 39 km/h |
|
||||
| primary | no | 64 km/h |
|
||||
| primary_link | no | 29 km/h |
|
||||
| secondary | no | 55 km/h |
|
||||
| secondary_link | no | 24 km/h |
|
||||
| tertiary | no | 39 km/h |
|
||||
| tertiary_link | no | 20 km/h |
|
||||
| unclassified | no | 24 km/h |
|
||||
| residential | no | 24 km/h |
|
||||
| living_street | no | 9 km/h |
|
||||
| service | no | 15 km/h |
|
||||
|
||||
# Alternating oneways have to take average waiting time into account.
|
||||
# Alternating oneways scale rates but not speeds
|
||||
Scenario: Car - scaled speeds for oneway=alternating
|
||||
Then routability should be
|
||||
| highway | oneway | junction | forw | backw | # |
|
||||
| tertiary | | | 31 km/h | 31 km/h | |
|
||||
| tertiary | alternating | | 12 km/h +- 1 | 12 km/h +- 1 | |
|
||||
| motorway | | | 71 km/h | | implied oneway |
|
||||
| motorway | alternating | | 28 km/h +- 1 | | implied oneway |
|
||||
| motorway | reversible | | | | unroutable |
|
||||
| primary | | roundabout | 52 km/h | | implied oneway |
|
||||
| primary | alternating | roundabout | 20 km/h +- 1 | | implied oneway |
|
||||
| primary | reversible | roundabout | | | unroutable |
|
||||
| highway | oneway | junction | forw | backw | # |
|
||||
| tertiary | | | 39 km/h | 39 km/h | |
|
||||
| tertiary | alternating | | 39 km/h | 39 km/h | |
|
||||
| motorway | | | 89 km/h | | implied oneway |
|
||||
| motorway | alternating | | 89 km/h | | implied oneway |
|
||||
| motorway | reversible | | | | unroutable |
|
||||
| primary | | roundabout | 64 km/h | | implied oneway |
|
||||
| primary | alternating | roundabout | 64 km/h | | implied oneway |
|
||||
| primary | reversible | roundabout | | | unroutable |
|
||||
|
||||
Scenario: Car - Check roundoff errors
|
||||
Then routability should be
|
||||
|
||||
| highway | maxspeed | forw | backw |
|
||||
| primary | | 64 km/h | 64 km/h |
|
||||
| primary | 60 | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 47 km/h | 47 km/h |
|
||||
| primary | 60 | 47 km/h | 47 km/h |
|
||||
|
||||
Scenario: Car - Side road penalties
|
||||
Then routability should be
|
||||
|
||||
| highway | side_road | forw | backw | forw_rate | backw_rate |
|
||||
| primary | yes | 64 km/h | 64 km/h | 14 | 14 |
|
||||
|
||||
@@ -5,7 +5,7 @@ Feature: Basic Routing
|
||||
Given the profile "car"
|
||||
Given a grid size of 500 meters
|
||||
|
||||
@smallest
|
||||
@smallest @via
|
||||
Scenario: Summaries when routing on a simple network
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
@@ -40,13 +40,13 @@ Feature: Car - Surfaces
|
||||
| highway | access | tracktype | smoothness | surface | forw | backw |
|
||||
| motorway | | | | | x | |
|
||||
| motorway | no | grade1 | excellent | asphalt | | |
|
||||
| motorway | private | grade1 | excellent | asphalt | | |
|
||||
| motorway | private | grade1 | excellent | asphalt | x | |
|
||||
| motorway | agricultural | grade1 | excellent | asphalt | | |
|
||||
| motorway | forestry | grade1 | excellent | asphalt | | |
|
||||
| motorway | emergency | grade1 | excellent | asphalt | | |
|
||||
| primary | | | | | x | x |
|
||||
| primary | private | grade1 | excellent | asphalt | x | x |
|
||||
| primary | no | grade1 | excellent | asphalt | | |
|
||||
| primary | private | grade1 | excellent | asphalt | | |
|
||||
| primary | agricultural | grade1 | excellent | asphalt | | |
|
||||
| primary | forestry | grade1 | excellent | asphalt | | |
|
||||
| primary | emergency | grade1 | excellent | asphalt | | |
|
||||
@@ -64,64 +64,65 @@ Feature: Car - Surfaces
|
||||
Scenario: Car - Surface should reduce speed
|
||||
Then routability should be
|
||||
| highway | oneway | surface | forw | backw |
|
||||
| motorway | no | | 72 km/h | 72 km/h |
|
||||
| motorway | no | asphalt | 72 km/h | 72 km/h +-1 |
|
||||
| motorway | no | concrete | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | concrete:plates | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | concrete:lanes | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | paved | 72 km/h +-1 | 72 km/h +-1 |
|
||||
| motorway | no | cement | 64 km/h +-1 | 64 km/h +-1 |
|
||||
| motorway | no | compacted | 64 km/h +-1 | 64 km/h +-1 |
|
||||
| motorway | no | fine_gravel | 64 km/h +-1 | 64 km/h +-1 |
|
||||
| motorway | no | paving_stones | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | metal | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | bricks | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | grass | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | wood | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | sett | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | grass_paver | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | gravel | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | unpaved | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | ground | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | dirt | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | pebblestone | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | tartan | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | cobblestone | 24 km/h +-1 | 24 km/h +-1 |
|
||||
| motorway | no | clay | 24 km/h +-1 | 24 km/h +-1 |
|
||||
| motorway | no | earth | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | stone | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | rocky | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | sand | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | asphalt | 90 km/h | 90 km/h +-1 |
|
||||
| motorway | no | concrete | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | concrete:plates | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | concrete:lanes | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | paved | 90 km/h +-1 | 90 km/h +-1 |
|
||||
| motorway | no | cement | 80 km/h +-1 | 80 km/h +-1 |
|
||||
| motorway | no | compacted | 80 km/h +-1 | 80 km/h +-1 |
|
||||
| motorway | no | fine_gravel | 80 km/h +-1 | 80 km/h +-1 |
|
||||
| motorway | no | paving_stones | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | metal | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | bricks | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | grass | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | wood | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | sett | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | grass_paver | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | gravel | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | unpaved | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | ground | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | dirt | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | pebblestone | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | tartan | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | cobblestone | 30 km/h +-1 | 30 km/h +-1 |
|
||||
| motorway | no | clay | 30 km/h +-1 | 30 km/h +-1 |
|
||||
| motorway | no | earth | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | stone | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | rocky | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | sand | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | mud | 10 km/h +-1 | 10 km/h +-1 |
|
||||
|
||||
Scenario: Car - Tracktypes should reduce speed
|
||||
Then routability should be
|
||||
| highway | oneway | tracktype | forw | backw |
|
||||
| motorway | no | | 72 km/h | 72 km/h |
|
||||
| motorway | no | grade1 | 48 km/h +-1 | 48 km/h +-1 |
|
||||
| motorway | no | grade2 | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | grade3 | 24 km/h +-1 | 24 km/h +-1 |
|
||||
| motorway | no | grade4 | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | grade5 | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | grade1 | 60 km/h +-1 | 60 km/h +-1 |
|
||||
| motorway | no | grade2 | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | grade3 | 30 km/h +-1 | 30 km/h +-1 |
|
||||
| motorway | no | grade4 | 25 km/h +-1 | 25 km/h +-1 |
|
||||
| motorway | no | grade5 | 20 km/h +-1 | 20 km/h +-1 |
|
||||
|
||||
Scenario: Car - Smoothness should reduce speed
|
||||
Then routability should be
|
||||
| highway | oneway | smoothness | forw | backw |
|
||||
| motorway | no | | 72 km/h | 72 km/h |
|
||||
| motorway | no | intermediate | 64 km/h | 64 km/h |
|
||||
| motorway | no | bad | 32 km/h +-1 | 32 km/h +-1 |
|
||||
| motorway | no | very_bad | 16 km/h +-1 | 16 km/h +-1 |
|
||||
| motorway | no | horrible | 8 km/h +-1 | 8 km/h +-1 |
|
||||
| motorway | no | very_horrible | 4 km/h +-1 | 4 km/h +-1 |
|
||||
| motorway | no | | 90 km/h | 90 km/h |
|
||||
| motorway | no | intermediate | 80 km/h | 80 km/h |
|
||||
| motorway | no | bad | 40 km/h +-1 | 40 km/h +-1 |
|
||||
| motorway | no | very_bad | 20 km/h +-1 | 20 km/h +-1 |
|
||||
| motorway | no | horrible | 10 km/h +-1 | 10 km/h +-1 |
|
||||
| motorway | no | very_horrible | 5 km/h +-1 | 5 km/h +-1 |
|
||||
|
||||
Scenario: Car - Combination of surface tags should use lowest speed
|
||||
Then routability should be
|
||||
| highway | oneway | tracktype | surface | smoothness | backw | forw |
|
||||
| motorway | no | | | | 72 km/h | 72 km/h |
|
||||
| service | no | grade1 | asphalt | excellent | 12 km/h | 12 km/h |
|
||||
| motorway | no | grade5 | asphalt | excellent | 16 km/h | 16 km/h |
|
||||
| motorway | no | grade1 | mud | excellent | 8 km/h | 8 km/h |
|
||||
| motorway | no | grade1 | asphalt | very_horrible | 4 km/h | 4 km/h |
|
||||
| service | no | grade5 | mud | very_horrible | 4 km/h | 4 km/h |
|
||||
| highway | oneway | tracktype | surface | smoothness | bothw |
|
||||
| motorway | no | | | | 90 km/h |
|
||||
| service | no | grade1 | asphalt | excellent | 15 km/h |
|
||||
| motorway | no | grade5 | asphalt | excellent | 20 km/h |
|
||||
| motorway | no | grade1 | mud | excellent | 10 km/h |
|
||||
| motorway | no | grade1 | asphalt | very_horrible | 5 km/h |
|
||||
| service | no | grade5 | mud | very_horrible | 5 km/h |
|
||||
|
||||
Scenario: Car - Surfaces should not affect oneway direction
|
||||
Then routability should be
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
@routing @car @traffic_light
|
||||
Feature: Car - Handle traffic lights
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Car - Encounters a traffic light
|
||||
Given the node map
|
||||
"""
|
||||
a-1-b-2-c
|
||||
|
||||
d-3-e-4-f
|
||||
|
||||
g-h-i k-l-m
|
||||
| |
|
||||
j n
|
||||
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| def | primary |
|
||||
| ghi | primary |
|
||||
| klm | primary |
|
||||
| hj | primary |
|
||||
| ln | primary |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| e | traffic_signals |
|
||||
| l | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| from | to | time | # |
|
||||
| 1 | 2 | 11.1s | no turn with no traffic light |
|
||||
| 3 | 4 | 13.1s | no turn with traffic light |
|
||||
| g | j | 18.7s | turn with no traffic light |
|
||||
| k | n | 20.7s | turn with traffic light |
|
||||
@@ -1,127 +0,0 @@
|
||||
@routing @speed @traffic
|
||||
Feature: Traffic - speeds
|
||||
|
||||
Background: Use specific speeds
|
||||
|
||||
Scenario: Weighting based on speed file
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | 0.05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | 0.05 | 0.03 |
|
||||
| e | 0.05 | 0.066 |
|
||||
| f | 0.075 | 0.066 |
|
||||
| g | 0.075 | 0.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,0
|
||||
2,1,0
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,27
|
||||
4,1,27
|
||||
"""
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ad,de,eb,eb | 30 km/h |
|
||||
| a | c | ad,dc,dc | 31 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | ad,ad | 27 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | fb,fb | 36 km/h |
|
||||
| a | g | ad,df,fb,fb | 30 km/h |
|
||||
|
||||
|
||||
Scenario: Speeds that isolate a single node (a)
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | 0.05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | 0.05 | 0.03 |
|
||||
| e | 0.05 | 0.066 |
|
||||
| f | 0.075 | 0.066 |
|
||||
| g | 0.075 | 0.1 |
|
||||
| h | 2.075 | 19.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,0
|
||||
2,1,0
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,0
|
||||
4,1,0
|
||||
"""
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | fb,fb | 36 km/h |
|
||||
| a | c | fb,bc,bc | 30 km/h |
|
||||
| b | c | bc,bc | 27 km/h |
|
||||
| a | d | fb,df,df | 36 km/h |
|
||||
| d | c | dc,dc | 36 km/h |
|
||||
| g | b | fb,fb | 36 km/h |
|
||||
| a | g | fb,fb | 36 km/h |
|
||||
|
||||
Scenario: Verify that negative values cause an error, they're not valid at all
|
||||
Given the node locations
|
||||
| node | lat | lon |
|
||||
| a | 0.1 | 0.1 |
|
||||
| b | 0.05 | 0.1 |
|
||||
| c | 0.0 | 0.1 |
|
||||
| d | 0.05 | 0.03 |
|
||||
| e | 0.05 | 0.066 |
|
||||
| f | 0.075 | 0.066 |
|
||||
| g | 0.075 | 0.1 |
|
||||
| h | 1.075 | 10.1 |
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| ab | primary |
|
||||
| ad | primary |
|
||||
| bc | primary |
|
||||
| dc | primary |
|
||||
| de | primary |
|
||||
| eb | primary |
|
||||
| df | primary |
|
||||
| fb | primary |
|
||||
Given the profile "testbot"
|
||||
Given the extract extra arguments "--generate-edge-lookup"
|
||||
Given the speed file
|
||||
"""
|
||||
1,2,-10
|
||||
2,1,-20
|
||||
2,3,27
|
||||
3,2,27
|
||||
1,4,-3
|
||||
4,1,-5
|
||||
"""
|
||||
And the data has been extracted
|
||||
When I try to run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
|
||||
And stderr should contain "malformed"
|
||||
And it should exit with an error
|
||||
@@ -52,23 +52,23 @@ Feature: Traffic - turn penalties
|
||||
|
||||
Scenario: Weighting not based on turn penalty file
|
||||
When I route I should get
|
||||
| from | to | route | speed | time |
|
||||
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 45 km/h | 16s +-1 |
|
||||
# right
|
||||
| a | e | ad,def,def | 38 km/h | 19s +-1 |
|
||||
# left
|
||||
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 48 km/h | 29s +-1 |
|
||||
# straight-right
|
||||
| a | l | ad,dhk,klm,klm | 44 km/h | 33s +-1 |
|
||||
# straight-left
|
||||
| l | e | klm,dhk,def,def | 45 km/h | 32s +-1 |
|
||||
# double right
|
||||
| g | n | fg,fim,mn,mn | 38 km/h | 38s +-1 |
|
||||
# double left
|
||||
| from | to | route | speed | weight | time |
|
||||
| a | h | ad,dhk | 65 km/h | 11s +-1 | 11s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 55 km/h | 13s +-1 | 13s +-1 |
|
||||
# right
|
||||
| a | e | ad,def,def | 44 km/h | 16.3s +-1 | 16.3s +-1 |
|
||||
# left
|
||||
| c | g | cd,def,fg | 65 km/h | 22s +-1 | 22s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 60 km/h | 24s +-1 | 24s +-1 |
|
||||
# straight-right
|
||||
| a | l | ad,dhk,klm,klm | 53 km/h | 27s +-1 | 27s +-1 |
|
||||
# straight-left
|
||||
| l | e | klm,dhk,def,def | 55 km/h | 26s +-1 | 26s +-1 |
|
||||
# double right
|
||||
| g | n | fg,fim,mn,mn | 44 km/h | 32s +-1 | 32s +-1 |
|
||||
# double left
|
||||
|
||||
Scenario: Weighting based on turn penalty file
|
||||
Given the turn penalty file
|
||||
@@ -80,31 +80,39 @@ Feature: Traffic - turn penalties
|
||||
8,11,12,23
|
||||
1,4,5,-0.2
|
||||
"""
|
||||
# ifg right turn
|
||||
# imn left turn
|
||||
# hdc left turn
|
||||
# lkh right turn
|
||||
# hkl left turn
|
||||
# ade left turn
|
||||
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||
And the customize extra arguments "--turn-penalty-file {penalties_file}"
|
||||
When I route I should get
|
||||
| from | to | route | speed | time |
|
||||
| a | h | ad,dhk,dhk | 52 km/h | 14s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 46 km/h | 15s +-1 |
|
||||
# right - ifg penalty
|
||||
| a | e | ad,def,def | 53 km/h | 14s +-1 |
|
||||
# left - faster because of negative ade penalty
|
||||
| c | g | cd,def,fg,fg | 52 km/h | 27s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 49 km/h | 29s +-1 |
|
||||
# straight-right - ifg penalty
|
||||
| a | l | ad,def,fim,klm,klm | 48 km/h | 45s +-1 |
|
||||
# was straight-left - forced around by hkl penalty
|
||||
| l | e | klm,fim,def,def | 38 km/h | 38s +-1 |
|
||||
# double right - forced left by lkh penalty
|
||||
| g | n | fg,fim,mn,mn | 25 km/h | 57s +-1 |
|
||||
# double left - imn penalty
|
||||
| j | c | jk,klm,fim,def,cd,cd | 44 km/h | 65.8s +-1 |
|
||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||
| from | to | route | speed | weight | time |
|
||||
| a | h | ad,dhk | 65 km/h | 11 | 11s +-1 |
|
||||
# straight
|
||||
| i | g | fim,fg,fg | 56 km/h | 12.8 | 12s +-1 |
|
||||
# right - ifg penalty
|
||||
| a | e | ad,def,def | 67 km/h | 10.8 | 10s +-1 |
|
||||
# left - faster because of negative ade penalty
|
||||
| c | g | cd,def,fg | 65 km/h | 22 | 22s +-1 |
|
||||
# double straight
|
||||
| p | g | mp,fim,fg,fg | 61 km/h | 23.8 | 23s +-1 |
|
||||
# straight-right - ifg penalty
|
||||
| a | l | ad,def,fim,klm,klm | 58 km/h | 37 | 37s +-1 |
|
||||
# was straight-left - forced around by hkl penalty
|
||||
| l | e | klm,fim,def,def | 44 km/h | 32.6 | 32s +-1 |
|
||||
# double right - forced left by lkh penalty
|
||||
| g | n | fg,fim,mn,mn | 28 km/h | 51.8 | 51s +-1 |
|
||||
# double left - imn penalty
|
||||
| j | c | jk,klm,fim,def,cd | 53 km/h | 54.6 | 54s +-1 |
|
||||
# double left - hdc penalty ever so slightly higher than imn; forces all the way around
|
||||
|
||||
Scenario: Too-negative penalty clamps, but does not fail
|
||||
Given the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||
And the profile "testbot"
|
||||
Given the profile "testbot"
|
||||
And the contract extra arguments "--turn-penalty-file {penalties_file}"
|
||||
And the customize extra arguments "--turn-penalty-file {penalties_file}"
|
||||
And the turn penalty file
|
||||
"""
|
||||
1,4,5,-10
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
@routing @car @weight
|
||||
Feature: Car - weights
|
||||
|
||||
Background: Use specific speeds
|
||||
Given the profile "car"
|
||||
|
||||
Scenario: Only routes down service road when that's the destination
|
||||
Given the node map
|
||||
"""
|
||||
a--b--c
|
||||
|
|
||||
d
|
||||
|
|
||||
e--f--g
|
||||
"""
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | residential |
|
||||
| efg | residential |
|
||||
| cg | tertiary |
|
||||
| bdf | service |
|
||||
When I route I should get
|
||||
| from | to | route | speed | weight |
|
||||
| a | e | abc,cg,efg,efg | 28 km/h | 126.6 |
|
||||
| a | d | abc,bdf,bdf | 18 km/h | 71.7 |
|
||||
|
||||
Scenario: Does not jump off the highway to go down service road
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
b
|
||||
|\
|
||||
| e
|
||||
|/
|
||||
c
|
||||
|
|
||||
d
|
||||
"""
|
||||
And the nodes
|
||||
| node | id |
|
||||
| a | 1 |
|
||||
| b | 2 |
|
||||
| c | 3 |
|
||||
| d | 4 |
|
||||
| e | 5 |
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| ab | primary | yes |
|
||||
| bc | primary | yes |
|
||||
| cd | primary | yes |
|
||||
| be | service | yes |
|
||||
| ec | service | yes |
|
||||
And the extract extra arguments "--generate-edge-lookup"
|
||||
And the contract extra arguments "--segment-speed-file {speeds_file}"
|
||||
And the customize extra arguments "--segment-speed-file {speeds_file}"
|
||||
And the speed file
|
||||
"""
|
||||
2,5,8
|
||||
"""
|
||||
When I route I should get
|
||||
| from | to | route | speed | weight |
|
||||
| a | d | ab,bc,cd,cd | 65 km/h | 44.4 |
|
||||
| a | e | ab,be,be | 14 km/h | 112 |
|
||||
|
||||
Scenario: Distance weights
|
||||
Given the profile file "car" extended with
|
||||
"""
|
||||
api_version = 1
|
||||
properties.weight_name = 'distance'
|
||||
"""
|
||||
|
||||
Given the node map
|
||||
"""
|
||||
a---b---c
|
||||
|
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes |
|
||||
| abc |
|
||||
| bd |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | distance | weights | times |
|
||||
| a,b | 90 90 | abc,abc | 200m | 200,0 | 11.1s,0s |
|
||||
| b,c | 90 90 | abc,abc | 200m | 200,0 | 11.1s,0s |
|
||||
| a,d | 90 180 | abc,bd,bd | 399.9m | 200,200,0 | 13.2s,11.1s,0s |
|
||||
@@ -103,3 +103,17 @@ Feature: Foot - Access tags on ways
|
||||
| bridleway | | yes | | |
|
||||
| bridleway | designated | | | |
|
||||
| bridleway | | | | |
|
||||
|
||||
Scenario: Foot - a way with missing :forward tag
|
||||
Then routability should be
|
||||
| highway | bicycle:backward | foot:backward | forw | backw |
|
||||
| cycleway | designated | designated | | x |
|
||||
|
||||
Scenario: Foot - Access combinations
|
||||
Then routability should be
|
||||
| highway | access | bothw |
|
||||
| primary | permissive | x |
|
||||
| steps | permissive | x |
|
||||
| footway | permissive | x |
|
||||
| garbagetag | permissive | x |
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Feature: Foot - Squares and other areas
|
||||
|
||||
Background:
|
||||
Given the profile "foot"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
@square
|
||||
Scenario: Foot - Route along edge of a squares
|
||||
|
||||
@@ -64,6 +64,6 @@ Feature: Foot - Handle ferry routes
|
||||
| abcd | | ferry | yes | 1:00 |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s +-10 |
|
||||
| d | a | abcd,abcd | 3600s +-10 |
|
||||
| from | to | route | time |
|
||||
| a | d | abcd,abcd | 3600s |
|
||||
| d | a | abcd,abcd | 3600s |
|
||||
|
||||
@@ -3,6 +3,7 @@ Feature: Foot - Street names in instructions
|
||||
|
||||
Background:
|
||||
Given the profile "foot"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
Scenario: Foot - A named street
|
||||
Given the node map
|
||||
|
||||
@@ -4,6 +4,7 @@ Feature: Foot - Turn restrictions
|
||||
|
||||
Background:
|
||||
Given the profile "foot"
|
||||
Given a grid size of 200 meters
|
||||
|
||||
@no_turning
|
||||
Scenario: Foot - No left turn
|
||||
|
||||
@@ -124,10 +124,10 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
g f
|
||||
|
||||
j h e
|
||||
|
||||
a b c
|
||||
| |
|
||||
j --- h - e
|
||||
| |
|
||||
a --- b - c
|
||||
i d
|
||||
"""
|
||||
|
||||
@@ -154,21 +154,21 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
g j
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
f
|
||||
e
|
||||
d
|
||||
a b c
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |,f
|
||||
|,e
|
||||
,d |
|
||||
a --------- b c |
|
||||
/ | |
|
||||
/ | |
|
||||
/ | |
|
||||
| | |
|
||||
| | |
|
||||
| | |
|
||||
l h i
|
||||
"""
|
||||
|
||||
@@ -202,21 +202,21 @@ Feature: Turn Lane Guidance
|
||||
Given the node map
|
||||
"""
|
||||
g j
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
f
|
||||
e
|
||||
d
|
||||
a b c
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |,f
|
||||
|,e
|
||||
,d |
|
||||
a --------- b c |
|
||||
/ | |
|
||||
/ | |
|
||||
/ | |
|
||||
| | |
|
||||
| | |
|
||||
| | |
|
||||
l h i
|
||||
"""
|
||||
|
||||
|
||||
@@ -297,19 +297,19 @@ Feature: Turn Lane Guidance
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | | main |
|
||||
| bc | left\|through\|through\|through\|right | main |
|
||||
| cd | left\|through\|right | main |
|
||||
| de | | main |
|
||||
| cf | | off |
|
||||
| ch | | off |
|
||||
| dg | | off |
|
||||
| di | | off |
|
||||
| nodes | turn:lanes:forward | name | destination | oneway |
|
||||
| ab | | main | One | yes |
|
||||
| bc | left\|through\|through\|through\|right | main | One | yes |
|
||||
| cd | left\|through\|right | main | Two | yes |
|
||||
| de | | main | Three | yes |
|
||||
| cf | | off | | yes |
|
||||
| ch | | off | | yes |
|
||||
| dg | | off | | yes |
|
||||
| di | | off | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | main,main,main | depart,use lane straight,arrive | ,left:false straight:false straight:true straight:false right:false, |
|
||||
| waypoints | route | turns | destinations | lanes | locations |
|
||||
| a,e | main,main,main | depart,use lane straight,arrive | One,Two,Three | ,left:false straight:false straight:true straight:false right:false, | a,c,e |
|
||||
|
||||
@anticipate
|
||||
Scenario: Anticipate Lanes for through and collapse multiple use lanes
|
||||
@@ -783,3 +783,72 @@ Feature: Turn Lane Guidance
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,f | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn right,arrive | ,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:true none:false none:false,left:false left:false right:true, |
|
||||
| a,g | start,first,second,third,fourth,fourth | depart,turn left,turn left,turn left,turn left,arrive | ,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true none:false none:false,left:true left:true right:false, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Complex lane scenarios scale threshold for triggering Lane Anticipation
|
||||
Given the node map
|
||||
"""
|
||||
a – b – x
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
c
|
||||
|
|
||||
e – d – y
|
||||
"""
|
||||
# With a grid size of 20m the duration is ~20s but our default threshold for Lane Anticipation is 15s.
|
||||
# The additional lanes left and right of the turn scale the threshold up so that Lane Anticipation still triggers.
|
||||
|
||||
And the ways
|
||||
| nodes | turn:lanes:forward | name |
|
||||
| ab | through\|through\|right\|right | MySt |
|
||||
| bx | | XSt |
|
||||
| bc | | MySt |
|
||||
| cd | left\|right | MySt |
|
||||
| de | | MySt |
|
||||
| dy | | YSt |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
|
||||
|
||||
@anticipate
|
||||
Scenario: Don't Overdo It
|
||||
Given the node map
|
||||
"""
|
||||
q r s t u v
|
||||
| | | | | |
|
||||
a - - - - - - - - - - b - - - - - - - - - - c - - - - - - - - - - d - - - - - - - - - - e - - - - - - - - - - f - - - - - - - - - - g - h - i
|
||||
| | | | | | |
|
||||
p o n m l k j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | turn:lanes:forward | oneway |
|
||||
| ab | road | left\|\|\| | yes |
|
||||
| bc | road | left\|\|\| | yes |
|
||||
| cd | road | left\|\|\| | yes |
|
||||
| de | road | left\|\|\| | yes |
|
||||
| ef | road | left\|\|\| | yes |
|
||||
| fg | road | left\|\|\| | yes |
|
||||
| gh | road | \|\|right | yes |
|
||||
| hi | road | | yes |
|
||||
| qbp | 1st | | no |
|
||||
| rco | 2nd | | no |
|
||||
| sdn | 3rd | | no |
|
||||
| tem | 4th | | no |
|
||||
| ufl | 5th | | no |
|
||||
| vgk | 6th | | no |
|
||||
| hj | 7th | | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations | lanes |
|
||||
| a,i | road,road,road | depart,use lane straight,arrive | a,g,i | ,left:false none:true none:true none:false, |
|
||||
| a,j | road,road,7th,7th | depart,use lane straight,turn right,arrive | a,f,h,j | ,left:false none:false none:false none:true,none:false none:false right:true, |
|
||||
|
||||
@@ -33,8 +33,8 @@ Feature: Features related to bugs
|
||||
| e | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| 1,2 | top,right,right | depart,new name right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| 1,2 | top,right | depart,arrive |
|
||||
|
||||
@3156
|
||||
Scenario: Incorrect lanes tag
|
||||
@@ -50,3 +50,20 @@ Feature: Features related to bugs
|
||||
And the data has been saved to disk
|
||||
When I try to run "osrm-extract {osm_file} --profile {profile_file}"
|
||||
Then it should exit successfully
|
||||
|
||||
@3418
|
||||
Scenario: Bearings should be between 0-359
|
||||
Given the node locations
|
||||
| node | lon | lat |
|
||||
| a | -122.0232176 | 37.3282203 |
|
||||
| b | -122.0232199 | 37.3302422 |
|
||||
| c | -122.0232252 | 37.3312787 |
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway |
|
||||
| ab | Pear to Merrit | residential |
|
||||
| bc | Merritt to Apricot | residential |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,c | Pear to Merrit,Merritt to Apricot,Merritt to Apricot | true:0;true:0 false:180;true:180 |
|
||||
|
||||
@@ -9,10 +9,10 @@ Feature: Collapse
|
||||
Scenario: Collapse U-Turn Triangle Intersection
|
||||
Given the node map
|
||||
"""
|
||||
g f e d
|
||||
|
||||
|
||||
a b c
|
||||
g---f---e---d
|
||||
\ /
|
||||
\ /
|
||||
a-----b-----c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -23,27 +23,27 @@ Feature: Collapse
|
||||
| be | primary_link | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c |
|
||||
|
||||
@reverse @traffic-signals
|
||||
Scenario: Collapse U-Turn Triangle Intersection
|
||||
Given the node map
|
||||
"""
|
||||
g f j e d
|
||||
|
||||
g---f---j---e---d
|
||||
\ /
|
||||
h i
|
||||
|
||||
a b c
|
||||
\ /
|
||||
a-------b-------c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | road | yes |
|
||||
| dejfg | primary | road | yes |
|
||||
| fhb | primary_link | | |
|
||||
| bie | primary_link | | |
|
||||
| fhb | primary_link | | yes |
|
||||
| bie | primary_link | | yes |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
@@ -52,9 +52,9 @@ Feature: Collapse
|
||||
| i | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,road,road | depart,continue uturn,arrive | a,b,g |
|
||||
| d,c | road,road,road | depart,continue uturn,arrive | d,f,c |
|
||||
|
||||
Scenario: Forking before a turn (forky)
|
||||
Given the node map
|
||||
@@ -66,7 +66,7 @@ Feature: Collapse
|
||||
`d.
|
||||
f e
|
||||
"""
|
||||
# note: check clooapse.feature for a similar test case where we do not
|
||||
# note: check collapse.feature for a similar test case where we do not
|
||||
# classify the situation as Sliproad and therefore keep the fork inst.
|
||||
|
||||
And the ways
|
||||
@@ -85,8 +85,65 @@ Feature: Collapse
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road,road | depart,continue right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
||||
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
|
||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f |
|
||||
|
||||
Scenario: Forking before a turn (forky), larger
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
.
|
||||
c
|
||||
.'|
|
||||
.' |
|
||||
a . . b .' |
|
||||
' . |
|
||||
` d
|
||||
f ' e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| ab | road | yes | primary |
|
||||
| bd | road | yes | primary |
|
||||
| bc | road | yes | primary |
|
||||
| de | road | yes | primary |
|
||||
| fd | cross | no | secondary |
|
||||
| dc | cross | no | secondary |
|
||||
| cg | cross | no | secondary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | dc | d | no_left_turn |
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
||||
| a,e | road,road,road | depart,continue slight right,arrive | a,b,e |
|
||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive | a,b,d,f |
|
||||
|
||||
Scenario: Pulled Back Turn
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
a-b-c
|
||||
|
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | tertiary | road |
|
||||
| cd | tertiary | left |
|
||||
| be | tertiary | right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,left,left | depart,turn left,arrive |
|
||||
| a,e | road,right,right | depart,turn right,arrive |
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
@routing @guidance @collapsing
|
||||
Feature: Collapse
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 20 meters
|
||||
|
||||
Scenario: Collapse Steps While On Ferry
|
||||
Given the node map
|
||||
"""
|
||||
j----a---c---b----k
|
||||
~ ~ ~
|
||||
~ ~ ~
|
||||
~~~
|
||||
d
|
||||
~
|
||||
~
|
||||
~
|
||||
e --- f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| jacbk | primary | | land |
|
||||
| ad | | ferry | sea |
|
||||
| bd | | ferry | sea |
|
||||
| cd | | ferry | sea |
|
||||
| de | | ferry | sea |
|
||||
| ef | primary | | pennydog-island |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes | locations |
|
||||
| f,j | pennydog-island,sea,land,land | depart,notification right,turn left,arrive | driving,ferry,driving,driving | f,e,b,j |
|
||||
|
||||
Scenario: Switching Ferry in a Harbour
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
|
|
||||
|
|
||||
e - a ~ ~ ~ ~ b
|
||||
~
|
||||
~
|
||||
~
|
||||
c
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ea | primary | | melee-island |
|
||||
| ab | | ferry | melee-island-ferry |
|
||||
| cf | primary | | monkey-island |
|
||||
| bd | primary | | scabb-island |
|
||||
| bc | primary | ferry | monkey-island-ferry |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| e,f | melee-island,melee-island-ferry,monkey-island-ferry,monkey-island,monkey-island | depart,notification straight,turn right,notification straight,arrive | driving,ferry,ferry,driving,driving |
|
||||
|
||||
|
||||
Scenario: End of Road Ferries
|
||||
Given the node map
|
||||
"""
|
||||
a - b ~ ~ ~ ~ c ~ ~ ~ ~ ~ d - e
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
~
|
||||
f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | land-left |
|
||||
| de | primary | | land-right |
|
||||
| gf | primary | | land-bottom |
|
||||
| bcd | | ferry | ferry |
|
||||
| fc | | ferry | ferry |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification straight,arrive |
|
||||
|
||||
Scenario: Fork Ferries
|
||||
Given the node map
|
||||
"""
|
||||
a - b d - e
|
||||
~ ~
|
||||
~ ~
|
||||
~ ~
|
||||
~ ~
|
||||
c
|
||||
~
|
||||
~
|
||||
~
|
||||
f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | land-left |
|
||||
| de | primary | | land-right |
|
||||
| gf | primary | | land-bottom |
|
||||
| cb | | ferry | ferry |
|
||||
| cd | | ferry | ferry |
|
||||
| fc | | ferry | ferry |
|
||||
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| g,e | land-bottom,ferry,land-right,land-right | depart,notification straight,notification right,arrive |
|
||||
|
||||
@negative
|
||||
Scenario: Don't Detect Suppressed/Obvious Forks on Ferries
|
||||
Given the node map
|
||||
"""
|
||||
. . . . . . . . .d
|
||||
a - b ~ ~ ~ ~ ~ c <
|
||||
' ' ' ' ' ' ' ' 'e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | cursed-island |
|
||||
| bc | | ferry | beagle |
|
||||
| cd | service | | forker |
|
||||
| ce | primary | | screw-me-not |
|
||||
|
||||
#the turns here could be better, but intersection classification shows you if you go left or right. But we cannot fork here
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | cursed-island,beagle,forker,forker | depart,notification straight,turn straight,arrive |
|
||||
| a,e | cursed-island,beagle,screw-me-not,screw-me-not | depart,notification straight,turn straight,arrive |
|
||||
|
||||
@uturn @dead-end @ferry @via
|
||||
Scenario: U-Turn on a dead-end ferry
|
||||
Given the node map
|
||||
"""
|
||||
a - 1 - b ~ ~ ~ ~ ~ ~ ~ c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | route | name |
|
||||
| ab | primary | | land |
|
||||
| bc | | ferry | sea |
|
||||
|
||||
# we actually cannot check the route here, since two possible routes are equally valid:
|
||||
# (ab)(bcb1) and (abcb)(b1) are exactly the same. Luckily, we only want to check for
|
||||
# not asserting here.
|
||||
When I route I should get
|
||||
| waypoints |
|
||||
| a,b,1 |
|
||||
+375
-346
@@ -32,23 +32,23 @@ Feature: Collapse
|
||||
| gb | primary | first | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,l | first,second,second | depart,turn right,arrive |
|
||||
| a,d | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive |
|
||||
| e,j | first,second,second | depart,turn right,arrive |
|
||||
| e,h | first,first | depart,arrive |
|
||||
| e,l | first,second,second | depart,turn left,arrive |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive |
|
||||
| k,h | second,first,first | depart,turn right,arrive |
|
||||
| k,l | second,second | depart,arrive |
|
||||
| k,d | second,first,first | depart,turn left,arrive |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive |
|
||||
| i,d | second,first,first | depart,turn right,arrive |
|
||||
| i,j | second,second | depart,arrive |
|
||||
| i,h | second,first,first | depart,turn left,arrive |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Correct Street
|
||||
Given the node map
|
||||
@@ -77,23 +77,23 @@ Feature: Collapse
|
||||
| gb | primary | second | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,l | first,second,second | depart,turn right,arrive |
|
||||
| a,d | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive |
|
||||
| e,j | first,second,second | depart,turn right,arrive |
|
||||
| e,h | first,first | depart,arrive |
|
||||
| e,l | first,second,second | depart,turn left,arrive |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive |
|
||||
| k,h | second,first,first | depart,turn right,arrive |
|
||||
| k,l | second,second | depart,arrive |
|
||||
| k,d | second,first,first | depart,turn left,arrive |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive |
|
||||
| i,d | second,first,first | depart,turn right,arrive |
|
||||
| i,j | second,second | depart,arrive |
|
||||
| i,h | second,first,first | depart,turn left,arrive |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets
|
||||
Given the node map
|
||||
@@ -122,127 +122,127 @@ Feature: Collapse
|
||||
| gb | primary | first | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,l | first,second,second | depart,turn right,arrive |
|
||||
| a,d | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive |
|
||||
| e,j | first,second,second | depart,turn right,arrive |
|
||||
| e,h | first,first | depart,arrive |
|
||||
| e,l | first,second,second | depart,turn left,arrive |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive |
|
||||
| k,h | second,first,first | depart,turn right,arrive |
|
||||
| k,l | second,second | depart,arrive |
|
||||
| k,d | second,first,first | depart,turn left,arrive |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive |
|
||||
| i,d | second,first,first | depart,turn right,arrive |
|
||||
| i,j | second,second | depart,arrive |
|
||||
| i,h | second,first,first | depart,turn left,arrive |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads
|
||||
Given the node map
|
||||
"""
|
||||
n m
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
g h
|
||||
|
||||
|
||||
c b a
|
||||
d e f
|
||||
|
||||
|
||||
j i
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
k l
|
||||
n m
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g h
|
||||
c - b - a
|
||||
d - e - f
|
||||
j i
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
k l
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| ab | primary | first | yes |
|
||||
| bc | primary | first | yes |
|
||||
| de | primary | first | yes |
|
||||
| ef | primary | first | yes |
|
||||
| be | primary | first | no |
|
||||
| ngbhm | primary | second | yes |
|
||||
| liejk | primary | second | yes |
|
||||
| nodes | highway | name | oneway | lanes |
|
||||
| ab | primary | first | yes | |
|
||||
| bc | primary | first | yes | |
|
||||
| de | primary | first | yes | |
|
||||
| ef | primary | first | yes | |
|
||||
| be | primary | first | no | |
|
||||
| ngbhm | primary | second | yes | 5 |
|
||||
| liejk | primary | second | yes | 5 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,h | first,second,second | depart,turn right,arrive |
|
||||
| a,c | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,f | first,first,first | depart,continue uturn,arrive |
|
||||
| d,j | first,second,second | depart,turn right,arrive |
|
||||
| d,f | first,first | depart,arrive |
|
||||
| d,h | first,second,second | depart,turn left,arrive |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
| g,c | second,first,first | depart,turn right,arrive |
|
||||
| g,j | second,second | depart,arrive |
|
||||
| g,f | second,first,first | depart,turn left,arrive |
|
||||
| g,h | second,second,second | depart,continue uturn,arrive |
|
||||
| i,f | second,first,first | depart,turn right,arrive |
|
||||
| i,h | second,second | depart,arrive |
|
||||
| i,c | second,first,first | depart,turn left,arrive |
|
||||
| i,j | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,h | first,second,second | depart,turn right,arrive | a,b,h |
|
||||
| a,c | first,first | depart,arrive | a,c |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,f | first,first,first | depart,continue uturn,arrive | a,b,f |
|
||||
| d,j | first,second,second | depart,turn right,arrive | d,e,j |
|
||||
| d,f | first,first | depart,arrive | d,f |
|
||||
| d,h | first,second,second | depart,turn left,arrive | d,e,h |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
||||
| g,j | second,second | depart,arrive | g,j |
|
||||
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
|
||||
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
||||
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
||||
| i,h | second,second | depart,arrive | i,h |
|
||||
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
|
||||
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
||||
|
||||
Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second
|
||||
Given the node map
|
||||
"""
|
||||
n m
|
||||
|
||||
|
||||
|
||||
g h
|
||||
|
||||
|
||||
c b a
|
||||
d e f
|
||||
|
||||
|
||||
j i
|
||||
|
||||
|
||||
|
||||
k l
|
||||
n m
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g h
|
||||
\ /
|
||||
c - b - a
|
||||
d - e - f
|
||||
/ \
|
||||
j i
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
k l
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| ab | primary | first | yes |
|
||||
| bc | primary | first | yes |
|
||||
| de | primary | first | yes |
|
||||
| ef | primary | first | yes |
|
||||
| be | primary | second | no |
|
||||
| ngbhm | primary | second | yes |
|
||||
| liejk | primary | second | yes |
|
||||
| nodes | highway | name | oneway | lanes |
|
||||
| ab | primary | first | yes | |
|
||||
| bc | primary | first | yes | |
|
||||
| de | primary | first | yes | |
|
||||
| ef | primary | first | yes | |
|
||||
| be | primary | second | no | |
|
||||
| ngbhm | primary | second | yes | 5 |
|
||||
| liejk | primary | second | yes | 5 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,h | first,second,second | depart,turn right,arrive |
|
||||
| a,c | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,f | first,first,first | depart,continue uturn,arrive |
|
||||
| d,j | first,second,second | depart,turn right,arrive |
|
||||
| d,f | first,first | depart,arrive |
|
||||
| d,h | first,second,second | depart,turn left,arrive |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
| g,c | second,first,first | depart,turn right,arrive |
|
||||
| g,j | second,second | depart,arrive |
|
||||
| g,f | second,first,first | depart,turn left,arrive |
|
||||
| g,h | second,second,second | depart,continue uturn,arrive |
|
||||
| i,f | second,first,first | depart,turn right,arrive |
|
||||
| i,h | second,second | depart,arrive |
|
||||
| i,c | second,first,first | depart,turn left,arrive |
|
||||
| i,j | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,h | first,second,second | depart,turn right,arrive | a,b,h |
|
||||
| a,c | first,first | depart,arrive | a,c |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,b,j |
|
||||
| a,f | first,first,first | depart,continue uturn,arrive | a,b,f |
|
||||
| d,j | first,second,second | depart,turn right,arrive | d,e,j |
|
||||
| d,f | first,first | depart,arrive | d,f |
|
||||
| d,h | first,second,second | depart,turn left,arrive | d,e,h |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
| g,c | second,first,first | depart,turn right,arrive | g,b,c |
|
||||
| g,j | second,second | depart,arrive | g,j |
|
||||
| g,f | second,first,first | depart,turn left,arrive | g,e,f |
|
||||
| g,h | second,second,second | depart,continue uturn,arrive | g,b,h |
|
||||
| i,f | second,first,first | depart,turn right,arrive | i,e,f |
|
||||
| i,h | second,second | depart,arrive | i,h |
|
||||
| i,c | second,first,first | depart,turn left,arrive | i,b,c |
|
||||
| i,j | second,second,second | depart,continue uturn,arrive | i,e,j |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles
|
||||
Given the node map
|
||||
@@ -271,23 +271,23 @@ Feature: Collapse
|
||||
| gb | primary | first | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,l | first,second,second | depart,turn right,arrive |
|
||||
| a,d | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive |
|
||||
| e,j | first,second,second | depart,turn right,arrive |
|
||||
| e,h | first,first | depart,arrive |
|
||||
| e,l | first,second,second | depart,turn left,arrive |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive |
|
||||
| k,h | second,first,first | depart,turn right,arrive |
|
||||
| k,l | second,second | depart,arrive |
|
||||
| k,d | second,first,first | depart,turn left,arrive |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive |
|
||||
| i,d | second,first,first | depart,turn right,arrive |
|
||||
| i,j | second,second | depart,arrive |
|
||||
| i,h | second,first,first | depart,turn left,arrive |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
|
||||
Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2)
|
||||
Given the node map
|
||||
@@ -316,23 +316,23 @@ Feature: Collapse
|
||||
| gb | primary | first | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,l | first,second,second | depart,turn right,arrive |
|
||||
| a,d | first,first | depart,arrive |
|
||||
| a,j | first,second,second | depart,turn left,arrive |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive |
|
||||
| e,j | first,second,second | depart,turn right,arrive |
|
||||
| e,h | first,first | depart,arrive |
|
||||
| e,l | first,second,second | depart,turn left,arrive |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive |
|
||||
| k,h | second,first,first | depart,turn right,arrive |
|
||||
| k,l | second,second | depart,arrive |
|
||||
| k,d | second,first,first | depart,turn left,arrive |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive |
|
||||
| i,d | second,first,first | depart,turn right,arrive |
|
||||
| i,j | second,second | depart,arrive |
|
||||
| i,h | second,first,first | depart,turn left,arrive |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,l | first,second,second | depart,turn right,arrive | a,b,l |
|
||||
| a,d | first,first | depart,arrive | a,d |
|
||||
| a,j | first,second,second | depart,turn left,arrive | a,c,j |
|
||||
| a,h | first,first,first | depart,continue uturn,arrive | a,c,h |
|
||||
| e,j | first,second,second | depart,turn right,arrive | e,f,j |
|
||||
| e,h | first,first | depart,arrive | e,h |
|
||||
| e,l | first,second,second | depart,turn left,arrive | e,g,l |
|
||||
| e,d | first,first,first | depart,continue uturn,arrive | e,g,d |
|
||||
| k,h | second,first,first | depart,turn right,arrive | k,g,h |
|
||||
| k,l | second,second | depart,arrive | k,l |
|
||||
| k,d | second,first,first | depart,turn left,arrive | k,b,d |
|
||||
| k,j | second,second,second | depart,continue uturn,arrive | k,b,j |
|
||||
| i,d | second,first,first | depart,turn right,arrive | i,c,d |
|
||||
| i,j | second,second | depart,arrive | i,j |
|
||||
| i,h | second,first,first | depart,turn left,arrive | i,f,h |
|
||||
| i,l | second,second,second | depart,continue uturn,arrive | i,f,l |
|
||||
|
||||
Scenario: Entering a segregated road
|
||||
Given the node map
|
||||
@@ -353,20 +353,20 @@ Feature: Collapse
|
||||
| ge | primary | second | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
| a,f | first,first,first | depart,continue uturn,arrive |
|
||||
| a,g | first,second,second | depart,turn left,arrive |
|
||||
| d,g | first,second,second | depart,turn right,arrive |
|
||||
| g,f | second,first,first | depart,turn right,arrive |
|
||||
| g,c | second,first,first | depart,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
| a,f | first,first,first | depart,continue uturn,arrive | a,b,f |
|
||||
| a,g | first,second,second | depart,turn left,arrive | a,b,g |
|
||||
| d,g | first,second,second | depart,turn right,arrive | d,e,g |
|
||||
| g,f | second,first,first | depart,turn right,arrive | g,e,f |
|
||||
| g,c | second,first,first | depart,end of road left,arrive | g,b,c |
|
||||
|
||||
Scenario: Do not collapse turning roads
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
c d
|
||||
a b f
|
||||
c---d
|
||||
a---b-f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -378,10 +378,10 @@ Feature: Collapse
|
||||
| bf | primary | third | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | first,first,first,first | depart,continue left,continue right,arrive |
|
||||
| a,e | first,second,second | depart,turn left,arrive |
|
||||
| a,f | first,third,third | depart,turn straight,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,d | first,first,first,first | depart,continue left,continue right,arrive | a,b,c,d |
|
||||
| a,e | first,second,second | depart,turn left,arrive | a,b,e |
|
||||
| a,f | first,third,third | depart,turn straight,arrive | a,b,f |
|
||||
|
||||
Scenario: Bridge on unnamed road
|
||||
Given the node map
|
||||
@@ -399,12 +399,14 @@ Feature: Collapse
|
||||
| waypoints | route | turns |
|
||||
| a,d | , | depart,arrive |
|
||||
|
||||
Scenario: Crossing Bridge into Segregated Turn
|
||||
# This scenario could be considered to require a `turn left`. The danger to create random/unwanted instructions
|
||||
# from a setting like this are just to big, though. Therefore I opted to use `depart,arrive` only
|
||||
Scenario: Crossing Bridge into Segregated Turn
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
i h g e
|
||||
a b c d
|
||||
i-h-----g-e
|
||||
a-b-----c-d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -419,37 +421,51 @@ Feature: Collapse
|
||||
| hi | primary | yes | to_bridge |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | to_bridge,target_road,target_road | depart,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,f | to_bridge,target_road | depart,arrive | a,f |
|
||||
|
||||
Scenario: Pankenbruecke
|
||||
Given the node map
|
||||
"""
|
||||
j h i
|
||||
b c d e f g
|
||||
k a
|
||||
k j
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
a h
|
||||
b
|
||||
c
|
||||
d
|
||||
e
|
||||
f-i
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| kabhj | primary | inroad | yes |
|
||||
| bc | primary | inroad | no |
|
||||
| cd | primary | bridge | no |
|
||||
| defg | primary | outroad | no |
|
||||
| fi | primary | cross | no |
|
||||
| nodes | highway | name | oneway | lanes |
|
||||
| kabhj | primary | inroad | yes | 4 |
|
||||
| bc | primary | inroad | no | |
|
||||
| cd | primary | bridge | no | |
|
||||
| defg | primary | outroad | no | |
|
||||
| fi | primary | cross | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | inroad,outroad,outroad | depart,new name straight,arrive |
|
||||
| a,i | inroad,cross,cross | depart,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | inroad,outroad,outroad | depart,new name straight,arrive | a,d,g |
|
||||
| a,i | inroad,cross,cross | depart,turn left,arrive | a,f,i |
|
||||
|
||||
Scenario: Close Turns - Don't Collapse
|
||||
Given the node map
|
||||
"""
|
||||
g d
|
||||
|
||||
e b c f
|
||||
|
||||
| |
|
||||
e-b-c-f
|
||||
| |
|
||||
a h
|
||||
"""
|
||||
|
||||
@@ -462,10 +478,10 @@ Feature: Collapse
|
||||
| ch | primary | reverse |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | in,cross,out,out | depart,turn right,turn left,arrive |
|
||||
| a,h | in,cross,reverse,reverse | depart,turn right,turn right,arrive |
|
||||
| g,d | straight,cross,out,out | depart,turn left,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,d | in,cross,out,out | depart,turn right,turn left,arrive | a,b,c,d |
|
||||
| a,h | in,cross,reverse,reverse | depart,turn right,turn right,arrive | a,b,c,h |
|
||||
| g,d | straight,cross,out,out | depart,turn left,turn left,arrive | g,b,c,d |
|
||||
|
||||
Scenario: No Name During Turns
|
||||
Given the node map
|
||||
@@ -518,25 +534,6 @@ Feature: Collapse
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,road | depart,arrive |
|
||||
|
||||
Scenario: Pulled Back Turn
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
a b c
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name |
|
||||
| abc | tertiary | road |
|
||||
| cd | tertiary | left |
|
||||
| be | tertiary | right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,left,left | depart,turn left,arrive |
|
||||
| a,e | road,right,right | depart,turn right,arrive |
|
||||
|
||||
Scenario: No Name During Turns, keep important turns
|
||||
Given the node map
|
||||
"""
|
||||
@@ -559,15 +556,15 @@ Feature: Collapse
|
||||
Given the node map
|
||||
"""
|
||||
h
|
||||
a
|
||||
|
||||
g
|
||||
a .
|
||||
..
|
||||
.g
|
||||
b f
|
||||
c
|
||||
|
||||
|
||||
e
|
||||
d
|
||||
| c .
|
||||
| | . ,
|
||||
| | . .
|
||||
| | . e
|
||||
| | d
|
||||
j i
|
||||
"""
|
||||
|
||||
@@ -579,27 +576,27 @@ Feature: Collapse
|
||||
| gbj | secondary | out | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| i,h | in,road,road | depart,turn left,arrive |
|
||||
| a,d | road,road | depart,arrive |
|
||||
| a,j | road,out,out | depart,turn slight right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| i,h | in,road,road | depart,turn left,arrive | i,f,h |
|
||||
| a,d | road,road | depart,arrive | a,d |
|
||||
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j |
|
||||
|
||||
Scenario: Segregated Intersection into Very Slight Turn
|
||||
Given the node map
|
||||
"""
|
||||
h
|
||||
a
|
||||
|
||||
|
||||
g
|
||||
b
|
||||
f
|
||||
c
|
||||
|
||||
|
||||
|
||||
e
|
||||
d
|
||||
a.
|
||||
.,
|
||||
..
|
||||
.g
|
||||
b.
|
||||
| f
|
||||
| c .
|
||||
| |. .
|
||||
| | . .
|
||||
| | . .
|
||||
| | . e
|
||||
| | d
|
||||
j i
|
||||
"""
|
||||
|
||||
@@ -611,17 +608,17 @@ Feature: Collapse
|
||||
| gbj | secondary | out | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| i,h | in,road,road | depart,turn slight left,arrive |
|
||||
| a,d | road,road | depart,arrive |
|
||||
| a,j | road,out,out | depart,turn slight right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| i,h | in,road,road | depart,turn slight left,arrive | i,f,h |
|
||||
| a,d | road,road | depart,arrive | a,d |
|
||||
| a,j | road,out,out | depart,turn slight right,arrive | a,b,j |
|
||||
|
||||
Scenario: Don't collapse everything to u-turn / too wide
|
||||
Given the node map
|
||||
"""
|
||||
a b e
|
||||
|
||||
d c f
|
||||
a---b---e
|
||||
|
|
||||
d---c---f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -631,18 +628,18 @@ Feature: Collapse
|
||||
| cf | secondary | bottom |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,continue right,turn right,arrive | road,road,road,road |
|
||||
| d,a | depart,continue left,turn left,arrive | road,road,road,road |
|
||||
| waypoints | turns | route | locations |
|
||||
| a,d | depart,continue right,turn right,arrive | road,road,road,road | a,b,c,d |
|
||||
| d,a | depart,continue left,turn left,arrive | road,road,road,road | d,c,b,a |
|
||||
|
||||
Scenario: Forking before a turn
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
|
||||
c
|
||||
a b d e
|
||||
|
||||
|
|
||||
.c
|
||||
a---b-d-e
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
@@ -662,18 +659,18 @@ Feature: Collapse
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road | depart,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
||||
| a,e | road,road | depart,arrive | a,e |
|
||||
|
||||
Scenario: Forking before a turn (narrow)
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
|
||||
c
|
||||
a b d e
|
||||
|
||||
|
|
||||
..c
|
||||
a-b---d-e
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
@@ -693,44 +690,9 @@ Feature: Collapse
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||
| a,e | road,road | depart,arrive |
|
||||
|
||||
Scenario: Forking before a turn (forky)
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
.
|
||||
c
|
||||
a . . b .'
|
||||
` d.
|
||||
f e
|
||||
"""
|
||||
# as it is right now we don't classify this as a sliproad,
|
||||
# check collapse-detail.feature for a similar test case
|
||||
# which removes the fork here due to it being a Sliproad.
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| ab | road | yes | primary |
|
||||
| bd | road | yes | primary |
|
||||
| bc | road | yes | primary |
|
||||
| de | road | yes | primary |
|
||||
| fd | cross | no | secondary |
|
||||
| dc | cross | no | secondary |
|
||||
| cg | cross | no | secondary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | dc | d | no_left_turn |
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | road,cross,cross | depart,fork left,arrive |
|
||||
| a,e | road,road,road | depart,fork slight right,arrive |
|
||||
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,cross,cross | depart,turn left,arrive | a,b,g |
|
||||
| a,e | road,road | depart,arrive | a,e |
|
||||
|
||||
Scenario: On-Off on Highway
|
||||
Given the node map
|
||||
@@ -747,11 +709,11 @@ Feature: Collapse
|
||||
| ce | off | motorway_link | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | Hwy,Hwy | depart,arrive |
|
||||
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive |
|
||||
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive |
|
||||
| a,e | Hwy,off,off | depart,off ramp right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,d | Hwy,Hwy | depart,arrive | a,d |
|
||||
| f,d | on,Hwy,Hwy | depart,merge slight right,arrive | f,b,d |
|
||||
| f,e | on,Hwy,off,off | depart,merge slight right,off ramp right,arrive | f,b,c,e |
|
||||
| a,e | Hwy,off,off | depart,off ramp right,arrive | a,c,e |
|
||||
|
||||
@negative @straight
|
||||
Scenario: Don't collapse going straight if actual turn
|
||||
@@ -798,8 +760,8 @@ Feature: Collapse
|
||||
| ge | primary | second | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
|
||||
Scenario: Entering a segregated road slight turn
|
||||
Given the node map
|
||||
@@ -820,8 +782,8 @@ Feature: Collapse
|
||||
| ge | primary | second | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| d,c | first,first,first | depart,continue uturn,arrive | d,e,c |
|
||||
|
||||
Scenario: Do not collapse UseLane step when lanes change
|
||||
Given the node map
|
||||
@@ -845,8 +807,8 @@ Feature: Collapse
|
||||
| di | | off |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | main,main,main | depart,use lane straight,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,e | main,main,main | depart,use lane straight,arrive | a,c,e |
|
||||
|
||||
Scenario: But _do_ collapse UseLane step when lanes stay the same
|
||||
Given the node map
|
||||
@@ -902,10 +864,10 @@ Feature: Collapse
|
||||
Given the node map
|
||||
"""
|
||||
i
|
||||
j e d c h
|
||||
|
||||
|
||||
k g a b f
|
||||
j e ~ ~ ~ ~ d c h
|
||||
|
|
||||
|
|
||||
k g ~ ~ ~ ~ a b f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -920,8 +882,8 @@ Feature: Collapse
|
||||
| ej | primary | | off | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| k,j | on,ferry,road,road,ferry,off,off | depart,notification straight,notification straight,continue uturn,turn straight,notification straight,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| k,j | on,ferry,road,road,ferry,off,off | depart,notification straight,notification straight,continue uturn,turn straight,notification straight,arrive | k,g,a,b,d,e,j |
|
||||
|
||||
# http://www.openstreetmap.org/#map=19/37.78090/-122.41251
|
||||
Scenario: U-Turn onto unnamed-road
|
||||
@@ -944,8 +906,8 @@ Feature: Collapse
|
||||
| ef | secondary | | down | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,1 | up,turn,, | depart,turn right,turn sharp right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,1 | up,turn,, | depart,turn right,turn sharp right,arrive | a,b,e,_ |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.48778/13.30024
|
||||
Scenario: Hohenzollerdammbrücke
|
||||
@@ -997,23 +959,21 @@ Feature: Collapse
|
||||
| os | motorway_link | a100 | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ck | kh | k | no_right_turn |
|
||||
| restriction | bk | ki | k | no_left_turn |
|
||||
| restriction | hl | lc | l | no_right_turn |
|
||||
| restriction | gl | ld | l | no_left_turn |
|
||||
| restriction | bc | cm | c | no_right_turn |
|
||||
| restriction | bc | ck | c | no_left_turn |
|
||||
| restriction | nc | cm | c | no_left_turn |
|
||||
| restriction | nc | cd | c | no_right_turn |
|
||||
| restriction | lc | ck | c | no_left_turn |
|
||||
| restriction | lc | cd | c | no_right_turn |
|
||||
| restriction | gh | ho | h | no_right_turn |
|
||||
| restriction | gh | hl | h | no_left_turn |
|
||||
| restriction | kh | hi | h | no_left_turn |
|
||||
| restriction | kh | hl | h | no_right_turn |
|
||||
| restriction | ph | ho | h | no_left_turn |
|
||||
| restriction | ph | hi | h | no_right_turn |
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ck | ki | k | only_straight_on |
|
||||
| restriction | bk | kh | k | only_straight_on |
|
||||
| restriction | hl | ld | l | only_straight_on |
|
||||
| restriction | gl | lc | l | only_straight_on |
|
||||
| restriction | bc | cm | c | no_right_turn |
|
||||
| restriction | bc | ck | c | no_left_turn |
|
||||
| restriction | nc | cm | c | no_left_turn |
|
||||
| restriction | nc | cd | c | no_right_turn |
|
||||
| restriction | lc | cm | c | only_straight_on |
|
||||
| restriction | gh | ho | h | no_right_turn |
|
||||
| restriction | gh | hl | h | no_left_turn |
|
||||
| restriction | kh | ho | h | only_straight_on |
|
||||
| restriction | ph | ho | h | no_left_turn |
|
||||
| restriction | ph | hi | h | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
@@ -1026,3 +986,72 @@ Feature: Collapse
|
||||
| f,e | | | |
|
||||
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j |
|
||||
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
|
||||
|
||||
Scenario: Forking before a turn (forky)
|
||||
Given the node map
|
||||
"""
|
||||
g
|
||||
.
|
||||
c
|
||||
a . . b .'
|
||||
` d.
|
||||
f e
|
||||
"""
|
||||
#Check collapse.detail for a similar case (shorter) that does not classify these turns as a sliproad anymore
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway | highway |
|
||||
| ab | road | yes | primary |
|
||||
| bd | road | yes | primary |
|
||||
| bc | road | yes | primary |
|
||||
| de | road | yes | primary |
|
||||
| fd | cross | no | secondary |
|
||||
| dc | cross | no | secondary |
|
||||
| cg | cross | no | secondary |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bd | dc | d | no_left_turn |
|
||||
| restriction | bc | dc | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | road,cross,cross | depart,fork left,arrive | a,b,g |
|
||||
| a,e | road,road,road | depart,fork slight right,arrive | a,b,e |
|
||||
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f |
|
||||
|
||||
|
||||
# http://www.openstreetmap.org/way/92415447 #3933
|
||||
Scenario: Use total angle for turn instruction if entry step has large distance
|
||||
# """
|
||||
# kf-_ a
|
||||
# | - b
|
||||
# | c
|
||||
# |d
|
||||
# e
|
||||
# |
|
||||
# i
|
||||
# """
|
||||
|
||||
And the node locations
|
||||
| node | lat | lon | #id |
|
||||
| a | -33.9644254 | 151.1378673 | 33226063 |
|
||||
| b | -33.9644373 | 151.1377172 | 1072787030 |
|
||||
| c | -33.9644791 | 151.1374452 | 4222903609 |
|
||||
| d | -33.9645661 | 151.1372654 | 4222903610 |
|
||||
| e | -33.9646986 | 151.1371539 | 4222903611 |
|
||||
| f | -33.964386 | 151.1372133 | 1072786875 |
|
||||
| i | -33.9661796 | 151.1368491 | 2781176918 |
|
||||
| k | -33.9643781 | 151.1371422 | 1684173853 |
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway | #id |
|
||||
| ab | trunk | President Avenue | yes | 92415447 |
|
||||
| bcde | trunk | President Avenue | yes | 422534457 |
|
||||
| bf | trunk | President Avenue | yes | 447779786 |
|
||||
| fk | trunk | President Avenue | yes | 179293012 |
|
||||
| fei | trunk | Princes Highway | yes | 130099670 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,i | President Avenue,Princes Highway,Princes Highway | depart,turn left,arrive | a,b,i |
|
||||
|
||||
@@ -9,7 +9,7 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a b d
|
||||
a - b-d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -26,7 +26,7 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a b d
|
||||
a - b-d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -43,7 +43,7 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a b d
|
||||
a - b-d
|
||||
e
|
||||
"""
|
||||
|
||||
@@ -62,7 +62,7 @@ Feature: Continue Instructions
|
||||
Scenario: Road turning right
|
||||
Given the node map
|
||||
"""
|
||||
a b d
|
||||
a - b-d
|
||||
c
|
||||
"""
|
||||
|
||||
@@ -80,9 +80,9 @@ Feature: Continue Instructions
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
|
||||
a b
|
||||
d
|
||||
/
|
||||
a - b
|
||||
`d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -98,9 +98,9 @@ Feature: Continue Instructions
|
||||
Scenario: Road turning slight right
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
a b
|
||||
|
||||
,d
|
||||
a - b
|
||||
\
|
||||
c
|
||||
"""
|
||||
|
||||
@@ -117,11 +117,11 @@ Feature: Continue Instructions
|
||||
Scenario: Road Loop
|
||||
Given the node map
|
||||
"""
|
||||
f e
|
||||
|
||||
a b g
|
||||
|
||||
c d
|
||||
f - e
|
||||
| |
|
||||
a - b-g |
|
||||
| |
|
||||
c - d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
|
||||
@@ -9,81 +9,153 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b . . c d
|
||||
`h .
|
||||
`
|
||||
1 `
|
||||
.
|
||||
f
|
||||
.
|
||||
a b-----c-d
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | trunk | first | |
|
||||
| ab | trunk | first | |
|
||||
| bc | trunk | first | |
|
||||
| cd | trunk | first | |
|
||||
| bhf | trunk_link | | yes |
|
||||
| cfg | primary | second | yes |
|
||||
| ec | primary | second | |
|
||||
| cf | primary | second | yes |
|
||||
| fg | primary | second | yes |
|
||||
| ec | primary | second | no |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bc | cf | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | first,second,second | depart,turn right,arrive | a,b,g |
|
||||
| a,1 | first,, | depart,turn right,arrive | a,b,_ |
|
||||
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b-----c-d
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway | route |
|
||||
| abc | trunk | first | yes | |
|
||||
| cd | trunk | first | yes | |
|
||||
| bhf | trunk_link | | yes | ferry |
|
||||
| cfg | primary | second | yes | |
|
||||
| ec | primary | second | yes | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cfg | c | no_right_turn |
|
||||
|
||||
#this is very ugly :(, but we don't have a way to overrule ramps right now, also: this tagging sucks
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
||||
|
||||
Scenario: Turning Sliproad onto a ferry
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b-----c-d
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
|
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway | route |
|
||||
| abc | trunk | first | | |
|
||||
| cd | trunk | first | | |
|
||||
| bhf | trunk_link | | yes | |
|
||||
| cf | primary | second | yes | |
|
||||
| fg | primary | second | yes | ferry |
|
||||
| ec | primary | second | yes | |
|
||||
| gi | primary | second | yes | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cf | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,second,second | depart,turn right,arrive |
|
||||
| a,1 | first,, | depart,turn right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,i | first,,second,second,second | depart,off ramp right,turn straight,notification straight,arrive |
|
||||
| a,1 | first,, | depart,off ramp right,arrive |
|
||||
|
||||
Scenario: Turn Instead of Ramp - Max-Speed
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a-b-----c-------------------------d
|
||||
`h |
|
||||
`--h |
|
||||
||
|
||||
1||
|
||||
`|
|
||||
f
|
||||
||
|
||||
`f
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | maxspeed | oneway |
|
||||
| abc | trunk | first | 70 | |
|
||||
| ab | trunk | first | 70 | |
|
||||
| bc | trunk | first | 70 | |
|
||||
| cd | trunk | first | 2 | |
|
||||
| bhf | trunk_link | | 2 | yes |
|
||||
| cfg | primary | second | 50 | yes |
|
||||
| ec | primary | second | 50 | |
|
||||
| cf | primary | second | 50 | yes |
|
||||
| fg | primary | second | 50 | yes |
|
||||
| ec | primary | second | 50 | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cfg | c | no_right_turn |
|
||||
| restriction | bc | cf | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,second,second | depart,turn right,arrive |
|
||||
| a,1 | first,, | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | first,second,second | depart,turn right,arrive | a,b,g |
|
||||
| a,1 | first,, | depart,turn right,arrive | a,b,_ |
|
||||
|
||||
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c d
|
||||
h
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
||||
…
|
||||
a-b-----c--d
|
||||
`--h …
|
||||
\|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
f
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
@@ -94,21 +166,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| efg | primary | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive | a,b,f,g |
|
||||
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c d
|
||||
h
|
||||
|
||||
|
||||
|
||||
|
|
||||
…
|
||||
a-b-----c-d
|
||||
`--h …
|
||||
\|
|
||||
|
|
||||
|
|
||||
f
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
@@ -119,50 +193,52 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| efg | primary | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | first,,second,second | depart,off ramp right,turn straight,arrive | a,b,f,g |
|
||||
|
||||
Scenario: Inner city expressway with on road
|
||||
Given the node map
|
||||
"""
|
||||
a b . . . c g
|
||||
`f .
|
||||
`
|
||||
.
|
||||
.
|
||||
a b-------c-g
|
||||
`--f |
|
||||
\|
|
||||
|
|
||||
|
|
||||
d
|
||||
.
|
||||
.
|
||||
.
|
||||
|
|
||||
|
|
||||
|
|
||||
e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| abc | primary | road | |
|
||||
| ab | primary | road | |
|
||||
| bc | primary | road | |
|
||||
| cg | primary | road | |
|
||||
| bfd | trunk_link | | yes |
|
||||
| cde | trunk | trunk | yes |
|
||||
| cd | trunk | trunk | yes |
|
||||
| de | trunk | trunk | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | abc | cde | c | no_right_turn |
|
||||
| restriction | bc | cd | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,e | road,trunk,trunk | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,e | road,trunk,trunk | depart,turn right,arrive | a,b,e |
|
||||
|
||||
|
||||
Scenario: Slipway Round U-Turn
|
||||
Given the node map
|
||||
"""
|
||||
a f
|
||||
|
||||
| |
|
||||
b e
|
||||
|
||||
|
||||
g
|
||||
|
||||
|\ /|
|
||||
| | |
|
||||
| g |
|
||||
| |
|
||||
c d
|
||||
"""
|
||||
|
||||
@@ -173,18 +249,18 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| def | primary | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f |
|
||||
|
||||
Scenario: Slipway Steep U-Turn
|
||||
Given the node map
|
||||
"""
|
||||
a f
|
||||
|
||||
| |
|
||||
b e
|
||||
g
|
||||
|
||||
|
||||
|\g/|
|
||||
| |
|
||||
| |
|
||||
c d
|
||||
"""
|
||||
|
||||
@@ -195,8 +271,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| def | primary | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,f | road,road,road | depart,continue uturn,arrive | a,b,f |
|
||||
|
||||
Scenario: Schwarzwaldstrasse Autobahn
|
||||
Given the node map
|
||||
@@ -240,21 +316,21 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| qe | secondary_link | Ettlinger Allee | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | ref |
|
||||
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,L561, |
|
||||
| waypoints | route | turns | ref | locations |
|
||||
| a,o | Schwarzwaldstrasse,Ettlinger Allee,Ettlinger Allee | depart,turn right,arrive | L561,, | a,b,o |
|
||||
|
||||
Scenario: Traffic Lights everywhere
|
||||
#http://map.project-osrm.org/?z=18¢er=48.995336%2C8.383813&loc=48.995467%2C8.384548&loc=48.995115%2C8.382761&hl=en&alt=0
|
||||
Given the node map
|
||||
"""
|
||||
a k l j
|
||||
d b c i
|
||||
|
||||
a - - k-l-. j
|
||||
''d'b-c-i
|
||||
\ |
|
||||
e g
|
||||
|
||||
1
|
||||
\|
|
||||
1\|
|
||||
h
|
||||
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
@@ -266,38 +342,46 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
|
||||
And the ways
|
||||
| nodes | highway | name | oneway |
|
||||
| aklbci | secondary | Ebertstrasse | yes |
|
||||
| ak | secondary | Ebertstrasse | yes |
|
||||
| klbc | secondary | Ebertstrasse | yes |
|
||||
| ci | secondary | Ebertstrasse | yes |
|
||||
| kdeh | secondary_link | | yes |
|
||||
| jcghf | primary | Brauerstrasse | yes |
|
||||
| jc | primary | Brauerstrasse | yes |
|
||||
| cgh | primary | Brauerstrasse | yes |
|
||||
| hf | primary | Brauerstrasse | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | klbc | cgh | c | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive |
|
||||
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive |
|
||||
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,i | Ebertstrasse,Ebertstrasse | depart,arrive | a,i |
|
||||
| a,l | Ebertstrasse,Ebertstrasse | depart,arrive | a,l |
|
||||
| a,f | Ebertstrasse,Brauerstrasse,Brauerstrasse | depart,turn right,arrive | a,k,f |
|
||||
| a,1 | Ebertstrasse,, | depart,turn slight right,arrive | a,k,_ |
|
||||
|
||||
#2839
|
||||
Scenario: Self-Loop
|
||||
Given the node map
|
||||
"""
|
||||
l k
|
||||
j
|
||||
m
|
||||
i
|
||||
|
||||
|
||||
h
|
||||
|
||||
n
|
||||
|
||||
g
|
||||
o
|
||||
|
||||
f
|
||||
p
|
||||
e
|
||||
a b c d
|
||||
/-l-----k---\
|
||||
/ `j--
|
||||
m \
|
||||
/ i
|
||||
/ \
|
||||
| \
|
||||
| h
|
||||
| |
|
||||
n |
|
||||
| |
|
||||
| g
|
||||
o |
|
||||
/ /
|
||||
| f
|
||||
/- p /
|
||||
/ e
|
||||
a ------- b --------------- c ----------------- d ---/
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -316,23 +400,23 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Scenario: Self-Loop - Bidirectional
|
||||
Given the node map
|
||||
"""
|
||||
l k
|
||||
j
|
||||
m
|
||||
i
|
||||
|
||||
|
||||
h
|
||||
|
||||
n
|
||||
|
||||
g
|
||||
o
|
||||
|
||||
f
|
||||
p
|
||||
e
|
||||
a b c d
|
||||
/-l-----k---\
|
||||
/ `j--
|
||||
m \
|
||||
/ i
|
||||
/ \
|
||||
| \
|
||||
| h
|
||||
| |
|
||||
n |
|
||||
| |
|
||||
| g
|
||||
o |
|
||||
/ /
|
||||
| f
|
||||
/- p /
|
||||
/ e
|
||||
a ------- b --------------- c ----------------- d ---/
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -349,31 +433,30 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c d
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
e
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
|
||||
|
||||
f g
|
||||
|
||||
a-b ----------------------------------------- c ------------d
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
e |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ |
|
||||
\ 1
|
||||
`---------- f ------- g ----------\
|
||||
| \
|
||||
i h
|
||||
"""
|
||||
|
||||
@@ -389,29 +472,29 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| g | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | # |
|
||||
| a,d | new york,new york | depart,arrive | this is the sinatra route |
|
||||
| a,j | new york,1st street,1st street | depart,turn left,arrive | |
|
||||
| a,1 | new york,m street,1st street,1st street | depart,turn right,turn left,arrive | this can false be seen as a sliproad |
|
||||
| waypoints | route | turns | locations | # |
|
||||
| a,d | new york,new york | depart,arrive | a,d | this is the sinatra route |
|
||||
| a,j | new york,1st street,1st street | depart,turn left,arrive | a,c,j | |
|
||||
| a,1 | new york,m street,1st street,1st street | depart,turn right,turn left,arrive | a,b,g,_ | this can falsly be seen as a sliproad |
|
||||
|
||||
# Merging into degree two loop on dedicated turn detection / 2927
|
||||
Scenario: Turn Instead of Ramp
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
g h
|
||||
d e
|
||||
i c j
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/--------------------f
|
||||
g-----------h--\ |
|
||||
d-----e
|
||||
i c-----------j--/
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
b
|
||||
|
||||
|
|
||||
a
|
||||
"""
|
||||
|
||||
@@ -429,8 +512,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
|
||||
# We don't actually care about routes here, this is all about endless loops in turn discovery
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,i | road,road,road | depart,fork slight left,arrive |
|
||||
| waypoints | route |
|
||||
| a,i | road,road,road |
|
||||
|
||||
|
||||
# The following tests are current false positives / false negatives #3199
|
||||
@@ -460,9 +543,9 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| hid | residential | Waldkauzsteig |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive |
|
||||
| a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,d | Nachtigallensteig,Kiebitzsteig,Kiebitzsteig | depart,turn left,arrive | a,b,d |
|
||||
| a,h | Nachtigallensteig,Nachtigallensteig | depart,arrive | a,h |
|
||||
|
||||
|
||||
@sliproads
|
||||
@@ -486,8 +569,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| aeg | primary | aeg | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive | s,a,e,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Through Street, not a Sliproad although obvious
|
||||
@@ -510,8 +593,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| aeg | primary | aeg | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,aeg,dbef,dbef | depart,turn right,turn right,arrive | s,a,e,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad target turn is restricted
|
||||
@@ -546,9 +629,9 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| restriction | ae | ef | e | no_right_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
|
||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,b,f |
|
||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive | s,a,g |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, road not continuing straight
|
||||
@@ -568,9 +651,9 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| aeg | primary | aeg | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,c | sabc,sabc | depart,arrive |
|
||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,c | sabc,sabc | depart,arrive | s,c |
|
||||
| s,g | sabc,aeg,aeg | depart,turn right,arrive | s,a,g |
|
||||
|
||||
@sliproads
|
||||
Scenario: Intersection too far away with Traffic Light shortly after initial split
|
||||
@@ -603,8 +686,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| ae | primary | ae | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive | s,a,e,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Traffic Signal on Sliproad
|
||||
@@ -636,8 +719,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| ate | primary | ate | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,ef,ef | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,ef,ef | depart,turn right,arrive | s,a,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad tagged as link
|
||||
@@ -664,8 +747,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| ae | motorway_link | ae | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,f | sabc,dbef,dbef | depart,turn right,arrive | s,a,f |
|
||||
|
||||
@sliproads
|
||||
Scenario: Sliproad with same-ish names
|
||||
@@ -691,8 +774,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| af | primary | sliproad | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,t | main,crossing,crossing | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,t | main,crossing,crossing | depart,turn right,arrive | s,a,t |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, name mismatch
|
||||
@@ -720,8 +803,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| af | primary | sliproad | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,t | main,away,away | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,t | main,away,away | depart,turn right,arrive | s,a,t |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, low road priority
|
||||
@@ -750,8 +833,8 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| af | service | sliproad | 30 km/h | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,t | main,away,away | depart,turn right,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,t | main,away,away | depart,turn right,arrive | s,a,t |
|
||||
|
||||
@sliproads
|
||||
Scenario: Not a Sliproad, more than three roads at target intersection
|
||||
@@ -780,5 +863,84 @@ Feature: Slipways and Dedicated Turn Lanes
|
||||
| af | primary | sliproad | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| s,g | main,sliproad,another,another | depart,turn right,turn left,arrive | s,a,f,g |
|
||||
|
||||
@sliproads:
|
||||
Scenario: Throughabout-Sliproad
|
||||
Given the node map
|
||||
"""
|
||||
t
|
||||
|
|
||||
- - e - -
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
z - s - a - - - - - - - b - - -x
|
||||
' c y
|
||||
| |
|
||||
\ /
|
||||
- -d - -
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | junction | # |
|
||||
| zs | through | trunk | yes | | |
|
||||
| sa | through | trunk | yes | | |
|
||||
| ab | through | trunk | yes | | |
|
||||
| bx | through | trunk | yes | | |
|
||||
| ac | round | primary | yes | roundabout | |
|
||||
| cdy | round | primary | yes | roundabout | |
|
||||
| yb | round | primary | yes | roundabout | |
|
||||
| be | round | primary | yes | roundabout | |
|
||||
| ea | round | primary | yes | roundabout | |
|
||||
| et | out | primary | yes | | the extraterrestrial |
|
||||
| sc | | trunk_link | yes | | |
|
||||
| yx | right | trunk_link | yes | | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | sa | ab | a | only_straight |
|
||||
| restriction | ab | bx | b | only_straight |
|
||||
| restriction | yb | be | b | only_straight |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
|
||||
|
||||
Scenario: Sliproad before a roundabout
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a - b - - c - d
|
||||
'f|l'
|
||||
m
|
||||
g
|
||||
|
|
||||
.h-_
|
||||
k - i |
|
||||
'.j.'
|
||||
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | oneway | highway | name |
|
||||
| ab | | yes | primary | road |
|
||||
| bc | | yes | primary | road |
|
||||
| cd | | yes | primary | road |
|
||||
| ec | | yes | secondary | |
|
||||
| cm | | yes | secondary | |
|
||||
| mg | | yes | primary | |
|
||||
| gh | | no | primary | |
|
||||
| hijh | roundabout | yes | primary | |
|
||||
| ik | | yes | primary | |
|
||||
| bfm | | yes | primary | |
|
||||
| gld | | yes | primary | |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bc | cd | c | only_straight |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations |
|
||||
| a,k | road,,, | depart,turn right,roundabout turn right exit-1,arrive | a,b,h,k |
|
||||
|
||||
@@ -16,28 +16,34 @@ Feature: Destination Signs
|
||||
m n
|
||||
o p
|
||||
q r
|
||||
s t
|
||||
u v
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | ref | destination | destination:ref | oneway | # |
|
||||
| ab | AB | E1 | | | yes | |
|
||||
| cd | CD | | Berlin | | yes | |
|
||||
| ef | EF | | Berlin | A1 | yes | |
|
||||
| gh | | | Berlin | A1 | yes | |
|
||||
| ij | | | Berlin | | yes | |
|
||||
| kl | KL | E1 | Berlin | A1 | yes | |
|
||||
| mn | MN | | Berlin;Hamburg | A1;A2 | yes | |
|
||||
| op | OP | | Berlin;Hamburg | A1;A2 | no | mis-tagged destination: not a oneway |
|
||||
| qr | QR | | | A1;A2 | yes | |
|
||||
| nodes | name | ref | destination | destination:ref | destination:street | oneway | # |
|
||||
| ab | AB | E1 | | | | yes | |
|
||||
| cd | CD | | Berlin | | | yes | |
|
||||
| ef | EF | | Berlin | A1 | | yes | |
|
||||
| gh | | | Berlin | A1 | | yes | |
|
||||
| ij | | | Berlin | | | yes | |
|
||||
| kl | KL | E1 | Berlin | A1 | | yes | |
|
||||
| mn | MN | | Berlin;Hamburg | A1;A2 | | yes | |
|
||||
| op | OP | | Berlin;Hamburg | A1;A2 | | no | mis-tagged destination: not a oneway |
|
||||
| qr | QR | | | A1;A2 | | yes | |
|
||||
| st | ST | | | | St Street | yes | |
|
||||
| uv | UV | | Berlin | | St Street | yes | |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | destinations | ref | # |
|
||||
| a | b | AB,AB | , | E1,E1 | |
|
||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||
| i | j | , | Berlin,Berlin | , | |
|
||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||
| from | to | route | destinations | ref | # |
|
||||
| a | b | AB,AB | , | E1,E1 | |
|
||||
| c | d | CD,CD | Berlin,Berlin | , | |
|
||||
| e | f | EF,EF | A1: Berlin,A1: Berlin | , | |
|
||||
| g | h | , | A1: Berlin,A1: Berlin | , | |
|
||||
| i | j | , | Berlin,Berlin | , | |
|
||||
| k | l | KL,KL | A1: Berlin,A1: Berlin | E1,E1 | |
|
||||
| m | n | MN,MN | A1, A2: Berlin, Hamburg,A1, A2: Berlin, Hamburg | , | |
|
||||
| o | p | OP,OP | , | , | guard against mis-tagging |
|
||||
| q | r | QR,QR | A1, A2,A1, A2 | , | |
|
||||
| s | t | ST,ST | St Street,St Street | , | |
|
||||
| u | v | UV,UV | Berlin,Berlin | , | city preferred over street |
|
||||
|
||||
@@ -36,4 +36,4 @@ Feature: Destination Signs
|
||||
| h | g | GH,GH | A2: Hamburg,A2: Hamburg | , | |
|
||||
| i | j | IJ,IJ | A1: Berlin,A1: Berlin | , | |
|
||||
| l | k | KL,KL | A2: Hamburg,A2: Hamburg | , | |
|
||||
| m | n | MN,MN | , | , | guard against mis-tagging |
|
||||
| m | n | MN,MN | , | , | guard against mis-tagging |
|
||||
|
||||
@@ -24,6 +24,44 @@ Feature: End Of Road Instructions
|
||||
| a,c | aeb,cbd,cbd | depart,end of road left,arrive |
|
||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
@3605
|
||||
Scenario: End of Road with oneway through street
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a e b
|
||||
f d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| aeb | primary | no |
|
||||
| cbd | primary | yes |
|
||||
| ef | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | aeb,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
@3605
|
||||
Scenario: End of Road fromnameless onto through street
|
||||
Given the node map
|
||||
"""
|
||||
c
|
||||
a e b
|
||||
f d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name |
|
||||
| aeb | primary | no | |
|
||||
| cbd | primary | yes | cbd |
|
||||
| ef | primary | no | ef |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ,cbd,cbd | depart,end of road right,arrive |
|
||||
|
||||
Scenario: End of Road with three streets
|
||||
Given the node map
|
||||
"""
|
||||
|
||||
@@ -39,8 +39,8 @@ Feature: Fork Instructions
|
||||
| bd | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd,bd | depart,new name slight right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,d | ab,bd | depart,arrive |
|
||||
|
||||
Scenario: Don't Fork On Single Road
|
||||
Given the node map
|
||||
@@ -56,8 +56,8 @@ Feature: Fork Instructions
|
||||
| bd | primary | yes | turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,turn,turn | depart,new name straight,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,d | road,turn | depart,arrive |
|
||||
|
||||
Scenario: Do not fork on link type
|
||||
Given the node map
|
||||
@@ -382,6 +382,6 @@ Feature: Fork Instructions
|
||||
| ab | on | motorway_link |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,j | on,xbcj | depart,arrive |
|
||||
| a,i | on,off,off | depart,turn slight right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,j | on,xbcj | depart,arrive |
|
||||
| a,i | on,off,off | depart,turn right,arrive |
|
||||
|
||||
@@ -110,9 +110,9 @@ Feature: Intersections Data
|
||||
| cf | corner |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
|
||||
| f,a | corner,through,through | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 |
|
||||
| waypoints | route | intersections |
|
||||
| a,d | through,through | true:90,true:0 true:90 false:270,true:90 true:180 false:270;true:270 |
|
||||
| f,a | corner,throughbridge,through | true:0;true:90 false:180 true:270,true:0 false:90 true:270;true:90 |
|
||||
|
||||
Scenario: Roundabouts
|
||||
Given the node map
|
||||
|
||||
@@ -80,8 +80,8 @@ Feature: Exceptions for routing onto low-priority roads
|
||||
| bc | service | service |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | road,service,service | depart,new name straight,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,c | road,service | depart,arrive |
|
||||
|
||||
Scenario: Straight onto low-priority, with driveway
|
||||
Given the node map
|
||||
@@ -114,6 +114,6 @@ Feature: Exceptions for routing onto low-priority roads
|
||||
| bf | driveway | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | road, | depart,arrive |
|
||||
| c,a | ,road,road | depart,new name straight,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,c | road, | depart,arrive |
|
||||
| c,a | ,road | depart,arrive |
|
||||
|
||||
@@ -0,0 +1,525 @@
|
||||
@guidance @merge-segregated
|
||||
Feature: Merge Segregated Roads
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 3 meters
|
||||
|
||||
#http://www.openstreetmap.org/#map=18/52.49950/13.33916
|
||||
@negative
|
||||
Scenario: oneway link road
|
||||
Given the node map
|
||||
"""
|
||||
f - - - - - - -_-_e - - - - d
|
||||
...''
|
||||
a - - - b'- - - - - - - - - c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abc | road | yes |
|
||||
| def | road | yes |
|
||||
| be | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,c | road,road | true:90,true:75 true:90 false:270;true:270 |
|
||||
| d,f | road,road | true:270,false:90 false:255 true:270;true:90 |
|
||||
|
||||
#http://www.openstreetmap.org/#map=18/52.48337/13.36184
|
||||
@negative
|
||||
Scenario: Square Area - Same Name as road for in/out
|
||||
Given the node map
|
||||
"""
|
||||
i
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
/ \
|
||||
a - - - - c e - - - - f
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
d
|
||||
|
|
||||
|
|
||||
|
|
||||
j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ac | road | no |
|
||||
| ef | road | no |
|
||||
| cdegc | road | yes |
|
||||
| ig | top | no |
|
||||
| jd | bot | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,f | road,road,road,road | true:90,false:45 true:135 false:270;true:45 true:180 false:315;true:90 false:225 true:315;true:270 |
|
||||
|
||||
#https://www.openstreetmap.org/#map=19/52.50003/13.33915
|
||||
@negative
|
||||
Scenario: Short Segment due to different roads
|
||||
Given the node map
|
||||
"""
|
||||
. d
|
||||
. '
|
||||
. '
|
||||
. '
|
||||
. '
|
||||
a - - - - - - - b - - c - - - - - - e
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
.
|
||||
f
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| abce | pass | no |
|
||||
| db | pass | yes |
|
||||
| fg | aug | no |
|
||||
| bfc | aug | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,e | pass,pass | true:90,false:60 true:90 true:165 false:270,true:90 false:195 false:270;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Tripple Merge should not be possible
|
||||
Given the node map
|
||||
"""
|
||||
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
||||
.
|
||||
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
||||
'
|
||||
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | in | no |
|
||||
| gfb | merge | yes |
|
||||
| be | merge | yes |
|
||||
| dcb | merge | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,e | in,merge,merge | true:90;false:60 true:90 false:120 false:270;true:270 |
|
||||
|
||||
Scenario: Tripple Merge should not be possible
|
||||
Given the node map
|
||||
"""
|
||||
. f - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - g
|
||||
.
|
||||
a - - - - b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e
|
||||
'
|
||||
' c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | in | no |
|
||||
| gfb | merge | yes |
|
||||
| eb | merge | yes |
|
||||
| bcd | merge | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,d | in,merge,merge | true:90;false:60 false:90 true:120 false:270;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Don't accept turn-restrictions
|
||||
Given the node map
|
||||
"""
|
||||
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d
|
||||
/ \
|
||||
a - - - b g - - h
|
||||
\ /
|
||||
e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | yes |
|
||||
| befgh | road | yes |
|
||||
| bcdg | road | yes |
|
||||
|
||||
# This is an artificial scenario - not reasonable. It is only to test the merging on turn-restrictions
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | ab | bcdg | b | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,h | road,road | true:90,false:60 true:120 false:270,true:90 false:240 false:300;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Actual Turn into segregated ways
|
||||
Given the node map
|
||||
"""
|
||||
a - - - b - < - < - < - < - < - < - < - < - < - < - < c -
|
||||
| \
|
||||
| |
|
||||
| |
|
||||
d |
|
||||
\ |
|
||||
\ |
|
||||
e > - > - > - > - > - > - > - > - > - > - > f - - - - - - g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| fcb | road | yes |
|
||||
| bdef | road | yes |
|
||||
| fg | road | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,g | road,road | true:90,false:90 true:150 false:270,true:90 false:270 true:345;true:270 |
|
||||
|
||||
Scenario: Merging parallel roads with intermediate bridges
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
|
|
||||
.e.
|
||||
/ \
|
||||
/ \
|
||||
g d
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
h c
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
b
|
||||
|
|
||||
a
|
||||
|
|
||||
|
|
||||
r - x - s
|
||||
|
|
||||
|
|
||||
y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway | lanes |
|
||||
| ab | Hermannstr | secondary | | 2 |
|
||||
| bc | Hermannstr | secondary | yes | 2 |
|
||||
| cd | Hermannbruecke | secondary | yes | 2 |
|
||||
| de | Hermannstr | secondary | yes | 2 |
|
||||
| ef | Hermannstr | secondary | | 4 |
|
||||
| eg | Hermannstr | secondary | yes | 2 |
|
||||
| gh | Hermannbruecke | secondary | yes | 2 |
|
||||
| hb | Hermannstr | secondary | yes | 2 |
|
||||
| xa | Hermannstr | secondary | | 4 |
|
||||
| yx | Hermannstr | secondary | | 4 |
|
||||
| rxs | Silbersteinstr | tertiary | | 1 |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
#the intermediate intersections of degree two indicate short segments of new names. At some point, we probably want to get rid of these
|
||||
When I route I should get
|
||||
| waypoints | turns | route | intersections |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 false:180,true:0 false:180;true:180 |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180;true:0 |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr | true:0,true:0 true:90 false:180 true:270,true:0 false:180,true:0 false:180;true:180 |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr | true:180,false:0 true:180,false:0 true:180,false:0 true:90 true:180 true:270;true:0 |
|
||||
|
||||
Scenario: Four Way Intersection Double Through Street Segregated
|
||||
Given the node map
|
||||
"""
|
||||
q p
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
b c
|
||||
\ /
|
||||
\ /
|
||||
\ /
|
||||
j - - - - - - - - - - - - - - - - - i . \ / , d - - - - - - - - - - - - - - - - - o
|
||||
. \/ .
|
||||
> a <
|
||||
. /\ '
|
||||
. / \ '
|
||||
k - - - - - - - - - - - - - - - - - h / \ e - - - - - - - - - - - - - - - - - n
|
||||
/ \
|
||||
/ \
|
||||
g f
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
l m
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name | lanes |
|
||||
| khaij | primary | yes | first | 4 |
|
||||
| odaen | primary | yes | first | 4 |
|
||||
| qbacp | primary | yes | second | 4 |
|
||||
| mfagl | primary | yes | second | 4 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| f,e | second,first,first | depart,turn right,arrive |
|
||||
| f,c | second,second | depart,arrive |
|
||||
| f,i | second,first,first | depart,turn left,arrive |
|
||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||
| d,c | first,second,second | depart,turn right,arrive |
|
||||
| d,i | first,first | depart,arrive |
|
||||
| d,g | first,second,second | depart,turn left,arrive |
|
||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||
| b,i | second,first,first | depart,turn right,arrive |
|
||||
| b,g | second,second | depart,arrive |
|
||||
| b,e | second,first,first | depart,turn left,arrive |
|
||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||
| h,g | first,second,second | depart,turn right,arrive |
|
||||
| h,e | first,first | depart,arrive |
|
||||
| h,c | first,second,second | depart,turn left,arrive |
|
||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Middle Island Over Bridge
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
.b.
|
||||
c h
|
||||
| |
|
||||
| |
|
||||
1 2
|
||||
| |
|
||||
d g
|
||||
'e'
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bc | road | yes |
|
||||
| cd | bridge | yes |
|
||||
| de | road | yes |
|
||||
| eg | road | yes |
|
||||
| gh | bridge | yes |
|
||||
| hb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route | intersections |
|
||||
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
|
||||
| c,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
|
||||
| 1,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
|
||||
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
|
||||
| g,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
|
||||
| 2,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
|
||||
|
||||
@negative
|
||||
Scenario: Traffic Circle
|
||||
Given the node map
|
||||
"""
|
||||
a - - - - b - - - e - - - c - - - - d
|
||||
\ /
|
||||
\ /
|
||||
f
|
||||
|
|
||||
|
|
||||
|
|
||||
g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | left | no |
|
||||
| bfceb | circle | yes |
|
||||
| fg | bottom | no |
|
||||
| cd | right | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
|
||||
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
|
||||
|
||||
Scenario: Middle Island
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
b
|
||||
c h
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
d g
|
||||
e
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,arrive | road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,arrive | road,road |
|
||||
|
||||
Scenario: Traffic Island
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
a - - b < > d - - e
|
||||
c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| de | road | no |
|
||||
| bcdfb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,e | road,road | true:90;true:270 |
|
||||
|
||||
@negative
|
||||
Scenario: Turning Road, Don't remove sliproads
|
||||
Given the node map
|
||||
"""
|
||||
h - - - - - g - - - - - - f - - - - - e
|
||||
_ '
|
||||
.
|
||||
a - - - - - b - - - - - - c - - - - - d
|
||||
|
|
||||
|
|
||||
|
|
||||
i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | yes |
|
||||
| bcd | road | yes |
|
||||
| efgh | road | yes |
|
||||
| fb | road | yes |
|
||||
| bi | turn | yes |
|
||||
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | fb | bcd | b | no_left_turn |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,d | road,road | depart,arrive | true:90,false:60 true:90 true:180 false:270;true:270 |
|
||||
| e,h | road,road | depart,arrive | true:270,false:90 true:240 true:270;true:90 |
|
||||
| e,i | road,turn,turn | depart,turn left,arrive | true:270;false:90 true:240 true:270,false:60 false:90 true:180 false:270;true:0 |
|
||||
@negative
|
||||
Scenario: Meeting Turn Roads
|
||||
Given the node map
|
||||
"""
|
||||
k l
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
h - - - - - g - - - - - - - f - - - - - e
|
||||
| ' ' |
|
||||
| x |
|
||||
| . . |
|
||||
a - - - - - b - - - - - - - c - - - - - d
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
i j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | horiz | yes |
|
||||
| bc | horiz | yes |
|
||||
| cd | horiz | yes |
|
||||
| ef | horiz | yes |
|
||||
| fg | horiz | yes |
|
||||
| gh | horiz | yes |
|
||||
| kg | vert | yes |
|
||||
| gb | vert | yes |
|
||||
| bi | vert | yes |
|
||||
| jc | vert | yes |
|
||||
| cf | vert | yes |
|
||||
| fl | vert | yes |
|
||||
| xg | horiz | no |
|
||||
| xc | horiz | no |
|
||||
| xf | horiz | no |
|
||||
| xb | horiz | no |
|
||||
And the relations
|
||||
| type | way:from | way:to | node:via | restriction |
|
||||
| restriction | bc | cf | c | no_left_turn |
|
||||
| restriction | fg | gb | g | no_left_turn |
|
||||
| restriction | gb | bc | b | no_left_turn |
|
||||
| restriction | cf | fg | f | no_left_turn |
|
||||
| restriction | xb | xf | x | only_straight_on |
|
||||
| restriction | xf | xb | x | only_straight_on |
|
||||
| restriction | xg | xc | x | only_straight_on |
|
||||
| restriction | xc | xg | x | only_straight_on |
|
||||
|
||||
# the goal here should be not to mention the intersection in the middle at all and also suppress the segregated parts
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,l | horiz,vert,vert | true:90;false:0 true:60 true:90 true:180 false:270,true:60 false:120 false:240 false:300,true:0 false:90 false:180 false:240 true:270;true:180 |
|
||||
| a,d | horiz,horiz | true:90,false:0 true:60 true:90 true:180 false:270,false:0 true:90 false:180 false:270 true:300;true:270 |
|
||||
| j,h | vert,horiz,horiz | true:0;true:0 true:90 false:180 false:270 true:300,false:60 false:120 false:240 true:300,false:0 false:90 false:120 true:180 true:270;true:90 |
|
||||
| j,l | vert,vert | true:0,true:0 true:90 false:180 false:270 true:300,true:0 false:90 false:180 true:240 false:270;true:180 |
|
||||
@@ -8,8 +8,8 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g
|
||||
a-b-c-d-e
|
||||
`--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -25,9 +25,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Right Curved Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c
|
||||
f d
|
||||
g e
|
||||
a-b-c
|
||||
`f`d
|
||||
`g`e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -43,12 +43,11 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Right Curved Left
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
d g
|
||||
a b c f
|
||||
,e
|
||||
,d,g
|
||||
a-b-c-f
|
||||
"""
|
||||
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway |
|
||||
| abcde | motorway | |
|
||||
@@ -63,8 +62,8 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Left
|
||||
Given the node map
|
||||
"""
|
||||
f g
|
||||
a b c d e
|
||||
/--f-g
|
||||
a-b-c-d-e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -80,9 +79,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Left Curved Left
|
||||
Given the node map
|
||||
"""
|
||||
g e
|
||||
f d
|
||||
a b c
|
||||
,g,e
|
||||
,f,d
|
||||
a-b-c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -98,9 +97,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Ramp Exit Left Curved Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c f
|
||||
d g
|
||||
e
|
||||
a-b-c-f
|
||||
`d`g
|
||||
`e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -116,8 +115,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On Ramp Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g
|
||||
a-b-c-d-e
|
||||
f-g---'
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -133,8 +132,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On Ramp Left
|
||||
Given the node map
|
||||
"""
|
||||
f g
|
||||
a b c d e
|
||||
f-g---,
|
||||
a-b-c-d-e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -150,9 +149,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Highway Fork
|
||||
Given the node map
|
||||
"""
|
||||
d e
|
||||
a b c
|
||||
f g
|
||||
/--d-e
|
||||
a-b-c
|
||||
\--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -168,9 +167,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Fork After Ramp
|
||||
Given the node map
|
||||
"""
|
||||
d e
|
||||
a b c
|
||||
f g
|
||||
/--d-e
|
||||
a-b-c
|
||||
\--f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -187,8 +186,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On And Off Ramp Right
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g h i
|
||||
a-b---c---d-e
|
||||
f-g--/ \--h i
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -207,8 +206,8 @@ Feature: Motorway Guidance
|
||||
Scenario: On And Off Ramp Left
|
||||
Given the node map
|
||||
"""
|
||||
f g h i
|
||||
a b c d e
|
||||
f-g--\/---h-i
|
||||
a-b---c---d-e
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -227,9 +226,9 @@ Feature: Motorway Guidance
|
||||
Scenario: Merging Motorways
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
a b c
|
||||
d
|
||||
e\
|
||||
a-b-c
|
||||
d/
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -246,8 +245,8 @@ Feature: Motorway Guidance
|
||||
Scenario: Handle 90 degree off ramps correctly
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
x b c y
|
||||
a\
|
||||
x-b---c-y
|
||||
d
|
||||
"""
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Feature: New-Name Instructions
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 100 meters
|
||||
Given a grid size of 150 meters
|
||||
|
||||
Scenario: Undisturbed name Change
|
||||
Given the node map
|
||||
|
||||
@@ -13,23 +13,28 @@ Feature: Simple Turns
|
||||
^
|
||||
/ \
|
||||
c d
|
||||
|\
|
||||
| e
|
||||
|
|
||||
f
|
||||
| |\
|
||||
| | e
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
g f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | road | primary | no |
|
||||
| bc | road | primary | yes |
|
||||
| bcg | road | primary | yes |
|
||||
| fdb | road | primary | yes |
|
||||
| de | turn | primary | no |
|
||||
| ed | turn | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| e,a | depart,turn slight right,arrive | turn,road,road |
|
||||
| waypoints | turns | route | intersections |
|
||||
| f,a | depart,arrive | road,road | true:0,true:0 false:150 false:180;true:180 |
|
||||
| e,a | depart,turn slight right,arrive | turn,road,road | true:333;true:0 false:150 false:180;true:180 |
|
||||
|
||||
Scenario: Turning into splitting road
|
||||
Given the node map
|
||||
@@ -39,16 +44,22 @@ Feature: Simple Turns
|
||||
/\
|
||||
/ \
|
||||
c d
|
||||
|\
|
||||
| e
|
||||
|
|
||||
f
|
||||
| |\
|
||||
| | e
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
h f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | road | primary | no |
|
||||
| bc | road | primary | yes |
|
||||
| bch | road | primary | yes |
|
||||
| fdb | road | primary | yes |
|
||||
| de | turn | primary | no |
|
||||
| bg | left | primary | yes |
|
||||
@@ -61,108 +72,6 @@ Feature: Simple Turns
|
||||
| f,g | depart,turn left,arrive | road,left,left |
|
||||
| f,c | depart,continue uturn,arrive | road,road,road |
|
||||
|
||||
Scenario: Middle Island
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
||||
b
|
||||
c h
|
||||
|
||||
|
||||
|
||||
|
||||
d g
|
||||
e
|
||||
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bcde | road | yes |
|
||||
| eghb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,arrive | road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,arrive | road,road |
|
||||
|
||||
Scenario: Middle Island Over Bridge
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
|
|
||||
.b.
|
||||
c h
|
||||
| |
|
||||
| |
|
||||
1 2
|
||||
| |
|
||||
d g
|
||||
'e'
|
||||
|
|
||||
f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | road | no |
|
||||
| ef | road | no |
|
||||
| bc | road | yes |
|
||||
| cd | bridge | yes |
|
||||
| de | road | yes |
|
||||
| eg | road | yes |
|
||||
| gh | bridge | yes |
|
||||
| hb | road | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | road,road |
|
||||
| c,f | depart,new name straight,arrive | bridge,road,road |
|
||||
| 1,f | depart,new name straight,arrive | bridge,road,road |
|
||||
| f,a | depart,arrive | road,road |
|
||||
| g,a | depart,new name straight,arrive | bridge,road,road |
|
||||
| 2,a | depart,new name straight,arrive | bridge,road,road |
|
||||
|
||||
@negative
|
||||
Scenario: Don't Collapse Places:
|
||||
Given the node map
|
||||
"""
|
||||
h
|
||||
g
|
||||
|
||||
|
||||
|
||||
|
||||
a b e f
|
||||
|
||||
|
||||
|
||||
|
||||
c
|
||||
d
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | oneway |
|
||||
| ab | place | no |
|
||||
| cd | bottom | no |
|
||||
| ef | place | no |
|
||||
| gh | top | no |
|
||||
| bcegb | place | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,turn right,arrive | place,bottom,bottom |
|
||||
| a,f | depart,continue left,continue right,arrive | place,place,place,place |
|
||||
| d,f | depart,turn right,continue right,arrive | bottom,place,place,place |
|
||||
| d,h | depart,turn right,continue left,turn right,arrive | bottom,place,place,top,top |
|
||||
|
||||
@bug @not-sorted @3179
|
||||
Scenario: Adjusting road angles to not be sorted
|
||||
Given the node map
|
||||
@@ -188,5 +97,5 @@ Feature: Simple Turns
|
||||
| ei | left | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| g,a | in,road,road |
|
||||
| waypoints | route | turns |
|
||||
| g,a | in,road,road | depart,fork right,arrive |
|
||||
|
||||
@@ -233,9 +233,9 @@ Feature: Ramp Guidance
|
||||
| cd | motorway |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | ac,cd,cd | depart,new name slight left,arrive |
|
||||
| b,d | bc,cd,cd | depart,new name slight right,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,d | ac,cd | depart,arrive |
|
||||
| b,d | bc,cd | depart,arrive |
|
||||
|
||||
Scenario: Two Ramps Joining into common Motorway Unnamed
|
||||
Given the node map
|
||||
@@ -261,7 +261,7 @@ Feature: Ramp Guidance
|
||||
"""
|
||||
d - e - g
|
||||
|
|
||||
a - b ~ ~ ~ ~ ~ ~ ~ c
|
||||
a - b ~ ~ ~ ~ ~ ~ ~ c
|
||||
` f
|
||||
"""
|
||||
|
||||
@@ -271,8 +271,8 @@ Feature: Ramp Guidance
|
||||
| bc | | ferry | boaty mc boatface | m2 |
|
||||
| cf | | ferry | boaty mc boatface | |
|
||||
| cd | | ferry | boaty mc boatface's cousin | |
|
||||
| de | motorway_link | | | |
|
||||
| de | motorway_link | | | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,e | boarding,boaty mc boatface,boaty mc boatface's cousin,, |
|
||||
| waypoints | route |
|
||||
| a,e | boarding,boaty mc boatface,, |
|
||||
|
||||
@@ -410,10 +410,10 @@ Feature: Basic Roundabout
|
||||
| h | give_way |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
# since we cannot handle these invalid roundabout tags yet, we cannout output roundabout taggings. This will hopefully change some day
|
||||
| waypoints | route | turns | locations |
|
||||
# since we cannot handle these invalid roundabout tags yet, we cannot output roundabout taggings. This will hopefully change some day
|
||||
#| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive |
|
||||
| w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn straight,arrive |
|
||||
| w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn straight,arrive | w,b,d,f,x |
|
||||
|
||||
Scenario: Use Lane in Roundabout
|
||||
Given the node map
|
||||
@@ -535,3 +535,175 @@ Feature: Basic Roundabout
|
||||
| i,n | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-2,arrive |
|
||||
| i,d | Petersburger Strasse,Weidenweg,Weidenweg | depart,Bersarinplatz-exit-3,arrive |
|
||||
| i,g | Petersburger Strasse,Petersburger Strasse,Petersburger Strasse | depart,Bersarinplatz-exit-4,arrive |
|
||||
|
||||
@turboroundabout
|
||||
# http://www.openstreetmap.org/?mlat=48.782118&mlon=8.194456&zoom=16#map=19/48.78216/8.19457
|
||||
Scenario: Turboroundabout, Baden-Baden
|
||||
Given the node map
|
||||
"""
|
||||
a p
|
||||
b o
|
||||
d c m n
|
||||
f e k l
|
||||
g i
|
||||
h j
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | junction | name | turn:lanes |
|
||||
| ab | trunk_link | yes | | | |
|
||||
| bc | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
||||
| cd | trunk | yes | | Europastrasse | |
|
||||
| ce | trunk | yes | roundabout | Europaplatz | |
|
||||
| fe | trunk | yes | | Europastrasse | |
|
||||
| eg | trunk | yes | roundabout | Europaplatz | |
|
||||
| gh | residential | yes | | Allee Cite | |
|
||||
| gi | trunk | yes | roundabout | Europaplatz | |
|
||||
| ji | residential | yes | | Allee Cite | |
|
||||
| ik | trunk | yes | roundabout | Europaplatz | slight_left;slight_right\|slight_right |
|
||||
| kl | trunk | yes | | Europastrasse | |
|
||||
| km | trunk | yes | roundabout | Europaplatz | |
|
||||
| nm | trunk | yes | | Europastrasse | |
|
||||
| mo | trunk | yes | roundabout | Europaplatz | |
|
||||
| op | trunk_link | yes | | | |
|
||||
| ob | trunk | yes | roundabout | Europaplatz | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-1,arrive | ,, |
|
||||
| a,h | ,Allee Cite,Allee Cite | depart,Europaplatz-exit-2,arrive | ,, |
|
||||
| a,l | ,Europastrasse,Europastrasse | depart,Europaplatz-exit-3,arrive | ,, |
|
||||
| a,p | ,, | depart,Europaplatz-exit-4,arrive | ,, |
|
||||
|
||||
@turboroundabout
|
||||
# http://www.openstreetmap.org/?mlat=50.180039&mlon=8.474939&zoom=16#map=19/50.17999/8.47506
|
||||
Scenario: Turboroundabout, Königstein im Taunus
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b w t v
|
||||
c s u
|
||||
d r
|
||||
f e q
|
||||
g p
|
||||
h i n
|
||||
j k m
|
||||
l o
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | junction | name | turn:lanes |
|
||||
| ab | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||
| bc | primary | yes | roundabout | | through\|through;right |
|
||||
| cd | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| df | tertiary | yes | | Frankfurter Strasse | |
|
||||
| de | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| fe | tertiary | yes | | Frankfurter Strasse | |
|
||||
| eg | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| gh | primary | yes | | Bischof-Kaller-Strasse | |
|
||||
| gi | primary | yes | roundabout | | left\|through;slight_left\|through |
|
||||
| ji | primary | yes | | Bischof-Kaller-Strasse | |
|
||||
| ik | primary | yes | roundabout | | left\|through;slight_left\|through |
|
||||
| km | primary | yes | roundabout | | |
|
||||
| kl | primary | yes | | Sodener Strasse | |
|
||||
| mn | primary | yes | roundabout | | through\|through;right |
|
||||
| on | primary | yes | | Sodener Strasse | |
|
||||
| np | primary | yes | roundabout | | through\|through;right |
|
||||
| pq | primary | yes | roundabout | | through\|through\|right;through |
|
||||
| qr | primary | yes | | | |
|
||||
| qs | primary | yes | roundabout | | |
|
||||
| us | primary_link | yes | | | |
|
||||
| st | primary | yes | roundabout | | |
|
||||
| vt | primary | yes | | | |
|
||||
| tw | primary | yes | roundabout | | left\|left\|right\|right |
|
||||
| wa | primary | yes | | Le-Cannet-Rocheville-Strasse | |
|
||||
| wb | primary | yes | roundabout | | through\|through;right |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,w | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-undefined,arrive | ,, |
|
||||
| a,r | Le-Cannet-Rocheville-Strasse,, | depart,roundabout-exit-4,arrive | ,, |
|
||||
| a,f | Le-Cannet-Rocheville-Strasse,Frankfurter Strasse,Frankfurter Strasse | depart,roundabout-exit-1,arrive | ,, |
|
||||
| a,h | Le-Cannet-Rocheville-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-2,arrive | ,, |
|
||||
| u,r | ,, | depart,roundabout-exit-5,arrive | ,, |
|
||||
| j,h | Bischof-Kaller-Strasse,Bischof-Kaller-Strasse,Bischof-Kaller-Strasse | depart,roundabout-exit-5,arrive | ,, |
|
||||
| n,m | , | depart,arrive | , |
|
||||
|
||||
@turboroundabout
|
||||
# http://www.openstreetmap.org/?mlat=47.57723&mlon=7.796765&zoom=16#map=19/47.57720/7.79711
|
||||
Scenario: Turboroundabout, Rheinfelden (Baden)
|
||||
Given the node map
|
||||
"""
|
||||
r w
|
||||
a l k
|
||||
b j
|
||||
c
|
||||
d i
|
||||
s e f g h v
|
||||
|
||||
t u
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | junction |
|
||||
| ar | secondary | yes | |
|
||||
| ab | primary | yes | roundabout |
|
||||
| rb | secondary | yes | |
|
||||
| bc | primary | yes | roundabout |
|
||||
| cd | primary | yes | roundabout |
|
||||
| ds | primary | yes | |
|
||||
| se | primary | yes | |
|
||||
| de | primary | yes | roundabout |
|
||||
| ef | primary | yes | roundabout |
|
||||
| ft | unclassified | yes | |
|
||||
| fg | primary | yes | roundabout |
|
||||
| ug | unclassified | yes | |
|
||||
| gh | primary | yes | roundabout |
|
||||
| hv | primary | yes | |
|
||||
| hi | primary | yes | roundabout |
|
||||
| vi | primary | yes | |
|
||||
| ij | primary | yes | roundabout |
|
||||
| jw | tertiary | yes | |
|
||||
| jk | primary | yes | roundabout |
|
||||
| wk | tertiary | yes | |
|
||||
| kl | primary | yes | roundabout |
|
||||
| la | primary | yes | roundabout |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| w,r | wk,ar,ar | depart,roundabout-exit-1,arrive |
|
||||
| w,s | wk,ds,ds | depart,roundabout-exit-2,arrive |
|
||||
| w,t | wk,ft,ft | depart,roundabout-exit-3,arrive |
|
||||
| w,v | wk,hv,hv | depart,roundabout-exit-4,arrive |
|
||||
| u,v | ug,hv,hv | depart,roundabout-exit-1,arrive |
|
||||
| u,w | ug,jw,jw | depart,roundabout-exit-2,arrive |
|
||||
| u,r | ug,ar,ar | depart,roundabout-exit-3,arrive |
|
||||
| u,s | ug,ds,ds | depart,roundabout-exit-4,arrive |
|
||||
| u,t | ug,ft,ft | depart,roundabout-exit-5,arrive |
|
||||
|
||||
|
||||
@3762
|
||||
Scenario: Only Enter
|
||||
Given the node map
|
||||
"""
|
||||
a
|
||||
b
|
||||
i c e ~ ~ ~ f - h
|
||||
j d
|
||||
k g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | junction | route |
|
||||
| ab | | |
|
||||
| ef | | ferry |
|
||||
| fh | | |
|
||||
| dg | | |
|
||||
| ic | | |
|
||||
| jk | | |
|
||||
| bcjdeb | roundabout | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,h | ab,ef,ef,fh,fh | depart,roundabout-exit-4,notification slight right,notification straight,arrive |
|
||||
|
||||
@@ -25,20 +25,20 @@ Feature: Staggered Intersections
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Oak St | depart,arrive |
|
||||
| g,a | Oak St,Oak St | depart,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | Oak St,Oak St | depart,arrive | a,g |
|
||||
| g,a | Oak St,Oak St | depart,arrive | g,a |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if long segment in between
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
d
|
||||
|
||||
|
||||
|
|
||||
|
|
||||
e f g
|
||||
h
|
||||
i
|
||||
@@ -51,16 +51,18 @@ Feature: Staggered Intersections
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | a,c,e,g |
|
||||
| g,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | g,e,c,a |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if not left-right or right-left
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
a b c
|
||||
|
|
||||
d
|
||||
|
|
||||
g f e
|
||||
h
|
||||
i
|
||||
@@ -73,11 +75,11 @@ Feature: Staggered Intersections
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
|
||||
| g,a | Oak St,Oak St,Oak St | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | Oak St,Oak St,Oak St | depart,continue uturn,arrive | a,c,g |
|
||||
| g,a | Oak St,Oak St,Oak St | depart,continue uturn,arrive | g,e,a |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if the names are not the same
|
||||
Scenario: Staggered Intersection: use new-name if the names are not the same
|
||||
Given the node map
|
||||
"""
|
||||
j
|
||||
@@ -95,9 +97,9 @@ Feature: Staggered Intersections
|
||||
| jcdehi | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Oak St,Cedar Dr,Elm St,Elm St | depart,turn right,turn left,arrive |
|
||||
| g,a | Elm St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,g | Oak St,Elm St | depart,arrive | a,g |
|
||||
| g,a | Elm St,Oak St | depart,arrive | g,a |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse if a mode change is involved
|
||||
Given the node map
|
||||
@@ -105,7 +107,7 @@ Feature: Staggered Intersections
|
||||
j
|
||||
a b c
|
||||
d
|
||||
e f g
|
||||
e~~f - - - - g
|
||||
h
|
||||
"""
|
||||
|
||||
@@ -117,9 +119,9 @@ Feature: Staggered Intersections
|
||||
| jcdeh | primary | road | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | modes |
|
||||
| a,g | to_sea,road,to_sea,road,road | depart,turn right,turn left,notification straight,arrive | driving,driving,ferry,driving,driving |
|
||||
| g,a | road,to_sea,road,to_sea,to_sea | depart,notification straight,turn right,turn left,arrive | driving,ferry,driving,driving,driving |
|
||||
| waypoints | route | turns | modes | locations |
|
||||
| a,g | to_sea,road,to_sea,road,road | depart,turn right,turn left,notification straight,arrive | driving,driving,ferry,driving,driving | a,c,e,f,g |
|
||||
| g,a | road,to_sea,road,to_sea,to_sea | depart,notification straight,turn right,turn left,arrive | driving,ferry,driving,driving,driving | g,f,e,c,a |
|
||||
|
||||
Scenario: Staggered Intersection: do not collapse intermediary intersections
|
||||
Given the node map
|
||||
@@ -127,7 +129,9 @@ Feature: Staggered Intersections
|
||||
j
|
||||
a b c
|
||||
e f g
|
||||
|
|
||||
d
|
||||
|
|
||||
k l m
|
||||
i
|
||||
"""
|
||||
@@ -140,6 +144,6 @@ Feature: Staggered Intersections
|
||||
| jcedki | residential | Cedar Dr |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,m | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| m,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive |
|
||||
| waypoints | route | turns | locations |
|
||||
| a,m | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | a,c,k,m |
|
||||
| m,a | Oak St,Cedar Dr,Oak St,Oak St | depart,turn right,turn left,arrive | m,k,c,a |
|
||||
|
||||
@@ -8,8 +8,8 @@ Feature: Suppressed Turns
|
||||
Scenario: Do not announce passing a exit ramp
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e
|
||||
f g
|
||||
a-b-c-d-e
|
||||
\---f-g
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -24,7 +24,7 @@ Feature: Suppressed Turns
|
||||
Scenario: Do not announce reference changes
|
||||
Given the node map
|
||||
"""
|
||||
a b c d e f
|
||||
a-b-c-d-e-f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
@@ -43,7 +43,7 @@ Feature: Suppressed Turns
|
||||
Scenario: Don't Announce Turn on following major road class -- service
|
||||
Given the node map
|
||||
"""
|
||||
a b d
|
||||
a-b-d
|
||||
c
|
||||
"""
|
||||
|
||||
@@ -59,7 +59,7 @@ Feature: Suppressed Turns
|
||||
Scenario: Don't Announce Turn on following major road class -- residential
|
||||
Given the node map
|
||||
"""
|
||||
a b d
|
||||
a-b-d
|
||||
c
|
||||
"""
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ Feature: Simple Turns
|
||||
| nodes | highway | name | lanes | oneway |
|
||||
| akb | primary | road | 4 | yes |
|
||||
| hgi | primary | road | 4 | yes |
|
||||
| akcdefg | primary_link | | 1 | yes |
|
||||
| kcdefg | primary_link | | 1 | yes |
|
||||
| gj | tertiary | turn | 1 | |
|
||||
|
||||
When I route I should get
|
||||
@@ -444,7 +444,7 @@ Feature: Simple Turns
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | locations | # |
|
||||
| g,f | turn,road | depart,arrive | g,f | #could offer an additional turn at `e` if you don't detect the turn in between as curve |
|
||||
| g,f | turn,road,road | depart,turn left,arrive | g,e,f | #could offer an additional turn at `e` if you don't detect the turn in between as curve |
|
||||
| c,f | road,road,road | depart,continue right,arrive | c,b,f | |
|
||||
|
||||
#http://www.openstreetmap.org/search?query=52.479264%2013.295617#map=19/52.47926/13.29562
|
||||
@@ -768,7 +768,31 @@ Feature: Simple Turns
|
||||
|
||||
. .
|
||||
|
||||
g h
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
. .
|
||||
|
||||
g h
|
||||
"""
|
||||
|
||||
And the nodes
|
||||
@@ -784,15 +808,15 @@ Feature: Simple Turns
|
||||
| cjk | Friede | no | | tertiary |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,g | Perle,Heide,Heide | depart,turn right,arrive |
|
||||
| a,k | Perle,Friede,Friede | depart,turn left,arrive |
|
||||
| a,e | Perle,Perle | depart,arrive |
|
||||
| e,k | Perle,Friede,Friede | depart,turn right,arrive |
|
||||
| e,g | Perle,Heide,Heide | depart,turn left,arrive |
|
||||
| h,k | Heide,Friede,Friede | depart,new name slight left,arrive |
|
||||
| h,e | Heide,Perle,Perle | depart,turn right,arrive |
|
||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive |
|
||||
| waypoints | route | turns | intersections |
|
||||
| a,g | Perle,Heide,Heide | depart,turn right,arrive | true:90;true:90 true:180 false:270 true:345;true:18 |
|
||||
| a,k | Perle,Friede,Friede | depart,turn left,arrive | true:90;true:90 true:180 false:270 true:345;true:153 |
|
||||
| a,e | Perle,Perle | depart,arrive | true:90,true:90 true:180 false:270 true:345;true:270 |
|
||||
| e,k | Perle,Friede,Friede | depart,turn right,arrive | true:270;false:90 true:180 true:270 true:345;true:153 |
|
||||
| e,g | Perle,Heide,Heide | depart,turn left,arrive | true:270;false:90 true:180 true:270 true:345;true:18 |
|
||||
| h,k | Heide,Friede | depart,arrive | true:16,true:90 true:180 true:270 true:345;true:153 |
|
||||
| h,e | Heide,Perle,Perle | depart,turn right,arrive | true:16;true:90 true:180 true:270 true:345;true:270 |
|
||||
| h,a | Heide,Perle,Perle | depart,turn left,arrive | true:16;true:90 true:180 true:270 true:345;true:90 |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.53293/13.32956
|
||||
Scenario: Curved Exit from Curved Road
|
||||
@@ -828,9 +852,9 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
||||
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
|
||||
| a,g | Siemens,Erna | depart,arrive |
|
||||
| g,j | Erna,Siemens,Siemens | depart,turn left,arrive |
|
||||
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
|
||||
| g,a | Erna,Siemens | depart,arrive |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.51303/13.32170
|
||||
Scenario: Ernst Reuter Platz
|
||||
@@ -930,6 +954,36 @@ Feature: Simple Turns
|
||||
. . .
|
||||
. . .
|
||||
i . .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
. .
|
||||
e a
|
||||
"""
|
||||
|
||||
@@ -1134,12 +1188,12 @@ Feature: Simple Turns
|
||||
| j | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | rose,trift,trift | depart,new name slight left,arrive |
|
||||
| a,k | rose,muhle,muhle | depart,turn slight right,arrive |
|
||||
| d,f | trift,rose,rose | depart,new name straight,arrive |
|
||||
| d,k | trift,muhle,muhle | depart,turn sharp left,arrive |
|
||||
| d,c | trift,trift,trift | depart,continue uturn,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,c | rose,trift | depart,arrive |
|
||||
| a,k | rose,muhle,muhle | depart,turn slight right,arrive |
|
||||
| d,f | trift,rose | depart,arrive |
|
||||
| d,k | trift,muhle,muhle | depart,turn sharp left,arrive |
|
||||
| d,c | trift,trift,trift | depart,continue uturn,arrive |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/52.50740/13.44824
|
||||
Scenario: Turning Loop at the end of the road
|
||||
@@ -1221,8 +1275,8 @@ Feature: Simple Turns
|
||||
| bcde | 6 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,e | ab,bcde,bcde |
|
||||
| waypoints | route |
|
||||
| a,e | ab,bcde |
|
||||
|
||||
|
||||
@3401
|
||||
@@ -1258,5 +1312,62 @@ Feature: Simple Turns
|
||||
|
||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
||||
When I route I should get
|
||||
| waypoints | route | intersections |
|
||||
| a,g | ab,bcdefgh,bcdefgh | true:90;true:45 false:180 false:270;true:180 |
|
||||
| waypoints | route | intersections |
|
||||
| a,g | ab,bcdefgh | true:90,true:45 false:180 false:270;true:180 |
|
||||
|
||||
#https://github.com/Project-OSRM/osrm-backend/pull/3469#issuecomment-270806580
|
||||
Scenario: Oszillating Lower Priority Road
|
||||
#Given the node map
|
||||
# """
|
||||
# a -db c
|
||||
# f
|
||||
# """
|
||||
Given the node locations
|
||||
| node | lat | lon | # |
|
||||
| a | 1.0 | 1.0 | |
|
||||
| b | 1.0000179813587253 | 1.0 | |
|
||||
| c | 1.0000204580571323 | 1.0 | |
|
||||
| d | 1.0000179813587253 | 1.0 | same as b |
|
||||
| f | 1.0000179813587253 | 1.0000179813587253 | |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | lanes | highway |
|
||||
| ab | yes | 1 | primary |
|
||||
| bf | yes | 1 | primary |
|
||||
| bcd | yes | 1 | service |
|
||||
|
||||
# we don't care for turn instructions, this is a coordinate extraction bug check
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,d | ab,ab |
|
||||
|
||||
Scenario: Sharp Turn Onto A Bridge
|
||||
Given the node map
|
||||
"""
|
||||
e
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
ga - - -b
|
||||
f /
|
||||
d -c
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | oneway | lanes |
|
||||
| gaf | yes | 1 |
|
||||
| abcde | yes | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| g,e | abcde,abcde |
|
||||
|
||||
@@ -3,7 +3,7 @@ Feature: Turn Lane Guidance
|
||||
|
||||
Background:
|
||||
Given the profile "car"
|
||||
Given a grid size of 20 meters
|
||||
Given a grid size of 5 meters
|
||||
|
||||
@simple
|
||||
Scenario: Basic Turn Lane 3-way Turn with empty lanes
|
||||
@@ -599,22 +599,32 @@ Feature: Turn Lane Guidance
|
||||
Scenario: Segregated Intersection Merges With Lanes
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
|
||||
e d
|
||||
c g
|
||||
a b
|
||||
|
||||
h
|
||||
a e
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
b d
|
||||
h c
|
||||
' -- g - - f
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | turn:lanes:forward | oneway | highway |
|
||||
| abc | road | left\|left\|left\|through\|through | yes | primary |
|
||||
| cde | road | | yes | primary |
|
||||
| hc | cross | | yes | secondary |
|
||||
| cg | straight | | no | tertiary |
|
||||
| cf | left | | yes | primary |
|
||||
| nodes | name | turn:lanes:forward | oneway | highway | lanes |
|
||||
| abc | road | left\|left\|left\|through\|through | yes | primary | 2 |
|
||||
| cde | road | | yes | primary | 2 |
|
||||
| hc | cross | | yes | secondary | |
|
||||
| cg | straight | | no | tertiary | |
|
||||
| cf | left | | yes | primary | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
@@ -809,6 +819,10 @@ Feature: Turn Lane Guidance
|
||||
"""
|
||||
a b e
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
d c f
|
||||
"""
|
||||
|
||||
@@ -859,9 +873,9 @@ Feature: Turn Lane Guidance
|
||||
| ab | on | motorway_link | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,j | on,xbcj | depart,arrive | , |
|
||||
| a,i | on,off,off | depart,turn slight right,arrive | ,none:false slight right:true, |
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,j | on,xbcj | depart,arrive | , |
|
||||
| a,i | on,off,off | depart,turn right,arrive | ,none:false slight right:true, |
|
||||
|
||||
#http://www.openstreetmap.org/#map=17/52.47414/13.35712
|
||||
@todo @ramp @2645
|
||||
@@ -938,9 +952,9 @@ Feature: Turn Lane Guidance
|
||||
| dce | cross | primary | yes | | 1 |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, |
|
||||
| a,e | road,cross,cross | depart,turn left,arrive | ,left:true right:false, |
|
||||
| waypoints | route | turns | lanes | locations |
|
||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e |
|
||||
|
||||
Scenario: Partitioned turn, Slight Curve
|
||||
Given the node map
|
||||
@@ -961,9 +975,9 @@ Feature: Turn Lane Guidance
|
||||
| dce | cross | primary | yes | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, |
|
||||
| a,e | road,cross,cross | depart,turn left,arrive | ,left:true right:false, |
|
||||
| waypoints | route | turns | lanes | locations |
|
||||
| a,g | road,cross,cross | depart,turn right,arrive | ,left:false right:true, | a,b,g |
|
||||
| a,e | road,cross,cross | depart,end of road left,arrive | ,left:true right:false, | a,c,e |
|
||||
|
||||
Scenario: Lane Parsing Issue #2694
|
||||
Given the node map
|
||||
@@ -1159,3 +1173,45 @@ Feature: Turn Lane Guidance
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
| 1,a | 90,2 180,180 | | |
|
||||
|
||||
@3379
|
||||
Scenario: Don't Turn through potential through lanes
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
a - - - - b - - - - - c
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | oneway | turn:lanes:forward |
|
||||
| ab | road | yes | left\|none\|none |
|
||||
| bc | road | yes | |
|
||||
| ebd | cross | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,e | road,cross,cross | depart,turn right,arrive | ,left:false none:false none:true, |
|
||||
| a,c | road,road | depart,arrive | , |
|
||||
|
||||
@3379
|
||||
Scenario: Don't Turn through potential through lanes
|
||||
Given the node map
|
||||
"""
|
||||
d
|
||||
|
|
||||
a - - - - b - - - - - c
|
||||
|
|
||||
e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | oneway | turn:lanes:forward |
|
||||
| ab | road | yes | none\|none\|right |
|
||||
| bc | road | yes | |
|
||||
| ebd | cross | no | |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns | lanes |
|
||||
| a,d | road,cross,cross | depart,turn left,arrive | ,none:true none:false right:false, |
|
||||
| a,c | road,road | depart,arrive | , |
|
||||
|
||||
+69
-184
@@ -23,15 +23,15 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
||||
| a,e | ab,eb,eb | depart,new name straight,arrive |
|
||||
| a,e | ab,eb | depart,arrive |
|
||||
| a,d | ab,db,db | depart,turn right,arrive |
|
||||
| c,a | cb,ab,ab | depart,turn right,arrive |
|
||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
||||
| c,d | cb,db | depart,arrive |
|
||||
| c,e | cb,eb,eb | depart,turn left,arrive |
|
||||
| d,a | db,ab,ab | depart,turn left,arrive |
|
||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
||||
| d,c | db,cb | depart,arrive |
|
||||
| d,e | db,eb,eb | depart,turn right,arrive |
|
||||
| e,a | eb,ab,ab | depart,new name straight,arrive |
|
||||
| e,a | eb,ab | depart,arrive |
|
||||
| e,c | eb,cb,cb | depart,turn right,arrive |
|
||||
| e,d | eb,db,db | depart,turn left,arrive |
|
||||
|
||||
@@ -53,15 +53,15 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
||||
| a,e | ab,eb,eb | depart,new name straight,arrive |
|
||||
| a,e | ab,eb | depart,arrive |
|
||||
| a,d | ab,db,db | depart,turn right,arrive |
|
||||
| c,a | cb,ab,ab | depart,turn right,arrive |
|
||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
||||
| c,d | cb,db | depart,arrive |
|
||||
| c,e | cb,eb,eb | depart,turn left,arrive |
|
||||
| d,a | db,ab,ab | depart,turn left,arrive |
|
||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
||||
| d,c | db,cb | depart,arrive |
|
||||
| d,e | db,eb,eb | depart,turn right,arrive |
|
||||
| e,a | eb,ab,ab | depart,new name straight,arrive |
|
||||
| e,a | eb,ab | depart,arrive |
|
||||
| e,c | eb,cb,cb | depart,turn right,arrive |
|
||||
| e,d | eb,db,db | depart,turn left,arrive |
|
||||
|
||||
@@ -86,10 +86,10 @@ Feature: Simple Turns
|
||||
| a,e | abe,abe | depart,arrive |
|
||||
| a,d | abe,db,db | depart,turn right,arrive |
|
||||
| c,a | cb,abe,abe | depart,turn right,arrive |
|
||||
| c,d | cb,db,db | depart,new name straight,arrive |
|
||||
| c,d | cb,db | depart,arrive |
|
||||
| c,e | cb,abe,abe | depart,turn left,arrive |
|
||||
| d,a | db,abe,abe | depart,turn left,arrive |
|
||||
| d,c | db,cb,cb | depart,new name straight,arrive |
|
||||
| d,c | db,cb | depart,arrive |
|
||||
| d,e | db,abe,abe | depart,turn right,arrive |
|
||||
| e,a | abe,abe | depart,arrive |
|
||||
| e,c | abe,cb,cb | depart,turn right,arrive |
|
||||
@@ -139,9 +139,9 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | ab,cb,cb | depart,turn left,arrive |
|
||||
| a,d | ab,db,db | depart,new name straight,arrive |
|
||||
| a,d | ab,db | depart,arrive |
|
||||
| d,c | db,cb,cb | depart,turn right,arrive |
|
||||
| d,a | db,ab,ab | depart,new name straight,arrive |
|
||||
| d,a | db,ab | depart,arrive |
|
||||
|
||||
Scenario: Three Way Intersection - Meeting Oneways
|
||||
Given the node map
|
||||
@@ -208,7 +208,7 @@ Feature: Simple Turns
|
||||
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
|
||||
| b,d | ab,ad,ad | depart,turn left,arrive |
|
||||
| b,e | ab,ae,ae | depart,turn slight left,arrive |
|
||||
| b,f | ab,af,af | depart,new name straight,arrive |
|
||||
| b,f | ab,af | depart,arrive |
|
||||
| b,g | ab,ag,ag | depart,turn slight right,arrive |
|
||||
| b,h | ab,ah,ah | depart,turn right,arrive |
|
||||
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
|
||||
@@ -241,7 +241,7 @@ Feature: Simple Turns
|
||||
| b,c | ab,ac,ac | depart,turn sharp left,arrive |
|
||||
| b,d | ab,ad,ad | depart,turn left,arrive |
|
||||
| b,e | ab,ae,ae | depart,turn slight left,arrive |
|
||||
| b,f | ab,af,af | depart,new name straight,arrive |
|
||||
| b,f | ab,af | depart,arrive |
|
||||
| b,g | ab,ag,ag | depart,turn slight right,arrive |
|
||||
| b,h | ab,ah,ah | depart,turn right,arrive |
|
||||
| b,i | ab,ai,ai | depart,turn sharp right,arrive |
|
||||
@@ -278,52 +278,6 @@ Feature: Simple Turns
|
||||
| x | z | xy,yz,yz | depart,turn right,arrive |
|
||||
| z | x | yz,xy,xy | depart,turn left,arrive |
|
||||
|
||||
Scenario: Four Way Intersection Double Through Street Segregated
|
||||
Given the node map
|
||||
"""
|
||||
q p
|
||||
|
||||
|
||||
|
||||
|
||||
b c
|
||||
j i d o
|
||||
a
|
||||
k h e n
|
||||
g f
|
||||
|
||||
|
||||
|
||||
|
||||
l m
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway | oneway | name |
|
||||
| khaij | primary | yes | first |
|
||||
| odaen | primary | yes | first |
|
||||
| qbacp | primary | yes | second |
|
||||
| mfagl | primary | yes | second |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| f,e | second,first,first | depart,turn right,arrive |
|
||||
| f,c | second,second | depart,arrive |
|
||||
| f,i | second,first,first | depart,turn left,arrive |
|
||||
| f,g | second,second,second | depart,continue uturn,arrive |
|
||||
| d,c | first,second,second | depart,turn right,arrive |
|
||||
| d,i | first,first | depart,arrive |
|
||||
| d,g | first,second,second | depart,turn left,arrive |
|
||||
| d,e | first,first,first | depart,continue uturn,arrive |
|
||||
| b,i | second,first,first | depart,turn right,arrive |
|
||||
| b,g | second,second | depart,arrive |
|
||||
| b,e | second,first,first | depart,turn left,arrive |
|
||||
| b,c | second,second,second | depart,continue uturn,arrive |
|
||||
| h,g | first,second,second | depart,turn right,arrive |
|
||||
| h,e | first,first | depart,arrive |
|
||||
| h,c | first,second,second | depart,turn left,arrive |
|
||||
| h,i | first,first,first | depart,continue uturn,arrive |
|
||||
|
||||
Scenario: Three Way Similar Sharp Turns
|
||||
Given the node map
|
||||
"""
|
||||
@@ -789,10 +743,10 @@ Feature: Simple Turns
|
||||
| be | primary | no |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| d,e | db,be,be | depart,new name slight right,arrive |
|
||||
| e,d | be,db,db | depart,new name slight left,arrive |
|
||||
| waypoints | route | turns |
|
||||
| a,c | abc,abc | depart,arrive |
|
||||
| d,e | db,be | depart,arrive |
|
||||
| e,d | be,db | depart,arrive |
|
||||
|
||||
Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 1
|
||||
Given the node map
|
||||
@@ -950,19 +904,19 @@ Feature: Simple Turns
|
||||
| bd | residential | in |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,c | depart,arrive | road,road |
|
||||
| d,a | depart,turn left,arrive | in,road,road |
|
||||
| d,c | depart,new name straight,arrive | in,road,road |
|
||||
| waypoints | turns | route |
|
||||
| a,c | depart,arrive | road,road |
|
||||
| d,a | depart,turn left,arrive | in,road,road |
|
||||
| d,c | depart,arrive | in,road |
|
||||
|
||||
Scenario: Channing Street
|
||||
Given the node map
|
||||
"""
|
||||
g f
|
||||
|
||||
d c b a
|
||||
|
||||
|
||||
| |
|
||||
d---c-b-a
|
||||
| |
|
||||
| |
|
||||
h e
|
||||
"""
|
||||
|
||||
@@ -1076,103 +1030,9 @@ Feature: Simple Turns
|
||||
| ec | Molkenmarkt | secondary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,new name straight,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||
| e,d | depart,new name slight left,arrive | Molkenmarkt,Stralauer Str,Stralauer Str |
|
||||
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Scenario: Collapse Turn Instruction, Issue #2725
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
e
|
||||
|
||||
|
||||
g d
|
||||
|
||||
|
||||
h c
|
||||
|
||||
|
||||
b
|
||||
a
|
||||
|
||||
|
||||
r x s
|
||||
y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Hermannstr | secondary | |
|
||||
| bc | Hermannstr | secondary | yes |
|
||||
| cd | Hermannbruecke | secondary | yes |
|
||||
| de | Hermannstr | secondary | yes |
|
||||
| ef | Hermannstr | secondary | |
|
||||
| eg | Hermannstr | secondary | yes |
|
||||
| gh | Hermannbruecke | secondary | yes |
|
||||
| hb | Hermannstr | secondary | yes |
|
||||
| xa | Hermannstr | secondary | |
|
||||
| yx | Hermannstr | secondary | |
|
||||
| rxs | Silbersteinstr | tertiary | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||
|
||||
Scenario: Collapse Turn Instruction, Issue #2725 - not trivially mergable at e
|
||||
# https://www.mapillary.com/app/?lat=52.466483333333336&lng=13.431908333333332&z=17&focus=photo&pKey=LWXnKqoGqUNLnG0lofiO0Q
|
||||
# http://www.openstreetmap.org/#map=19/52.46750/13.43171
|
||||
Given the node map
|
||||
"""
|
||||
f
|
||||
e
|
||||
g d
|
||||
|
||||
|
||||
h c
|
||||
|
||||
|
||||
b
|
||||
a
|
||||
|
||||
|
||||
r x s
|
||||
y
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | name | highway | oneway |
|
||||
| ab | Hermannstr | secondary | |
|
||||
| bc | Hermannstr | secondary | yes |
|
||||
| cd | Hermannbruecke | secondary | yes |
|
||||
| de | Hermannstr | secondary | yes |
|
||||
| ef | Hermannstr | secondary | |
|
||||
| eg | Hermannstr | secondary | yes |
|
||||
| gh | Hermannbruecke | secondary | yes |
|
||||
| hb | Hermannstr | secondary | yes |
|
||||
| xa | Hermannstr | secondary | |
|
||||
| yx | Hermannstr | secondary | |
|
||||
| rxs | Silbersteinstr | tertiary | |
|
||||
|
||||
And the nodes
|
||||
| node | highway |
|
||||
| x | traffic_signals |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,a | depart,arrive | Hermannstr,Hermannstr |
|
||||
| y,f | depart,arrive | Hermannstr,Hermannstr |
|
||||
| f,y | depart,arrive | Hermannstr,Hermannstr |
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,arrive | Molkenmarkt,Stralauer Str |
|
||||
| e,d | depart,arrive | Molkenmarkt,Stralauer Str |
|
||||
|
||||
# http://www.openstreetmap.org/#map=18/39.28158/-76.62291
|
||||
@3002
|
||||
@@ -1289,19 +1149,19 @@ Feature: Simple Turns
|
||||
| a,c | in,through,through | depart,turn left,arrive |
|
||||
|
||||
# http://www.openstreetmap.org/#map=19/52.51556/13.41832
|
||||
Scenario: No Slight Right over Jannowitzbruecke
|
||||
Scenario: No Slight Right at Stralauer Strasse
|
||||
Given the node map
|
||||
"""
|
||||
l m
|
||||
| |
|
||||
f._ | |
|
||||
' g---h.
|
||||
| | '.
|
||||
| | i
|
||||
| | '-i
|
||||
| |
|
||||
a_ | |
|
||||
''.b---c
|
||||
| |'d._
|
||||
| | 'e
|
||||
| |' d._
|
||||
| | 'e
|
||||
j k
|
||||
"""
|
||||
|
||||
@@ -1315,20 +1175,20 @@ Feature: Simple Turns
|
||||
| kchm | Alexanderstr | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,e | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
|
||||
| waypoints | turns | route |
|
||||
| a,e | depart,arrive | Stralauer Str,Holzmarktstr |
|
||||
|
||||
Scenario: No Slight Right over Jannowitzbruecke -- less extreme
|
||||
Scenario: No Slight Right at Stralauer Strasse -- less extreme
|
||||
Given the node map
|
||||
"""
|
||||
l m
|
||||
| |
|
||||
f_ | |
|
||||
' 'g h_
|
||||
' 'g---h_
|
||||
| | '\_
|
||||
| | i
|
||||
a_ | |
|
||||
'_ b c_
|
||||
'_ b___c_
|
||||
| | \_
|
||||
| | e
|
||||
j k
|
||||
@@ -1344,20 +1204,20 @@ Feature: Simple Turns
|
||||
| kchm | Alexanderstr | primary | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,e | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
|
||||
| waypoints | turns | route |
|
||||
| a,e | depart,arrive | Stralauer Str,Holzmarktstr |
|
||||
|
||||
Scenario: No Slight Right over Jannowitzbruecke
|
||||
Scenario: No Slight Right at Stralauer Strasse
|
||||
Given the node map
|
||||
"""
|
||||
l m
|
||||
| |
|
||||
| |
|
||||
_ _ g h_
|
||||
_ _ g---h_
|
||||
f' | | '_
|
||||
| | i
|
||||
| |
|
||||
_ _b c__
|
||||
_ _b---c__
|
||||
a' | | 'd
|
||||
| |
|
||||
j k
|
||||
@@ -1375,3 +1235,28 @@ Feature: Simple Turns
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
|
||||
|
||||
#http://www.openstreetmap.org/#map=19/49.48761/8.47618
|
||||
@todo @3365
|
||||
Scenario: Turning Road - Segregated
|
||||
Given the node map
|
||||
"""
|
||||
f d
|
||||
| |
|
||||
a - - - b - c
|
||||
| |
|
||||
| |
|
||||
g e
|
||||
"""
|
||||
And the ways
|
||||
| nodes | name | ref | oneway |
|
||||
| ab | Goethe | B 38 | yes |
|
||||
| bc | | B 38 | yes |
|
||||
| ec | Fried | | yes |
|
||||
| cd | Fried | B 38 | yes |
|
||||
| fbg | Fried | | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route | turns |
|
||||
| a,d | Goethe,Fried,Fried | depart,continue left,arrive |
|
||||
| a,g | Goethe,Fried,Fried | depart,turn right,arrive |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user