Compare commits

...

5818 Commits

Author SHA1 Message Date
6ab6564d42
fix arch on normal build
Some checks failed
Build and Publish Docker Image / publish (debian) (release) Failing after 21s
Build and Publish Docker Image / publish (alpine) (release) Failing after 3h14m36s
2025-02-15 14:29:51 -05:00
513966056b
remove 2 32bit unsupported arch
Some checks failed
Build and Publish Docker Image / publish (alpine) (release) Failing after 1h38m5s
Build and Publish Docker Image / publish (debian) (release) Failing after 22s
2025-02-15 12:28:08 -05:00
2c91c0c259
update image name
Some checks failed
Build and Publish Docker Image / publish (alpine) (release) Failing after 1m49s
Build and Publish Docker Image / publish (debian) (release) Failing after 21s
2025-02-15 12:21:44 -05:00
Matt Robinson
c59ad69d6a
Correct Docker FromAsCasing warning (#7064) 2025-02-10 19:22:09 +01:00
Alexander Farber
61464fc2bd
Fix no member named 'construct' in 'optional<type-parameter-0-0 &>' error in sol.hpp with Clang 19 (#7098) 2025-01-25 07:09:37 +00:00
Alexander Farber
6f235cca15
Use libtbb-dev/libtbb12 packages in Dockerfile-debian, sort packages alphabetically in both Dockerfiles (#7095)
* - Use libtbb-dev in builder stage and libtbb12 package in the runstage instead of building oneTBB v2021.12.0 from source code
- Remove wget package from builder stage, because it is not used
- Uppercase "FROM ... as" -> "FROM ... AS" to silence a "docker build" warning
- Sort packages alphabetically and put them on separate lines for easier comparison

* - Fix the warning "FromAsCasing: 'as' and 'FROM' keywords' casing do not match"
- Sort packages alphabetically and put them on separate lines for easier comparison

* Revert  -Wno-stringop-overflow

* Update the link to multi staged builds in the comment

* Update alpine:3.20.0 -> alpine:3.20.5
2025-01-12 16:28:56 +00:00
Siarhei Fedartsou
3614af7f64
Use std::string_view for key type in json::Object (#7062) 2024-11-03 18:23:23 +01:00
Siarhei Fedartsou
48e8382785
Remove unused bearing::get function (#7040)
* Remove unused bearing::get function

* Remove unused bearing::get function

* Remove unused bearing::get function

* Remove unused bearing::get function
2024-10-20 19:46:49 +02:00
Frédéric Rodrigo
becfd8a56d
Add optional support of cargo bike exclusion and width to bicyle profile (#7044) 2024-10-01 15:19:44 +03:00
Siarhei Fedartsou
4f1c62a768
Bump version of protozero to 1.7.1 (#6999) 2024-09-28 20:35:20 +02:00
Siarhei Fedartsou
09a716a9e5
Bump osmium to version 2.20.0 (#6997) 2024-09-28 20:35:05 +02:00
Siarhei Fedartsou
676f6d4704
Use std::popcount instead of __builtin_popcount (#7026) 2024-09-28 20:34:39 +02:00
Siarhei Fedartsou
f636dbfd44
Use std::countl_zero instead of __builtin_clzll (#7025) 2024-09-28 20:34:23 +02:00
Siarhei Fedartsou
5f67e715af
Add std::vector<...>::reserve in ContiguousInternalMemoryDataFacadeBase::GetOverridesThatStartAt (#7024) 2024-09-28 20:33:33 +02:00
Siarhei Fedartsou
203314b1aa
Remove unused middle_nodes_table vector (#7012) 2024-08-03 22:32:37 +02:00
Siarhei Fedartsou
e5e25a1aca
Configure self-hosted runner for benchmarks job (#6975) 2024-07-26 21:19:47 +02:00
Siarhei Fedartsou
84f12c7c6d
Add NodeJs bindings benchmarks (#7004) 2024-07-26 19:36:43 +02:00
Siarhei Fedartsou
7802f86bd6
Measure peak RAM in benchmarks (#6995) 2024-07-25 21:27:37 +02:00
Siarhei Fedartsou
43afec3b39
Move flatbuffers non-generated files back to include/engine/api/flatbuffers/ (#6996) 2024-07-13 13:43:56 +02:00
Dennis Luxen
2da7ca5338
Route pedestrians over highway=platform (#6993) 2024-07-12 20:12:19 +02:00
Dennis Luxen
8ae9abaa63
Fix parsing on feature files on other gherkin parser (#6992) 2024-07-12 17:35:44 +02:00
Siarhei Fedartsou
d3638ace59
Use thread_local instead of boost::thread_specific_ptr (#6991) 2024-07-11 23:53:22 +02:00
Siarhei Fedartsou
c2f877eb9d
Remove unused MapStorage and GenerationArrayStorage (#6990) 2024-07-11 23:10:14 +02:00
Siarhei Fedartsou
825132eec7
Bump flatbuffers to v24.3.25 version (#6968) 2024-07-10 20:44:36 +02:00
Dennis Luxen
7436835244
Remove corech options, redundant tests (#6989)
* Remove corech options, redundant tests

* Small fix
2024-07-10 16:28:07 +02:00
Siarhei Fedartsou
5e6fdda16b
Add NOTE: label to comment in stale.yml (#6987) 2024-07-09 21:27:46 +02:00
Siarhei Fedartsou
f5598efcff
Add .reserve(...) to assembleGeometry function (#6983) 2024-07-09 20:12:47 +02:00
Siarhei Fedartsou
ab771c6142
Do not trigger stale bot on each PR (#6986) 2024-07-09 19:58:03 +02:00
Siarhei Fedartsou
f1510b758d
Increase number of GitHub operations allowed in stale bot (#6985) 2024-07-09 19:32:03 +02:00
Siarhei Fedartsou
4930d2ef05
Use clang 18/17/16 instead of 15/14/13 (#6978) 2024-07-03 20:02:44 +02:00
Siarhei Fedartsou
57b792c768
Get rid of boost::optional leftovers (#6977) 2024-07-02 22:37:09 +02:00
Siarhei Fedartsou
d0ed29adb7
Use Link Time Optimisation whenever possible (#6967) 2024-06-30 21:07:49 +02:00
Siarhei Fedartsou
bdc6ed8a53
Use struct instead of tuple to define UnpackedPath (#6974) 2024-06-29 21:34:43 +02:00
Siarhei Fedartsou
93c0e1dab3
Micro performance optimisation in map matching (#6976) 2024-06-29 19:59:08 +02:00
Siarhei Fedartsou
cacb1b23f9
Fix calculation of best ops/sec in benchmarks (#6973) 2024-06-29 10:31:23 +02:00
Siarhei Fedartsou
0e17869e21
Re-use priority queue in StaticRTree (#6952) 2024-06-25 18:58:48 +02:00
Siarhei Fedartsou
5a48ce85b3
Use tmpfs for running benchmarks (#6966) 2024-06-25 17:49:41 +02:00
Siarhei Fedartsou
7d72dfebf7
Optimise encodePolyline function (#6940) 2024-06-22 20:04:32 +02:00
Siarhei Fedartsou
3d01d96036
Avoid reallocations in base64 encoding (#6951) 2024-06-22 08:50:18 +02:00
Siarhei Fedartsou
e8da3d9231
Calculate confidence interval for benchmark measurements (#6950) 2024-06-21 21:43:27 +02:00
Siarhei Fedartsou
d9ce9cf780
Get rid of unused Boost dependencies (#6960) 2024-06-21 19:04:34 +02:00
Siarhei Fedartsou
3285ce3b2f
Configure stale bot (#6963) 2024-06-21 08:51:56 +02:00
Dennis Luxen
f1eabc3ecc
Replace boost::filesystem with std (#6432) 2024-06-20 21:44:28 +02:00
knowname
c3f2a6cdb9
Add CI job for building Alpine-based Docker image (#6959) 2024-06-20 09:08:57 +02:00
knowname
97f676d5a3
add alpine dockerfile (#6958) 2024-06-19 14:15:23 +02:00
Siarhei Fedartsou
7ffc08be28
Bump versions of TBB, Expat and Lua installed via Conan (#6957) 2024-06-19 07:46:56 +02:00
Siarhei Fedartsou
feb9389436
Apply micro-optimisation for Table & Trip APIs (#6949) 2024-06-15 18:57:26 +02:00
Siarhei Fedartsou
a0eda3e7d7
Apply micro-optimisation for Route API (#6948) 2024-06-15 18:56:40 +02:00
Siarhei Fedartsou
7652f6ca6b
Apply micro-optimisation for Match API (#6945) 2024-06-14 16:04:19 +02:00
Siarhei Fedartsou
aa4e6b1cf3
Apply micro-optimisation for Nearest API (#6944) 2024-06-13 18:18:36 +02:00
Siarhei Fedartsou
de2f392960
Avoid copy of intersection in totalTurnAngle (#6938) 2024-06-10 22:40:37 +02:00
Siarhei Fedartsou
0188d2bccd
Use std::unordered_map::emplace instead of operator[] when producing JSONs (#6936) 2024-06-10 21:29:31 +02:00
Siarhei Fedartsou
054161fc7e
Avoid copy of vectors in MakeRoute function (#6939) 2024-06-10 20:06:43 +02:00
Siarhei Fedartsou
89435aa87f
Add new randomized benchmarks (#6929) 2024-06-09 17:03:24 +02:00
Siarhei Fedartsou
0cbb23abe1
Fix Windows CI: update conan.cmake and disable unit tests as temporary workaround for OOM issues (#6930) 2024-06-09 09:24:02 +02:00
Siarhei Fedartsou
a2915f78c5
Make e2e benchmarks more stable (#6927) 2024-06-08 22:27:12 +02:00
Siarhei Fedartsou
99cb17aed3
Fix bugprone-unused-return-value clang-tidy warning (#6934) 2024-06-08 14:33:24 +02:00
Siarhei Fedartsou
8fd8d0c24a
Fix performance-noexcept-move-constructor clang-tidy warning (#6933) 2024-06-08 08:33:54 +02:00
Siarhei Fedartsou
c57b0d28b0
Fix performance-noexcept-swap clang-tidy warning (#6931) 2024-06-07 16:18:10 +02:00
Siarhei Fedartsou
523ee762f0
Upgrade to clang-tidy 18 (#6919) 2024-06-06 22:20:38 +02:00
Siarhei Fedartsou
feeed75cf1
Add simple benchmarks for osrm-* tools (#6925) 2024-06-06 21:01:34 +02:00
Siarhei Fedartsou
c7ee1a59eb
Implement end to end benchmark (#6910) 2024-06-05 21:39:10 +02:00
Dennis Luxen
2725202771
Use Lemire's fast check whether to escape a JSON string (#6923) 2024-05-31 19:58:57 +02:00
Siarhei Fedartsou
42fafdcdfe
Use custom struct instead of std::pair in QueryHeap (#6921) 2024-05-31 07:06:58 +02:00
Siarhei Fedartsou
c8de759cd6
Use std::string_view::starts_with instead of boost::starts_with (#6918) 2024-05-30 21:55:25 +02:00
Siarhei Fedartsou
fb9d1cefcc
Get rid of boost::math::constants::* and M_PI in favor of std::numbers (#6916) 2024-05-30 19:40:56 +02:00
Dennis Luxen
a9b1bd88d3
Remove all core-CH left-overs (#6920)
* Remove all core-CH left-overs

* Fix formatting

* Update CHANGELOG.md
2024-05-30 17:13:44 +02:00
Siarhei Fedartsou
1ff096ac5c
Make constants in PackedVector constexpr (#6917) 2024-05-30 15:12:42 +02:00
Dennis Luxen
0ea757ed02
Remove unused header file (#6913) 2024-05-29 09:13:13 +02:00
Dennis Luxen
42cbca0ff0
Move Sol2 to canonical path (#6912) 2024-05-28 21:23:51 +02:00
Siarhei Fedartsou
c1ed73126d
Use std::variant instead of mapbox::util::variant (#6903) 2024-05-28 18:52:49 +02:00
Siarhei Fedartsou
01b1673c8a
Fix CCache usage in GitHub Actions (#6911) 2024-05-28 08:43:23 +02:00
Siarhei Fedartsou
d4dc297f75
Add CI job with GCC 14 (#6905) 2024-05-27 09:31:13 +02:00
Siarhei Fedartsou
9aaab7a53f
Enable readability-container-contains clang-tidy check (#6909) 2024-05-27 08:33:26 +02:00
Siarhei Fedartsou
1a6f4c44e7
Fix performance-type-promotion-in-math-fn clang-tidy warning (#6908) 2024-05-27 08:33:05 +02:00
Siarhei Fedartsou
163a2cfe3c
Bump rapidjson version (#6906) 2024-05-27 08:31:59 +02:00
Siarhei Fedartsou
667fd198ac
Use the latest Debian version in Dockerfile (#6904) 2024-05-27 08:30:44 +02:00
Siarhei Fedartsou
b7a990d0b5
Use C++20 (#6877) 2024-05-25 18:25:13 +02:00
Dennis Luxen
8306ed8ae3
Remove superflous iostreams include from header files (#6901) 2024-05-25 09:17:45 +02:00
Dennis Luxen
640df69aa1
Remove dead CRC32 processor code (#6900) 2024-05-24 22:43:03 +02:00
Siarhei Fedartsou
8b48e2ccc6
Bump mapbox/variant to version 1.2.0 (#6898) 2024-05-24 20:39:45 +02:00
Dennis Luxen
babdced52f
Replace GCC-specific attribute with [[nodiscard]] attribute (#6899) 2024-05-24 20:34:04 +02:00
Siarhei Fedartsou
21607e0cb2
Optimise getNetworkDistance in MLD even more (#6884) 2024-05-23 20:46:13 +02:00
Dennis Luxen
24646aada9
Remove outdated warnings (#6894) 2024-05-23 19:39:00 +02:00
Dennis Luxen
51b74a99aa
Avoid copy of std::function-based callback in path unpacking (#6895)
* Avoid copy of std::function-based callback in path unpacking

* Fix formatting

* Update CHANGELOG.md
2024-05-23 18:51:51 +02:00
Dennis Luxen
ed5003b502
Upgrade CI actions to latest versions (#6893)
* Upgrade actions

* Update remaining actions

* Update CHANGELOG.md

* Update CHANGELOG.md
2024-05-23 14:40:47 +02:00
Dennis Luxen
46dc660801
Replace boost::hash by std::hash (#6892)
* Replace boost::hash by std::hash

* Fix formatting

* Update CHANGELOG.md
2024-05-23 14:35:56 +02:00
Siarhei Fedartsou
73fb53cf36
Add benchmark for route (#6890) 2024-05-23 14:27:43 +02:00
Mugr Rex
efe6840d08
Replace boost::optional with std::optional (#6611) 2024-05-22 14:58:07 +02:00
Siarhei Fedartsou
d259848456
Optimise R-tree queries in the case of map matching (#6881) 2024-05-20 12:32:40 +02:00
Siarhei Fedartsou
8a82d3929c
Improve map matching benchmark (#6885) 2024-05-20 11:15:55 +02:00
Siarhei Fedartsou
89fce286a7
Fix benchmark script for the case if PR has empty description (#6887) 2024-05-20 09:16:53 +02:00
Siarhei Fedartsou
11c7ddc84d
Fix failing gcc-13 based CI jobs (#6886)
* Attempt to fix failing CI on gcc-13 jobs

* Attempt to fix failing CI on gcc-13 jobs

* Attempt to fix failing CI on gcc-13 jobs

* Attempt to fix failing CI on gcc-13 jobs

* Attempt to fix failing CI on gcc-13 jobs
2024-05-19 19:30:24 +02:00
Siarhei Fedartsou
54e50a67a8
Add benchmarks comparison job (#6880) 2024-05-14 17:14:59 +02:00
Bart Louwers
c00c157479
Replace dead link with archive.org link (#6882) 2024-05-14 11:49:49 +02:00
Siarhei Fedartsou
ee8e0f890a
Optimise path distance calculation in MLD map matching (#6876) 2024-05-11 16:30:43 +02:00
Dennis Luxen
1e2ffee97c
Update Makefile: fix typo (#6878) 2024-05-11 09:13:17 +02:00
Michael Bell
ffc39b8ad2
Clarify use of forcing routing steps (#6866)
The change clarifies the conditions for forcing routing steps and
simplifies the codebase to support it.

- Makes explicity  the search runtime condition for forcing a routing
step. Namely, the node is a source of the forward and reverse searches,
and it's one of the pre-identified nodes that requires a step to
be forced.
- Consolidate the two lists of force nodes into one. Not only is there
no algorithmic value in separating the nodes by geometric direction,
the  improvements to via-routes with u-turns mean atleast one of these
lists will be empty for any search.
- Rename 'force loop' to 'force step'. This moves the code away
from the original CH-specific language for checking for self-loops
in the case where this condition is met. MLD does not have loops.

Additional cucumber tests are added to cover the logic related to
negative search weights and forcing routing steps on via-route
paths.
2024-05-10 22:00:24 +01:00
Dennis Luxen
70969186f6
Migrate GCC CI jobs to run on GCC 11, 12, and 13 (#6865) 2024-05-10 20:38:32 +02:00
Dennis Luxen
dff76d31d5
Remove dead code branches (#6875) 2024-05-10 20:21:41 +02:00
Siarhei Fedartsou
3254686933
Use M1 runner to build arm64 macOS builds (#6868) 2024-05-08 21:08:11 +02:00
Siarhei Fedartsou
a6dfff725b
Configure GitHub Actions concurrency (#6870) 2024-05-08 10:06:04 +02:00
Dennis Luxen
10237b8761
Update vendored vtzero dependency to v1.1.0 (#6871) 2024-05-07 22:19:48 +02:00
Dennis Luxen
79de092bb2
Upgrade fmt dependency to v10.2.1 (#6869)
* Put fmt into version agnostic subdir

* Add fmt to dependency update script

* Remove manually added fmt

* Squashed 'third_party/fmt/' content from commit e69e5f977

git-subtree-dir: third_party/fmt
git-subtree-split: e69e5f977d458f2650bb346dadf2ad30c5320281
2024-05-07 20:55:55 +02:00
Dennis Luxen
82aa369db3
Remove dead code modernization script (#6863) 2024-05-06 19:09:10 +02:00
Dennis Luxen
0583582772
Remove include that breaks compilation for Boost v1.85.0 (#6856)
* Remove include that breaks compilation for Boost v1.85.0

* Update CHANGELOG.md

* Fix typo

* Fix issues found by newer clang-tidy version

* Add include to boost filesystem to satisfy Windows compiler
2024-05-06 18:52:40 +02:00
Dennis Luxen
99809e105c
Upgrade clang compiler in CI builds (#6861) 2024-05-06 18:12:17 +02:00
Dennis Luxen
6d361ced41
Set Windows build to quiet (#6862)
The normal flag generates 290 megabytes of log output for a regular build. Setting it to quiet will reduce this and still print errors.
2024-05-06 17:31:58 +02:00
Dennis Luxen
790fa901c7
Remove stale AppVeyor files (#6860)
* Drop left-overs from deprecated AppVeyor CI build

* Update CHANGELOG.md
2024-05-06 13:48:24 +02:00
Dennis Luxen
7f9d591ab7
Upgrade clang-format to version 15 (#6859) 2024-05-06 09:14:46 +02:00
Michael Bell
b503e96a98
Remove force-loop checks for routes with u-turns (#6858)
Each leg of a via-route supporting u-turns does not need to consider
force-loops. Negative weight checks are sufficient to prevent
incorrect results when waypoints are on the same edge.
2024-05-05 21:56:01 +01:00
Dennis Luxen
d691af4860
Remove outdated/deprecated CMake policy (#6854) 2024-05-05 22:08:40 +02:00
Dennis Luxen
befd9dc5ae
Merge pull request #6857 from DennisOSRM/upgrade_js_dependencies
Drop support for NodeJS <= v16
2024-05-05 20:29:16 +02:00
Dennis Luxen
4968d7f9d9 Disable codecov.io upload run since it consistently fails 2024-05-05 16:40:21 +02:00
Dennis Luxen
c26f0612d1 Fix typo 2024-05-05 15:24:56 +02:00
Dennis Luxen
de41299eda Update CHANGELOG.md 2024-05-05 15:03:12 +02:00
Dennis Luxen
c37bbfd07a Migrate GitHub actions from {16, 18} to {28, 20} 2024-05-05 15:01:41 +02:00
Dennis Luxen
0fd1fb2904 Update minimum NodeJS dependency to 18 2024-05-05 14:51:56 +02:00
Matthew Wigginton Bhagat-Conway
7ebd21f39e
pass flags into process_segment (#6658)
* pass flags into process_segment

---------

Co-authored-by: Michael Bell <michael@mjjbell.com>
2024-04-06 09:27:42 +01:00
Michael Bell
8ef366e061
Add support for opposite approach request parameter (#6842)
* Added approach on the opposite side of the road.

* Additional test and docs coverage for opposite approach

---------

Co-authored-by: Aleksandrs Saveljevs <Aleksandrs.Saveljevs@gmail.com>
2024-04-03 19:59:15 +01:00
rezashokry
367933fc1a
Fix manuever overrides finding bug (#6739)
* sort manuever overrides vector after partition

---------

Co-authored-by: rshokri <reza.shokri@tapsi.cab>
Co-authored-by: Michael Bell <michael@mjjbell.com>
2024-03-24 21:48:28 +00:00
Damiaan Twelker
c28ba66039
Increment feature id in tile speed layer (#6726)
* actually increment feature id in tile speed layer

---------

Co-authored-by: Michael Bell <michael@mjjbell.com>
2024-03-24 21:23:36 +00:00
Michael Bell
d0e3e2af23
Extract prerelease/build information from package semver (#6839)
* Extract prerelease/build information from package semver

Currently we only extract the major.minor.patch identifiers from
the semver label stored in package.json.

This leads to version information in executables incorrectly
reporting a release version is running on prereleases and special builds.

This commit is a quickfix to extract this information and report it
in version strings.

CMake regex parsing is not sophisticated enough to handle the full semver
regex, so we might need to explore other CMake modules if we want to
strictly parse the label.
2024-03-24 18:33:07 +00:00
martin
8526cc7d45
Replace deprecated std::is_pod (#6717)
* Replace deprecated std::is_pod
2024-03-17 11:49:55 +00:00
Trivikram Kamat
016440fc7e
Remove unused AWS SDK for JavaScript v2 (#6730) 2024-03-17 11:37:51 +00:00
Monday
6e77d53946
Correctly handle compressed traffic signals (#6724)
Unidirectional traffic signal segments are currently not compressed.
This means traffic signals which are not on turns can be missed and
not applied the correct penalty.

This commit changes this behaviour to correctly handle the graph
compression. Additional tests are added to ensure there is no
regression for other cases (turns, restrictions).

Co-authored-by: Michael Bell <michael@mjjbell.com>
2024-03-17 11:32:10 +00:00
Frédéric Rodrigo
99875b4d24
Set Maxspeed for Philippines (#6776) 2024-03-16 11:35:25 +00:00
Michael Bell
c315a586f7
Delete .github/ISSUE_TEMPLATE/question.md (#6827)
With Discussions now enabled, remove the question issue template to encourage Q&A interaction in the more appropriate place.
2024-03-15 09:35:09 +00:00
Daniel Spasojevic
69c38401bc
Update osrm-backend-docker link to point to github hosted repo (#6831) 2024-03-15 10:29:39 +01:00
Michael Bell
e219eb9442
Pin Conan revisions correctly (#6828)
* Pin Conan revisions correctly

Conan dependencies are not pinned correctly. This means we're
pulling in a newer onetbb recipe that no longer has a shared
library option.

Following other examples of how to pin revisions with cmake
for conan v1, we correctly pin the expected revisions.

Longer term we should look into
- upgrading to conan v2
- defining the conan config separately from cmakelists.txt
- understanding the need for disabling onetbb shared library support

but for the purposes of reviving CI, this will be sufficient.

* Fix macos CI builds
2024-03-15 09:27:59 +00:00
Daniel Patterson
31e31a63d0
Fix some compilation issues on modern macOS systems (#6709)
* Fix various compiler warnings generated by Apple clang 15, and workaround some boost 1.8 bugs

* Fix formatting.
2023-10-12 23:04:39 +02:00
danieldegroot2
b437ce5b33
Update debug_way.lua (#6713) 2023-10-12 23:03:35 +02:00
Frédéric Rodrigo
5723eaaa6a
Added motorway speed limits for Bulgaria (original fix by pl71) (#6698) 2023-09-13 22:01:36 +02:00
Frédéric Rodrigo
0f7b86b099
Install data directory (geojson files) like the profiles directory (#6699) 2023-09-13 22:01:06 +02:00
fenwuyaoji
14dcf91812
add keepalive_timeout flag (#6674)
* add keepalive_timeout flag
2023-08-30 19:06:39 +01:00
Lasse Liehu
d234c7246c
Don't route on proposed ways (#6615) 2023-08-20 10:17:30 +01:00
Whytro
3f9347cfb2
Fix operator overload on RouteParameters (#6646)
* Fix operator overload on RouteParameters
2023-08-19 21:48:15 +01:00
Michael Bell
db7946d762
Add support for disabling feature datasets (#6666)
This change adds support for disabling datasets, such that specific
files are not loaded into memory when running OSRM. This enables users
to not pay the memory cost for features they do not intend to use.

Initially, there are two options:
- ROUTE_GEOMETRY, for disabling overview, steps, annotations and waypoints.
- ROUTE_STEPS, for disabling steps only.

Attempts to query features for which the datasets are disabled will
lead to a DisabledDatasetException being returned.
2023-08-04 18:43:37 +01:00
Michael Bell
522d0f066e
Add 'load directly' mode to default Cucumber test suite (#6664)
Currently `npm test` runs the Cucumber suite with a matrix
configuration for selecting the algorithm (CH, MLD) and data loading
(shared-memory, mmap) options.

However, there is a third data loading option, 'load directly',
which is to directly load the datasets into the osrm-routed process memory.

The code paths for each data loading option are distinct:

Storage::Run + SharedMemoryAllocator
MMapMemoryAllocator
ProcessMemoryAllocator

This commit adds direct data loading as part of the Cucumber
configuration matrix.

This will ensure optional dataset support can be added without any
regressions.
2023-08-01 09:24:51 +01:00
Michael Bell
3bb82ce1e2
Minor fixes (#6655)
* Ensure required file check in osrm-routed is correctly enforced.

The storage module had a stricter check. This keeps the IOConfig
check in sync.

* Correct HTTP docs to reflect summary output dependency on steps parameter.

There is no summary parameter.

* npm audit fix
2023-07-18 20:23:23 +01:00
Debarshi Kundu
62e11fd5db
Corrected README with 'echo' command (#6638) 2023-06-13 10:07:15 +02:00
Brad Smith
503d558e90
Fix building on OpenBSD (#6637)
Only utilize librt if its presence is detected.
2023-06-06 07:04:51 +02:00
Lasse Liehu
af59a9cfae
Fix build with GCC 13 (#6632)
Building with GCC 13 failed because for example std::int32_t
was not found. Porting guide [1] suggested to add explicit includes
for <cstdint> if necessary, so did just that.

[1]: https://gcc.gnu.org/gcc-13/porting_to.html
2023-05-31 07:53:04 +02:00
Whytro
72da455185
Allow -1.0 as unlimited for default_radius value (#6599) 2023-05-31 07:52:35 +02:00
Al
0ca913132a
Added block_counter variable to a preprocessor check, minor bug. (#6596) 2023-04-16 23:22:30 +02:00
Nils
134da91fa8
keep libosrm* (#6602) 2023-04-15 16:27:51 +02:00
Whytro
d51631401e
Add support for a default_bearing_radius flag (#6575) 2023-03-24 16:49:33 +01:00
Matthew Wigginton Bhagat-Conway
d6afe91d8f
print tracebacks and line numbers for Lua runtime errors (#6564)
* print tracebacks and line numbers for Lua runtime errors

* revert format changes

* update changelog with lua traceback, #6564

* revert using protected_function for old GetStringListFromFunction and source_function #6564

* add unit test for line numbers in tracebacks, #6564

* apply clang-format (#6564)

* remove unused test helper function, #6564

* suppress leaksanitizer warnings in extract-tests, #6564

When the extractor encounters a lua runtime error, some osmium objects are not freed. In production this doesn't matter because these errors bring down OSRM. In the tests we catch them to ensure they occur, and the leaksanitizer flags them.
2023-03-23 19:18:58 +01:00
Pratik Rajput
192d077ada
Addressing grammatical nits and fixing typo in testing.md (#6550) 2023-03-15 17:16:51 +01:00
Samuel Brucksch
82b73ed9ab
fix oneway handling in get_forward_backward_by_key (#6569) 2023-03-09 17:48:15 +01:00
Jingchen Ye
0e7c3d8ad4
Move TarjanSCC from extractor to util (#6562) 2023-03-09 17:47:28 +01:00
Pratik Rajput
a63ba91c8f
Fix typo in api.md (#6567)
* Fix typo in api.md

Signed-off-by: Pratik <pratikrajput1199@gmail.com>
Co-authored-by: Siarhei Fedartsou <siarhei.fedartsou@gmail.com>
2023-03-09 17:10:42 +01:00
Patrick Fitzgerald
51e04209e3
Fixing discord link (#6536) 2023-02-10 15:28:34 +01:00
Pratik Rajput
56ed2cb196
Fixed typo in profiles.md (#6538) 2023-02-10 15:28:02 +01:00
zephyr
ebd9ab4548
fix(json_render): json_render is not accurate enough for extremely sm… (#6531) 2023-02-02 18:58:25 +01:00
Siarhei Fedartsou
376282d946
Update README.md (#6529) 2023-01-29 09:56:02 +01:00
Pratik Rajput
53295760ac
Fixed typo and grammatical mistakes in developing.md (#6520) 2023-01-28 00:22:29 +01:00
Jeremiah
e590dae5f6
Fix boost header deprecation warning (#6515) 2023-01-21 08:47:05 +01:00
Samuel Brucksch
d9df33dd0a
fix typo (#6491) 2023-01-11 00:46:42 +01:00
Dennis Luxen
95c4523987
Merge pull request #6480 from Project-OSRM/nested_namespace
Nested namespace
2022-12-21 18:27:13 +01:00
Dennis Luxen
26987f9049 Fix conditionally built tool 2022-12-21 15:52:09 +01:00
Dennis Luxen
7c06726a35 Fix formatting 2022-12-20 18:00:11 +01:00
Dennis Luxen
d7c44f0bc0 Merge remote-tracking branch 'origin/master' into nested_namespace 2022-12-11 10:25:13 +01:00
Dennis Luxen
a4aa153ba4 Use nested namespace
It's a mechanical change to modernize the code base
2022-12-11 10:17:17 +01:00
Dennis Luxen
1204b746d5
Merge pull request #6477 from Project-OSRM/update_cmakelists
Update CMakeLists
2022-12-11 10:15:41 +01:00
Dennis Luxen
076cbd7018
Merge pull request #6479 from Project-OSRM/dl_fix_cmake_warning
Fix CMake warning
2022-12-11 10:15:33 +01:00
Dennis Luxen
afd340da44
Merge pull request #6478 from Project-OSRM/dluxen_less_dependencies
Less dependencies by inner sourcing cheap-ruler
2022-12-11 10:15:14 +01:00
Dennis Luxen
898cbe8da4 Install PkgConfig on Docker build image 2022-12-10 21:50:24 +01:00
Dennis Luxen
16c6f23791 Fix CMake warning
CMake Warning (dev) at /usr/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (Lua).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/FindLua.cmake:39 (include)
  CMakeLists.txt:571 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
2022-12-10 20:50:32 +01:00
Dennis Luxen
612ca82a06 Fix formatting 2022-12-10 20:01:16 +01:00
Dennis Luxen
1215062e4c Port the used bits from CheapRuler, drop dependencies 2022-12-10 19:54:51 +01:00
Dennis Luxen
5292172770 One more place where version is listed 2022-12-10 18:58:25 +01:00
Dennis Luxen
6e5f0d74bd Use cmake 3.18 instead of 3.20 because of debian support 2022-12-10 18:50:37 +01:00
Dennis Luxen
5bab68c737 Update CMakeLists
- remove GOLD linker special case handling
- bump minimum cmake version to 3.20
- simplify LTO detection
- remove outdated way to check for compiler flags
- remove outdated compiler version gates (rely on CXX version)
- remove outdated Apple platform handling
- disable compiler-specific CXX extensions
- require boost 1.70 in all builds
- remove unused variable
2022-12-10 18:25:58 +01:00
Dennis Luxen
152a52bc1a
Merge pull request #6444 from Project-OSRM/dl_using_keyword
[CPP17] Modernize: Replace typedef with using statements
2022-12-10 18:14:43 +01:00
Dennis Luxen
c605b1db38 Fix typo 2022-12-10 16:28:03 +01:00
Dennis Luxen
f4189d9487 Fix formatting 2022-12-10 16:08:22 +01:00
Dennis Luxen
f983d626ac Merge remote-tracking branch 'origin/master' into dl_using_keyword 2022-12-10 16:02:53 +01:00
Siarhei Fedartsou
73b2a86a95
Move vector in CSVFilesParser instead copying it (#6470) 2022-12-03 17:53:56 +01:00
Siarhei Fedartsou
2044398dfd
Add CI job which builds OSRM with gcc 12 (#6455) 2022-11-28 16:29:43 +01:00
Siarhei Fedartsou
095b726a92
Use <boost/iterator/function_output_iterator.hpp> instead of deprecated <boost/function_output_iterator.hpp> (#6458) 2022-11-16 21:09:54 +01:00
Siarhei Fedartsou
18dcd27a9b
Use node-api instead of NAN (#6452) 2022-11-16 15:44:36 +01:00
Frédéric Rodrigo
a1b3efe260
Remove at:urban maxspeed, partial revert of 2bbb347f57 (#6450) 2022-11-11 21:52:54 +01:00
Siarhei Fedartsou
6d10523440
Upgrade to clang-tidy 15 (#6439) 2022-11-06 22:45:35 +01:00
Frédéric Rodrigo
2bbb347f57
Car profile, add new specific country speed limit at:urban, ca-on:rural and es:trunk (#6443) 2022-11-06 21:27:03 +01:00
Siarhei Fedartsou
5f82d0c9ba
Get rid of unused functions in util/json_util.hpp (#6446) 2022-11-06 21:13:04 +01:00
Dennis Luxen
aeaf5e0735
Merge pull request #6433 from Project-OSRM/replace_boost_stringref
Replace boost::string_ref with std::string_view
2022-11-06 15:54:18 +01:00
Siarhei Fedartsou
8a186e6f49
Remove C++14 references from README and package.json (#6438) 2022-11-06 15:20:47 +01:00
Dennis Luxen
2ea168c26c
Merge pull request #6445 from Project-OSRM/dl_drop_gcc7
Drop GCC7 support
2022-11-06 15:08:14 +01:00
Dennis Luxen
a12625afac Drop GCC7 support 2022-11-06 13:33:10 +01:00
Dennis Luxen
8bff55cd85 [CPP17] Modernize: Replace typedef with using statements 2022-11-06 13:21:45 +01:00
Dennis Luxen
bb4fd93fab Fix formatting 2022-11-06 12:26:37 +01:00
Dennis Luxen
b13820f520 Use std::back_inserter 2022-11-06 12:19:32 +01:00
Dennis Luxen
fc12b6c365
Merge pull request #6441 from Project-OSRM/python2_deprecation 2022-11-06 08:21:16 +01:00
Dennis Luxen
cb515ba42f Merge remote-tracking branch 'origin/master' into replace_boost_stringref 2022-11-05 17:31:06 +01:00
Dennis Luxen
634e7fe392 Merge remote-tracking branch 'origin/master' into python2_deprecation 2022-11-05 17:29:57 +01:00
Siarhei Fedartsou
6ab8728807
Apply workaround for Conan installation issue on CI (#6442) 2022-11-05 16:56:16 +01:00
Siarhei Fedartsou
0ae5190937
Fix npm audit warnings in NPM package (#6437) 2022-11-04 12:19:39 +01:00
Dennis Luxen
a1c1fefd6e Fix formatting, pass by value 2022-11-04 11:49:54 +01:00
Dennis Luxen
6fa7bd8abd Upgrade check_tackinfo.py to Python3 2022-11-04 11:47:40 +01:00
Dennis Luxen
7359d6a21b Merge remote-tracking branch 'origin/master' into replace_boost_stringref 2022-11-04 11:43:41 +01:00
Dennis Luxen
5dda33fa88 More efficient toLower implementation 2022-11-04 11:42:37 +01:00
Dennis Luxen
5280ca4e16 Pass string_view by value 2022-11-04 11:41:02 +01:00
Dennis Luxen
2c02d4e5ab Update CHANGELOG.md 2022-11-01 12:10:48 +01:00
Siarhei Fedartsou
54d486ae12
Drop support of Node 12 & 14 (#6431) 2022-11-01 08:23:08 +01:00
Siarhei Fedartsou
afe34456b9
Delete CloudFormation templates (#6435)
There is no need in them - it seems they were needed to manage some Mapbox S3 bucket which we have no access to anyway.
2022-10-31 13:22:13 +01:00
Dennis Luxen
2f75d6f22b
Merge pull request #6429 from Project-OSRM/less_boost_unordered
Replace boost::unordered_{map/set} with std, also remove code duplication
2022-10-30 22:17:48 +01:00
Dennis Luxen
85e6a854aa Fix missing includes (on Windows) 2022-10-30 22:08:29 +01:00
Dennis Luxen
12f49d6f24 Stray whitespace 2022-10-30 20:11:36 +01:00
Dennis Luxen
7149547645 Fix formatting 2022-10-30 20:10:09 +01:00
Dennis Luxen
565959b389 Remove util/string_view header 2022-10-30 20:01:46 +01:00
Dennis Luxen
5c9d0d152c Remove usage of StringView typedef 2022-10-30 19:53:26 +01:00
Dennis Luxen
274dcc58a5 Remove superflous std::hash specialization 2022-10-30 19:21:06 +01:00
Dennis Luxen
d06b23d819 More fixes 2022-10-30 14:08:17 +01:00
Dennis Luxen
91e9623b31 Fix formatting 2022-10-30 14:06:19 +01:00
Dennis Luxen
0021ccef59 Replace boost::string_ref with std::string_view 2022-10-30 13:59:59 +01:00
Dennis Luxen
061f0a1f14 Fix includes 2022-10-30 11:43:28 +01:00
Dennis Luxen
60e283312c
Fix typo historgram -> histogram (#6427) 2022-10-30 08:34:00 +01:00
Dennis Luxen
f97e18d285 Fix formatting 2022-10-29 23:01:38 +02:00
Dennis Luxen
7b73b977ff Replace boost::unordered_{map/set} with std, also remove code duplication 2022-10-29 22:57:14 +02:00
Michael Bell
5d468f2897
Make edge metrics strongly typed (#6421)
This change takes the existing typedefs for weight, duration and
distance, and makes them proper types, using the existing Alias
functionality.

Primarily this is to prevent bugs where the metrics are switched,
but it also adds additional documentation. For example, it now
makes it clear (despite the naming of variables) that most of the
trip algorithm is running on the duration metric.

I've not made any changes to the casts performed between metrics
and numeric types, they now just more explicit.
2022-10-28 15:16:12 +01:00
Siarhei Fedartsou
16685d0de9
Add link to Discord server (#6422) 2022-10-26 11:22:28 +02:00
Siarhei Fedartsou
82897791d1
Update actions/cache to v3 (#6420) 2022-10-24 00:52:15 +02:00
Michael Bell
9ad432c5b2
Fix adding traffic signal penalties during compression (#6419)
Weight and duration penalties are flipped in the lambda function
that applies penalties from traffic signals.

Duration is in deciseconds, whilst weight is multipled by
10^weight_precision, with weight_precision being 1 by default.

Therefore, for default routability profile, the penalties end up
being the same, hence why no tests picked this up.

If distance weight is used however, it will incorrectly apply an
additional penalty to the weight, and not add the traffic signal
delay to the duration in the routing graph.

To confuse things further, in some API responses the values are
correct because they use geometry data instead, but it's still
possible that a sub-optimal route was selected.

However, given the distance weight is in meters, and the additional
penalty per traffic light would be 20, it's unlikely this would
have changed the routing results.

In any case, we correct the function to apply the arguments correctly.
2022-10-23 14:59:12 +01:00
Siarhei Fedartsou
c1d2c15995
Handle snapping parameter for all plugins in NodeJs bindings, but not for Route only (#6417) 2022-10-22 16:49:35 +02:00
Siarhei Fedartsou
fb1bb7a15b
Fix annotations=true handling in NodeJS bindings & libosrm (#6415) 2022-10-19 08:35:18 +02:00
Siarhei Fedartsou
d65e8c7d1e
Fix bindings compilation on latest Node (#6416) 2022-10-18 21:59:39 +02:00
Michael Bell
5e5f1f4add
5.27.1 release (#6409)
* Bookkeeping for 5.27.1 release

* Reset for next release
2022-10-14 23:04:41 +01:00
Siarhei Fedartsou
9d160a9b5d
Revert back to using custom HTTP parser instead of Boost.Beast (#6407) 2022-10-14 14:37:33 +02:00
Siarhei Fedartsou
d143de597d
Fix bug with large HTTP requests leading to Bad Request in osrm-routed. (#6403) 2022-10-13 16:53:49 +02:00
Siarhei Fedartsou
4026ed54c0
Add support for surface=metal,grass_paver,woodchips in bicyle profile (#6395) 2022-10-11 11:09:56 +02:00
Daniel J. H
895e4bf6d5
Adds cucumber scenario for u turn restrictions at intersection (#4484) 2022-10-10 22:27:27 +02:00
Michael Bell
cb90d587be
Release 5.27 (#6392)
* Bookkeeping for 5.27.0 release.

* Prep rc.1

* Final 5.27 release tag

* Reset for next release
2022-10-10 17:54:01 +01:00
Michael Bell
284e110f2e
Actually match the tag naming conventions (#6393)
Wasn't matching on release candidates, nor any of the previous special tags convention.
2022-10-06 22:08:36 +01:00
Michael Bell
ac1edc7675
Prepare scoped Node package (#6386)
In case we're not able to get access to the unscoped credentials.
Scoped packages are also the recommended approach for projects
managed by a team of developers.
2022-10-06 21:05:51 +01:00
Siarhei Fedartsou
7be9039f53
Get rid of Mason (#6387) 2022-10-06 14:13:12 +02:00
Siarhei Fedartsou
52b516e943
Use clang-format from CI base image (#6391) 2022-10-06 12:50:31 +02:00
Nils
f3c03307cb
Add conanbuildinfo.json (#6388) 2022-10-04 18:08:41 +02:00
Siarhei Fedartsou
9a4b4648f4
Improve performance of JSON rendering (#6380) 2022-10-03 21:43:51 +02:00
Michael Bell
41fd947ebd
Update docs to reflect recent build and dependency changes (#6383) 2022-10-02 19:55:59 +01:00
Michael Bell
e328031661
Add issue templates for bug reporting, features, and questions. (#6385)
Primarily to educate bug reporters that demo site != default settings,
but also to help organise and auto-assign new issues.
2022-10-02 17:45:35 +01:00
Michael Bell
b7daa7e641
Gracefully handle no-turn intersections in guidance processing. (#6382)
Badly constructed OSM intersections can create OSRM intersection
views that have no valid turns.
The guidance code for segregated intersections tries to look
ahead to the second intersection to ensure lanes are  announced
intuitively.
Currently, OSRM assumes there are always turns at the second
intersection that we should consider. This commit corrects
this assumption so that it can now handle badly constructed
OSM intersections with no turns.
2022-10-01 14:35:08 +01:00
Siarhei Fedartsou
21888334dd
Do not generate intermediate .osrm file in osrm-extract. (#6354) 2022-09-30 14:29:10 +02:00
Siarhei Fedartsou
395cc6e9df
Add timestamps for logs (#6375) 2022-09-30 14:28:52 +02:00
Siarhei Fedartsou
902bfc7806
Refactor CMake code related to compiler warnings, enable some additional warnings (#6355) 2022-09-30 11:42:36 +02:00
Siarhei Fedartsou
3c5d99b4cb
Improve performance of map matching via getPathDistance optimization (#6378) 2022-09-29 22:27:19 +02:00
Michael Bell
ef8f3d7508
Ensure u-turn exists in intersection view (#6376)
Due to some rather complex logic that tries to calculate intersection
angles by looking further up the road, it's possible to return
an intersection view that is missing a u-turn - something which
is assumed to exist in later guidance calculations.

We apply a fix here by ensuring the u-turn is always included in
the returned view.
2022-09-27 13:49:12 +01:00
Louis
660cea8fcc
Bicycle surface speeds (#6212) 2022-09-23 17:54:55 +02:00
Siarhei Fedartsou
be353630d5
Fix a couple of warnings found by PVS Studio (#6372) 2022-09-22 23:28:12 +02:00
Siarhei Fedartsou
9b834810d5
Build Node bindings on Windows (#6334)
Extends CI to build NodeJS bindings for Windows.
2022-09-20 20:43:13 +01:00
Siarhei Fedartsou
1c65ea2194
Configure cross-compilation for Apple Silicon (#6360)
Adds support for Apple Silicon binaries for NodeJS bindings.
2022-09-17 13:00:53 +01:00
Siarhei Fedartsou
96f5780f06
Update CI to use clang-tidy 14 (#6353) 2022-08-31 23:39:47 +02:00
Siarhei Fedartsou
c003ac1055
Pin revisions of Conan dependencies (#6351) 2022-08-31 09:59:53 +02:00
Siarhei Fedartsou
9a638f3568
Optimize RestrictionParser performance (#6344) 2022-08-30 21:08:52 +02:00
Siarhei Fedartsou
2cf957148b
Support floats for speed value in traffic updates CSV (#6327) 2022-08-30 15:34:46 +02:00
Michael Bell
b17cbb4c47
Support OSM traffic signal directions (#6153)
Currently OSRM parses traffic signal nodes without consideration
for the direction in which the signal applies. This can lead
to duplicated routing penalties, especially when a forward and backward
signal are in close proximity on a way.

This commit adds support for directed signals to the extraction and
graph creation. Signal penalties are only applied in the direction
specified by the OSM tag.

We add the assignment of traffic directions to the lua scripts,
maintaining backwards compatibility with the existing boolean
traffic states.

As part of the changes to the internal structures used for tracking
traffic signals during extraction, we stop serialising/deserialising
signals to the `.osrm` file. The traffic signals are only used by
`osrm-extract` so whilst this is a data format change, it will not
break any existing user processes.
2022-08-30 10:36:49 +01:00
Siarhei Fedartsou
d8b358e810
Use apt-get to install Clang on CI (#6345) 2022-08-30 10:25:53 +02:00
Siarhei Fedartsou
b4142cf1a2
Add Flatbuffers support to NodeJS bindings (#6338) 2022-08-29 22:01:26 +02:00
Siarhei Fedartsou
06719be2b1
Use Lua 5.4 in Docker image (#6346) 2022-08-29 00:03:03 +02:00
Siarhei Fedartsou
18e5faa113
Remove Appveyor status from README.md (#6347) 2022-08-28 23:59:09 +02:00
Siarhei Fedartsou
a46241e45c
Add Node docs for exclude and skip_waypoints options (#6342) 2022-08-28 21:56:09 +02:00
Michael Bell
bfb74c2dad
Fix snapping target locations to ways used in turn restrictions (#6339)
Currently there is an edge-case in the turn restriction implementation,
such that routes can not be found if the target input location snaps
to a way used in a (multi) via restriction.

With the addition of snapping input locations to multiple ways, we
can now also snap to the "duplicate" edges created for the restriction graph,
thereby fixing the problem.
This is achieved by adding the duplicate restriction edges to the
geospatial search RTree.

This does open up the possibility of multiple paths representing exactly
the same route - one using the original edge as a source, the other
using the duplicate restriction graph edge as source. This is fine,
as both edges are represented by the same geometry, so will generate
the same result.
2022-08-27 15:59:44 +01:00
|so
3d5db4511c
Update http.md (#6150)
Fix the typos and some basic grammar mistakes

Co-authored-by: Siarhei Fedartsou <siarhei.fedartsou@gmail.com>
2022-08-27 15:59:02 +01:00
Michael Bell
d74e7b66bd
Support snapping to multiple ways at an input location (#5953)
This PR improves routing results by adding support for snapping to
multiple ways at input locations.

This means all edges at the snapped location can act as source/target
candidates for routing search, ensuring we always find the best route,
and not the one dependent on the edge selected.
2022-08-27 11:36:20 +01:00
Siarhei Fedartsou
bb18a2b428
Fix TBB in case of Conan + NodeJS build (#6333) 2022-08-26 17:09:52 +02:00
Michael Bell
c204360aa0
Fix HTTP compression precedence (#6331)
There is a bug in the deflate compression. Therefore, we do not want
to select this in the default choice for HTTP response compression.
Instead we revert back to the previous precedence, selecting gzip as
the priority.
2022-08-25 17:49:35 +01:00
Siarhei Fedartsou
df3c553f4f
Remove redundant nullptr check. (#6326) 2022-08-25 00:01:56 +02:00
Siarhei Fedartsou
91895604c9
Migrate to modern TBB version (#6300) 2022-08-24 18:13:49 +02:00
Michael Bell
a98074a051
Improvements to maneuver override processing (#6215)
This change unblocks the osrm-extract debug build, which is
currently failing on a maneuver override assertion.

The processing of maneuver overrides currently has three issues
- It assumes the via node(s) can't be compressed (the failing assertion)
- It can't handle via-paths containing incompressible nodes
- It doesn't interop with turn restriction on the same path

Turn restrictions and maneuver overrides both use the same
from-via-to path representation.
Therefore, we can fix these issues by consolidating their
structures and reusing the path representation for
turn restrictions, which already is robust to the above
issues.

This also simplifies some of the codebase by removing maneuver
override specific path processing.

There are ~100 maneuver overrides in the OSM database, so the
impact on processing and routing will be minimal.
2022-08-24 16:19:24 +01:00
Siarhei Fedartsou
8e74b7af9d
Enable performance-move-const-arg clang-tidy check (#6319) 2022-08-23 19:03:41 +02:00
Michael Bell
869b3fae82
Bump CI complete job to ubuntu-22.04 (#6323)
18.04 is being deprecated.
2022-08-22 20:55:28 +01:00
Maciej Bukczynski
32fb8607e4
Add node_osrm support for skip_waypoints parameter (#6060) 2022-08-22 21:47:47 +02:00
Lev Dragunov
928867c520
Add data_version field to responses of all plugins. (#5387) 2022-08-22 21:07:32 +02:00
Michael Bell
972a848094
Lazily generate optional route path data (#6045)
Currently route results are annotated with additional path information,
such as geometries, turn-by-turn steps and other metadata.

These annotations are generated if they are not requested or returned
in the response.
Datasets needed to generate these annotations are loaded and available
to the OSRM process even when unused.

This commit is a first step towards making the loading of these datasets
optional. We refactor the code so that route annotations are only
generated if explicitly requested and needed in the response.

Specifically, we change the following annotations to be lazily generated:
- Turn-by-turn steps
- Route Overview geometry
- Route segment metadata

For example. a /route/v1 request with
steps=false&overview=false&annotations=false
would no longer call the following data facade methods:
- GetOSMNodeIDOfNode
- GetTurnInstructionForEdgeID
- GetNameIndex
- GetNameForID
- GetRefForID
- GetTurnInstructionForEdgeID
- GetClassData
- IsLeftHandDriving
- GetTravelMode
- IsSegregated
- PreTurnBearing
- PostTurnBearing
- HasLaneData
- GetLaneData
- GetEntryClass

Requests that include segment metadata and/or overview geometry
but not turn-by-turn instructions will also benefit from this,
although there is some interdependency with the step instructions
- a call to GetTurnInstructionForEdgeID is still required.
Requests for OSM annotations will understandably still need to
call GetOSMNodeIDOfNode.

Making these changes unlocks the optional loading of data contained in
the following OSRM files:
- osrm.names
- osrm.icd
- osrm.nbg_nodes (partial)
- osrm.ebg_nodes (partial)
- osrm.edges
2022-08-22 12:59:20 +01:00
Michael Bell
3cfd0e8334
Complete support for no_entry and no_exit turn restrictions (#5988)
The internal representation of turn restrictions expects only one
`from` way and only one `to` way.

`no_entry` and `no_exit` turn restrictions can have multiple `from` and
`to` ways respectively. This means they are not fully supported by
OSRM's restriction parser.

We complete support for these turn restriction types by parsing all
ways and converting a valid restriction with multiple `from`/`to` members
into multiple internal restrictions.
2022-08-22 12:58:16 +01:00
Michael Bell
b4b1aea567
Add support for non-round-trips with a single fixed endpoint (#6050)
Currently /trip supports finding round-trip routes where only the
start or end location is fixed. This PR extends this feature to
non-round-trip requests.

We do this by a new table manipulation that simulates non-round-trip
fixed endpoint requests as a round-trip request.
2022-08-22 12:56:47 +01:00
Rafael Guglielmetti
e3c7995b00
Add missing files in exception message (#5360) 2022-08-22 08:32:25 +02:00
Michael Bell
7f014bd616 Clarify identifier types used in data facade
The data facade interface contains numerous methods for looking up
datapoints by identifiers.
Many of the parameters use the NodeID or EdgeID types. However, these two
identifier types are used for representing three different contexts:

1. Node-based graph edges and nodes
2. Edge-based graph edges and nodes
3. Packed geometries

Consider the use of identifier parameters in these examples:

---

GetWeightPenaltyForEdgeID(const EdgeID id)  <- edge-based edge

GetUncompressedForwardWeights(const EdgeID id) <- packed geometry

IsLeftHandDriving(const NodeID id) <- edge-based node

GetBearingClass(const NodeID node) <- node-based node

---

This mixing of contexts within the same interface makes it
difficult to understand the relationships and dependencies between
the OSRM datasets.

For 1. and 2. we continue to use the NodeID and EdgeID types, but
change the interface parameter names to identify them as
edge-based or node-based graph properties.

For 3. we define a new type definition, PackedGeometryID.

These changes are to aid with readability. A next step would be
to strongly type these definitions, leveraging the Alias template
already used for OSM identifiers.
2022-08-21 21:37:39 +02:00
Siarhei Fedartsou
e872f1d6c3
Do not use deprecated Callback::Call overload in Node bindings (#6318) 2022-08-20 17:27:14 +01:00
Siarhei Fedartsou
47e5591ed8
Use the latest node on CI (#6317) 2022-08-20 17:16:05 +01:00
Joonas Paalasmaa
9d4dd2595e
Remove references to project-osrm.wolt.com (#6314)
At Wolt, we are cleaning up subdomains under wolt.com, and project-osrm.wolt.com will go offline soon.
2022-08-20 17:14:38 +01:00
Siarhei Fedartsou
aadc088084
Fix distance calculation consistency. (#6315)
Consolidate great circle distance calculations to use cheap ruler library.
2022-08-19 22:31:40 +01:00
Siarhei Fedartsou
8f0cd5cf7b
Migrate Windows CI to GitHub Actions. (#6312)
It is quite difficult to maintain current Windows CI, because it uses pre-compiled dependencies stored on wolt.com server and there is low chance to find someone who is able to update it.
2022-08-19 18:49:09 +01:00
Siarhei Fedartsou
624fea6d33
Add smoke test for Docker image (#6313)
* Add smoke test for Docker image
2022-08-19 11:32:55 +01:00
Siarhei Fedartsou
9688e48ad1
Update libosmium to 2.18.0. Fix problem with Docker image build. (#6303) 2022-08-16 18:26:21 +01:00
Siarhei Fedartsou
51a8486375
Fix performance issues after migration to sol2 3.3.0 (#6304)
* Fix performance issues after migration to sol2 3.3.0
2022-08-15 23:10:56 +01:00
Siarhei Fedartsou
440c00064e
Remove EXACT from find_package if using Conan (#6299)
* Remove EXACT from find_package if using Conan
2022-08-15 21:21:01 +01:00
Patrick Niklaus
e5450e8c68
Remove highway=bicycle safety bonus (#6296)
* Remove highway=bicycle safety bonus

This removes a bonus for a road class that doesn't exist (cycleway would
be correct), but the code was buggy since safety_bonus is nil and caused
an arithmetic exception. We only caught this 4 (!) years later since
recently a way was tagged with highway=bicycle and made it in our OSM
data leading to preprocessing failures.
2022-08-15 21:14:37 +01:00
Siarhei Fedartsou
f19247a7ca
Pass osm_node_ids by reference in osrm::updater::Updater class (#6298) 2022-08-15 21:12:58 +01:00
Siarhei Fedartsou
e7185b4bcb
Use Boost.Beast to parse HTTP request (#6294) 2022-08-02 21:12:05 +01:00
Siarhei Fedartsou
00816722dd
Configure Undefined Behaviour Sanitizer (#6290) 2022-08-01 22:40:26 +01:00
Siarhei Fedartsou
589becbfec
Use Conan instead of Mason to install code dependencies (#6284)
* Use Conan instead of Mason to install code dependencies
2022-08-01 21:21:20 +01:00
Siarhei Fedartsou
4e8ee288d9
Migrate to C++17. Update sol2 to 3.3.0. (#6279)
* Migrate to C++17. Update sol2 to 3.3.0.
2022-07-31 00:56:17 +01:00
Siarhei Fedartsou
204fdaff6e
Fix bug with reading Set values from Lua scripts. (#6285)
* Fix bug with reading Set values from Lua scripts.

* Add test for foot profile named-road suffixes

Co-authored-by: Michael Bell <michael@mjjbell.com>
2022-07-30 23:14:06 +01:00
Siarhei Fedartsou
1a3d0f7c20
Update macOS CI image to macos-11 (#6286)
* Update macOS CI image to macos-11
2022-07-30 13:40:21 +01:00
Siarhei Fedartsou
06b1b980bb
Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
Siarhei Fedartsou
19d2ec56b8
Configure CMake to not build flatbuffers tests and samples (#6274)
* Do not build flatbuffers tests and samples
2022-07-03 23:59:54 +01:00
Siarhei Fedartsou
3d2db20777
Enable more clang-tidy checks. (#6270)
* Enable more clang-tidy checks
2022-06-30 14:32:12 +01:00
Siarhei Fedartsou
59953172e8
Configure clang-tidy job on CI (#6261) 2022-06-28 00:14:28 +01:00
John Doe
79d4363d59
Enable arm docker build (#6172)
This issue enables dockerX for multi-arch docker image building. 
Resulting images can be run on x86 and arm processors (for example aws graviton).
2022-03-08 20:02:11 +00:00
John Doe
662a8d0a12
Split build command into two layers (#6175)
* Split build command into two layers

Co-authored-by: nurikk <ainur@yojee.com>
2022-02-16 21:18:28 +00:00
Yuriy Chernyshov
f2e284623e
Do not depend on ADL 2022-01-10 11:28:43 +00:00
Nikolay Mikov
c0b79a8d0e Remove set(CMAKE_OSX_ARCHITECTURES "x86_64") on MacOS 2022-01-09 22:01:34 +00:00
Michael Bell
1e70b645e4 Fix generation of NodeJS API documentation
NodeJS API docs are out of sync with NodeJS C++ wrapper documentation
due to the doc build breaking back in #4043.

The commit fixes the Node dev dependencies such that `npm run docs`
works again and re-enables the check in CI.
2021-12-23 11:10:39 +00:00
Michael Bell
04c2167c2d Fix for_each_indexed util function
- Fix typo in util function name for_each_indexed.
- Use the overloaded functions for_each_indexed and for_each_pair
  with a container argument where possible to improve readability.
2021-12-22 23:40:06 +00:00
Michael Bell
2c81083406 Fix CI 32-bit build
A recent change to the Ubuntu Focal CI worker - either a CMake upgrade,
or default installation of the libexpat-dev library - leads to the
32-bit expat library to not be found by CMake.

FindPackage(EXPAT) finds the library via pkg-config, so the fix is
to explicitly include the i386 pkg-config directory in the
PKG_CONFIG_PATH environment variable list.
2021-12-22 23:25:19 +00:00
Michael Bell
472cce6742 Fix Mason CMake installation
During the CI migration to Github Actions, a bug was introduced
such that Mason CMake is not being added to the PATH environment
variable correctly, so it defaults to the CMake installed in the
OS environment.

Simple fixing the typo fails as the Mason CMake version requires
libssl 1.0 as a dependency, whilst the Ubuntu Focal runners are
on the newer libssl 1.1. Therefore, we also bump the Mason
CMake version to 3.21.2.
2021-12-22 23:25:19 +00:00
Denis Chapligin
ff1af413d6
Merge pull request #6156 from mloskot/ml/fix-msvc-19-28-static-const-member
Fix MSVC 19.28+ issue with ByEdgeOrByMeterValue::by_edge and ByEdgeOrByMeterValue::by_meter definitions
2021-11-13 23:29:08 +02:00
Mateusz Łoskot
ffa4256ad3
Run clang-format to fix formatting 2021-11-12 19:06:33 +01:00
Mateusz Łoskot
3da45c1d92
Fix MSVC 19.28+ issue with ByEdgeOrByMeterValue::by_edge and ByEdgeOrByMeterValue::by_meter definitions
This is a workaround for discrepancy between MSVC 19.27 and 19.28
about static const member definition
https://developercommunity2.visualstudio.com/t/discrepancy-between-msvc-1927-vs-1928-about-static/1255338

We can not use C++17 inline variable as a workaround suggested
in the issue report linked above, because the sol2 does not
seem to compile in C++17 mode:

    third_party/sol2/sol2/sol.hpp: error C2039: 'object_type': is not a member of...
2021-11-12 17:37:19 +01:00
Daniel Patterson
d5cd702242
Enable all unit tests (#5248)
* Add missing profile name to library extract test.

* Support both tzid and TZID properties on timezone geometry.  Improve validation of timezone polygons.

* Missing tzid property wasn't a geojson validation issue, shouldn't have been tested there.

* Use filesystem glob to loop over all test executables so we don't miss any in the future.

Co-authored-by: Michael Bell <michael@mjjbell.com>
2021-10-22 22:10:25 +01:00
Torben Hørup
b120c971a0
Make osrm-routed optional (#6144)
* Make osrm-routed optional

* Updated changelog

* require boost 1.60

* Update CMakeLists.txt

* Update CHANGELOG.md

Co-authored-by: Michael Bell <michael@mjjbell.com>
2021-10-08 17:06:55 +01:00
Michael Bell
eb3bf5cfe3 Upgrade Ubuntu CI builds to use 20.04
Moves Linux CI builds to the latest Ubuntu LTS.
- Bumps the GCC matrix to versions {7,8,9,10,11}, making 9 the default
for testing non-standard builds.
- Bump Node matrix to {12,14,16,LTS,latest} now that 10 is EOL.
- Fixes to CI builds due to library changes on newer distro.
2021-09-30 22:51:12 +01:00
Michael Bell
56a427f839 Upgrade Boost to 1.70, fix inefficient connection handling
A request to osrm-routed can be assigned to a thread which
is currently busy processing another request, even when there
are other threads/cores available. This unnecessarily delays
the response, and can make requests appear to hang when
awaiting CPU intensive requests to finish.

The issue looks like a bug in Boost.Asio multithreaded
networking stack.

osrm-routed server implementation is
heavily influenced by the HTTP server 3 example in the
Boost.Asio docs. By upgrading to Boost 1.70 and updating the
server connections to match the example provided in the 1.70
release, the problem is resolved.

The diff of the changes to the Boost.Asio stack are
vast, so it's difficult to identify the exact cause. However
the implementation change is to push the strand of execution
into the socket (and timer) objects, which suggests it could
fix the type of threading issue we are observing.
2021-09-30 22:51:12 +01:00
Torben Hørup
73a2b91251
Add GH actions script for docker image (#6138)
* Add GH actions script for docker image

* Updated Changelog
2021-09-30 19:45:15 +01:00
Torben Hørup
34877482e6
Use github actions badge in README.md (#6136) 2021-09-27 12:40:28 +01:00
Daniel Patterson
b739658681
Reset for next release. 2021-09-21 14:50:45 -07:00
Michael Bell
37cfc7f99d
Revert "Executables use hyphens" (#6131)
This reverts commit 5bf3c7b659.
2021-09-21 13:28:01 -07:00
Michael Bell
2d1e620429
Fix test cache to consider MLD executable changes (#6129)
* Fix test cache to consider MLD executable changes

Currently the test cache is not invalidated if changes to
osrm-partition or osrm-customize executables. This is problematic
when these executables make breaking changes to the data format.

We fix this by including both in the list of executables that
can invalidate the test cache.

* Executables use hyphens
2021-09-21 12:35:34 -07:00
Michael Bell
f6349a7fbe
Fix metric offset overflow for large MLD partitions (#6124)
Each MLD cell has source and destination nodes.
MLD is keeping a |source| x |destination| sized table
for various metrics (distances, durations, etc) from each
source to all destinations in a cell.

It stores all of the values for a metric in one large array, with
an offset for each cell to find its values. The offset is currently
limited to 32 bit values, which overflows on very large graphs
(e.g. Planet OSM).

We fix this by changing the offsets to be uint64_t types.
2021-09-21 19:25:30 +01:00
Michael Bell
f1f96166c5
Fix MLD level mask generation to support 64-bit masks. (#6123)
The generation of level masks for compactly storing partition cells
supports sizes that can be stored in 64 bits.

The current implementation fails if the total bit sum is 64 bits
exactly. A bit shift mechanism is used that is undefined when the
shift size is equal to the bit size of the underlying type. This
generates an incorrect mask value.

We fix this by adding a special case for a 64 bit offset. Given this
code is called at most |level| times, there will be no effect on
performance. We also update the assertions to reflect 64 bit masks
are now supported.
2021-09-21 18:09:38 +01:00
Ömer Faruk Özdemir
8e100ea1a0
Update api.md (#6054)
* Update api.md

alternatives_count was missing in this document,

Copied from here:
https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#waypoint-object
2021-09-04 12:33:10 +01:00
Michael Bell
f1a6056953 Immediately close bad connections to prevent file exhaustion
osrm-routed does not immediately clean up a keep-alive connection
when the client closes it. Instead it waits for five seconds
of inactivity before removing.

Given a setup with low file limits and clients opening and
closing a lot of keep-alive connections, it's possible for
osrm-routed to run out of file descriptors whilst it waits for
the clean-up to trigger.

Furthermore, this causes the connection acceptor loop to exit.
Even after the old connections are cleaned up, new ones
will not be created. Any new requests will block until the
server is restarted.

This commit improves the situation by:

- Immediately closing connections on error. This includes EOF errors
indicating that the client has closed the connection. This releases
resources early (including the open file) and doesn't wait for the
timer.

- Log when the acceptor loop exits. Whilst this means the behaviour
can still occur for reasons other than too many open files,
we will at least have visibility of the cause and can investigate further.
2021-09-04 01:55:36 +01:00
Michael Bell
d413d0639d Fix Boost link flags in pkg-config file.
In newer versions of cmake, FindBoost uses Imported Targets for library
component variables, rather than file paths to the Boost libraries.

cmake uses these targets when linking (e.g. target_link_library) and
knows how to correctly substitute the values. However, the OSRM
pkg-config file that we generate doesn't do this, and ends up writing
the actual target symbols, hence the errors trying to link Boost::<component>.

To fix this for newer cmake versions, we create an intermediate configure step
that references the linker files for the imported targets. This is followed
by a generate step that performs the correct substitution.
See this thread for more details: https://cmake.org/pipermail/cmake/2018-December/068812.html

This is backwards compatible to the existing min cmake version (3.1).
However, building using cmake 3.1 fails with a package.json parsing error,
so this commit also bumps the min version to 3.2.
2021-09-03 23:49:32 +01:00
Michael Bell
9884684701 Fix generation of inefficient MLD partitions
Duplicate restriction nodes in the edge-based-graph are currently
not in included in a mapping (.osrm.cnbg_to_ebg) from
node-based-graph edges to edge-based-graph nodes.
This mapping is used by the MLD partitioner to assign EBG nodes
to partitions.

The omission from the mapping means all restriction nodes are
included in a special 'invalid' partition. This special partition
will break the geolocation properties of the multi-level hierarchy.
The partition and its super levels will have a large number of
border nodes and very few internal paths between them.

Given the partitioner is the only consumer of the mapping, we fix
the issue by including the duplicate restriction nodes in the mapping,
so that they are correctly assigned to a partition.

This has measurable improvement on MLD routing.
For a country-sized routing network, the fix reduces routing and table
request computation time by ~2% and ~6% respectively.
2021-09-03 22:48:10 +01:00
Michael Bell
0911691008 Fix changelog entry 2021-09-03 18:35:01 +02:00
Michael Bell
971f0d3fe2 Format unit_tests 2021-09-03 18:35:01 +02:00
Michael Bell
eb0c089574 Replace Travis with Github Actions for CI builds
Replace Travis for continuous integration with Github Actions.
The Github Actions pipeline is functionally equivalent, with
all the same build permutations supported.
Whilst the Github Actions offering is broadly equivalent to
Travis, a few changes have been made as part of the migration.

- The 'core' and 'optional' Travis stages have been consolidated
into one build matrix. This is due to the current inability in
Github Actions to share build steps between jobs, so this avoids
having to duplicate the steps.
Optional stage jobs will now run in parallel with core jobs,
but they still remain optional in the sense that they don't fail
the build.

- A number of existing Github Action plugins are used to replace
functionality provided by Travis or other tools:
Node setup, caching, Codecov, publishing release artifacts.

- Linux builds are updated to build on Ubuntu 18.04.
MacOS builds are updated to run on 10.15. Similar to the
Travis Xenial upgrade attempt, some changes are required due
to underlying platform and compiler upgrades. This means some
Node 10 toolchains will no longer be supported.

Whilst there is opportunity to upgrade some dependencies and
make the CI steps more idiomatic, I've left this for future changes
and just focussed on functional replication.
2021-09-03 18:35:01 +02:00
Mateusz Konieczny
8af4f700f7 fix link in the changelog 2021-09-03 11:14:22 +02:00
Patrick Niklaus
155ca8b1f1 Update src/server/api/url_parser.cpp
Co-authored-by: Michael Bell <moke.byll@gmail.com>
2021-09-03 10:55:53 +02:00
Patrick Niklaus
03001ff90a Fix ranges 2021-09-03 10:55:53 +02:00
Patrick Niklaus
ba4e7bfa11 Add changelog entry 2021-09-03 10:55:53 +02:00
Patrick Niklaus
38df7d5e05 Fix the URL parser for special chars in profile 2021-09-03 10:55:53 +02:00
ijleesw
dca35dcc86 Add support for lua5.4 in FindLua.cmake 2021-07-20 23:21:49 +01:00
Matt Riggott
f7478ba80f
Process maxspeed tag before surface, smoothness, and tracktype tags (#6002)
* Handle maxspeed tags before surface and smoothness tags

Let's say we have a tertiary road with the following tags:

   highway=tertiary
   maxspeed=60
   surface=gravel
   smoothness=intermediate

While the maxspeed tag tells us the legal speed limit, the surface and
smoothness tags have much more effect on the real-world speed of a car.
We should process the maxspeed tags first, and then update the road's
forwards/backwards speeds according to any surface and smoothness tags.
For our hypothetical road the process in the car.lua profile now goes
like this:

1. Get default speed from profile (tertiary = 40 on line 150 of car.lua)
2. Change speed to 60 using maxspeed tag (WayHandlers.maxspeed function
   in way_handlers.lua, lines 434-447)
3. Change speed to 40 using surface tag (WayHandlers.surface function
   in way_handlers.lua, lines 360-363)
4. Check speed according to smoothness tag --- but because it's higher
   than the speed according to the surface tag, leave the speed
   unchanged (WayHandlers.surface function again, lines 368-371)

<ec36319232/profiles/car.lua (L150)>
<ec36319232/profiles/lib/way_handlers.lua (L354-L372)>

Note in step 3 above the speed's only changed from 60kph to 40kph
because it's a lower value. If the surface speed was higher than than
the previous value, the speed would remain unchanged. Another example:

   highway=tertiary
   maxspeed=60
   surface=compacted
   smoothness=intermediate

Here, although the profile's speed for compacted is 80, it would stay at
the lower value of 60 (see way_handlers.lua, lines 360-363).

<ec36319232/profiles/lib/way_handlers.lua (L360-L363)>
2021-06-03 17:56:57 +01:00
Daniel Patterson
ec36319232
Reset main branch after release. 2021-05-17 14:59:48 -07:00
Daniel Patterson
051e931091
Final 5.25 release prep. 2021-05-17 14:57:10 -07:00
Daniel Patterson
3a029d476c
Try pushing tag again. 2021-05-17 14:16:35 -07:00
Daniel Patterson
d97fe2322d
Prep 5.25.0-rc.1 2021-05-17 12:15:04 -07:00
Michael Bell
baca7b70f1
Use Github Releases for hosting node binaries (#6030)
* Use Github Releases for hosting node binaries

Replaces S3 hosting of node binaries with Github Releases.
`node-pre-gyp publish` works exclusively with S3, so upload step
is now performed by the Travis deployment provider.

The behaviour for the package user should not change.
When building a new version tag, Travis will create a release for the
tag if it does not already exist.

* Switch to the osrm-release-automation machine account rather than personal credentials.

Co-authored-by: Daniel Patterson <danpat@danpat.net>
2021-05-17 11:54:08 -07:00
Michael Bell
50f5a753ea Increase PackedOSMIDs size to 34 bits
OSM node 2^33 was created in early April 2021. This and all
subsequently created IDs will be overflowing OSRM node storage
which only support 33 bit IDs.
Bump the number of bits to 34 to double node ID capacity. This
is a breaking change to the data format as it alters the layout
of .osrm.nbg_nodes.
2021-04-24 23:41:02 +01:00
Michael Bell
4ac827a849 Remove redundant loading of .osrm.cell_metrics
When using process memory, MLD cell metrics are loaded twice from
.osrm.cell_metrics - once when loading static data, and again when
loading updatable data. The former appears to be the mistake,
as .osrm.cell_metrics is only listed in `GetUpdatableFiles`.
2021-04-24 21:19:27 +01:00
Mandeep Sandhu
def699dafd
Remove hardcoded access keys from travis config (#6012) 2021-04-15 22:29:40 -07:00
Michael Bell
41dda32546
Merge pull request #5999 from mjjbell/mbell/barrier_kerb
Add kerb barrier exception to default car profile
2021-03-31 20:24:42 +01:00
Michael Bell
8d3ebc64dc Add kerb barrier exception to default car profile
OSM data contains many mistakes that tag kerbs as highway barriers
when instead they are only describing highway crossings.

This PR updates the default car profile to handle these mistakes
and unblock routing on the affected highways.
2021-03-31 01:17:19 +01:00
Michael Bell
c15b02ecf6
Merge pull request #5994 from wangyoucao577/bugfix/correct-doc
Fix valid field type in doc
2021-03-26 16:32:03 +00:00
Jay Zhang
480807500b docs: changelog 2021-03-26 00:28:08 +00:00
Jay Zhang
e2de71bdcf docs: fix valid field type 2021-03-26 00:25:26 +00:00
Daniel Patterson
574060418a
Update node-pre-gyp to fix Node 12/14 installation problems in some environments. (#5991) 2021-03-23 10:11:46 -07:00
Daniel Patterson
9d81eb327a
Reset master versioning for next release. 2021-01-28 10:31:49 -08:00
Daniel Patterson
677598a8d8
Blank commit to trigger TravisCI. 2021-01-28 09:03:40 -08:00
Daniel Patterson
781a2ad0f8
Release 5.24.0 2021-01-28 06:11:02 -08:00
Karen Shea
a613375460
Validate source/destination indices correctly in nodejs support (#5595)
* validate source/destination indices correctly

Co-authored-by: Denis Chapligin <denis.chaplygin@wolt.com>
Co-authored-by: Daniel Patterson <danpat@danpat.net>
2021-01-28 06:02:01 -08:00
Richard Fairhurst
960269f95a
Merge pull request #5131 from themylogin/master
Fix turn.roads_on_the_left and turn.roads_on_the right for two-way roads
2021-01-28 14:00:17 +00:00
Dane Springmeyer
ed7b1baacc
Don't bundle node-pre-gyp (#5520)
Bundling node-pre-gyp was only needed for node v4 and earlier.

Remove it to avoid errors like:

> npm ERR! enoent ENOENT: no such file or directory, rename '/home/circleci/project/node_modules/node_or_tools/node_modules/abbrev' -> '/home/circleci/project/node_modules/node_or_tools/node_modules/.abbrev.DELETE'

More context: https://github.com/mapbox/node-pre-gyp/issues/260#issuecomment-407222286
2021-01-27 09:19:32 -08:00
Daniel Patterson
d4e7b3d60b
Cleanup node dependencies. (#5945)
* Cleanup node dependencies.
2021-01-27 09:17:15 -08:00
Michael Bell
bd3eb6591e
Undo libosrm API break by adding old interface as method overload (#5861)
Removes the breaking libosrm API change by adding the old interface to
the new. This does not introduce any new breaks.

The downside of this is that it allows for multiple ways to
return JSON responses.
2021-01-27 09:14:44 -08:00
themylogin
b0b8069ab0 clang-format 2021-01-27 13:12:20 +01:00
themylogin
d9d873903f Account merged edges when processing turn legs 2021-01-27 10:53:48 +01:00
themylogin
e7acc9df76 Fix turn.roads_on_the_left and turn.roads_on_the right for two-way roads #5128 2021-01-27 10:53:00 +01:00
Denis Chapligin
b6557b8cac
Merge pull request #5927 from OgreTransporter/master
Bugfix Lua 5.4 not working
2021-01-21 15:23:39 +02:00
Denis Chapligin
a05d7a8f73
Merge pull request #5926 from mjjbell/mbell/parameter_improvements
Reduce copying in API parameter constructors
2021-01-21 15:22:26 +02:00
Transporter
35ff807e1d Bugfix Lua 5.4 not working 2021-01-07 10:48:59 +01:00
Michael Bell
e554624438 Reduce copying in API parameter constructors
When using non-default constructors for the API parameter classes,
vector arguments like coordinates and hints are copied at least once
(twice when passed as lvalue arguments).

Enable perfect forwarding of BaseParameter arguments and
pass-by-value in the constructor that uses the argument. This
ensures we copy at most once (zero for rvalue arguments).
2021-01-06 23:15:35 +00:00
Michael Bell
58ba3fc84f
Avoid copying ManyToMany table results (#5923)
Regardless of any copy elision on the returned pair value, the
duration and distance results are always copied.

Fix this by passing rvalue references to std::make_pair.
2021-01-04 08:46:51 -08:00
Denis Chapligin
dddf83db7b
Merge pull request #5908 from systemed/debug_way
Profile debug script which fetches a way from OSM
2020-12-21 20:14:37 +02:00
Michael Bell
5266ac1635
Add support for multiple via-way restrictions (#5907)
Currently OSRM only supports turn restrictions with a single via-node or one
via-way. OSM allows for multiple via-ways to represent longer and more
complex restrictions.

This PR extends the use of duplicate nodes for representng via-way turn
restrictions to also support multi via-way restrictions. Effectively, this
increases the edge-based graph size by the number of edges in multi via-way
restrictions. However, given the low number of these restrictions it
has little effect on total graph size.

In addition, we add a new step in the extraction phase that constructs
a restriction graph to support more complex relationships between restrictions,
such as nested restrictions and overlapping restrictions.
2020-12-20 13:59:57 -08:00
Denis Chapligin
eb1d399f3b
Merge pull request #5894 from xlaussel/avoid_samelookup_in_heap_map
Avoid samelookup in heap map
2020-12-20 22:17:49 +02:00
Andrey Gurevich
6bf68fb0c6
Update http.md (#5914)
Looks like a mistake in the description of Table api
2020-12-20 08:39:35 -08:00
Alin Mindroc
33b2a193f9
Fix node14 compilation issues (#5918)
* Use Nan:: getters and setters for node 12/14 compatibility
* Drop support for publishing node 8 bindings, add publishing support for node 12, 14

Co-authored-by: Daniel Patterson <danpat@danpat.net>
2020-12-19 15:37:01 -08:00
systemed
158d260cbb Mention new script in changelog 2020-12-15 12:51:28 +00:00
systemed
83b17e664c Update comments 2020-12-15 12:49:52 +00:00
xlaussel
89a9bc9d70 Undo changes to package-json.com :
Revert to master version
2020-12-14 08:38:31 +01:00
Denis Chapligin
b0a4ad92c4
Merge pull request #5887 from dburnsii/upgrade_libsol2_v2.20.6
Upgrade libsol2 v2.20.6
2020-12-13 22:55:44 +02:00
systemed
9a20e8e614 Profile debug script to fetch a way from OSM 2020-12-10 11:02:04 +00:00
Desone Burns II
af5efd2abb Merge branch 'master' of github.com:Project-OSRM/osrm-backend into upgrade_libsol2_v2.20.6 2020-12-03 16:50:35 -07:00
Desone Burns II
9ae9a1f6d7 Fix table checks 2020-12-03 16:42:57 -07:00
Denis Chapligin
370081ec14
Merge pull request #5903 from bxl-forever/maxspeed-brussels
Update car.lua - new maxspeed default speed for Brussels, Belgium
2020-12-03 11:22:42 +02:00
bxl-forever
d340f4eabc
Update car.lua - new maxspeed default speed for Brussels, Belgium
Those new speeds apply by law as from Jan. 1, 2021 within the entire Brussels-Capital Region, one of the 3 regions of Belgium.
2020-12-02 13:32:12 +01:00
Desone Burns II
0e10b94d38 Merge branch 'master' of github.com:Project-OSRM/osrm-backend into HEAD 2020-12-01 19:24:11 -07:00
Desone Burns II
1a5e5df6bd Use table lookup as boolean 2020-12-01 19:23:10 -07:00
Denis Chapligin
18a0f6c1f8
Merge pull request #5891 from mloskot/ml/check-indexed-data-for-empty-values
Avoid dereferencing iterators over empty indexed data values
2020-12-01 15:26:58 +02:00
Desone Burns II
8510d6850a Cast string to number in Lua 2020-11-30 17:25:35 -07:00
Desone Burns II
566cf785f5 Initialize empty Lua object 2020-11-30 14:13:18 -07:00
xlaussel
687a3cdfbe Merge branch 'master' into avoid_samelookup_in_heap_map 2020-11-26 21:29:27 +01:00
Daniel Patterson
50d9632ed7
Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10

* Reformat using clang-format-10.0.09
2020-11-26 07:21:39 -08:00
xlaussel
f376225080 Changed code failing when compiling asserts 2020-11-25 13:25:04 +01:00
xlaussel
fcb7dd2a21 format code 2020-11-25 12:42:01 +01:00
xlaussel
aa06029801 References removed for extracted heapNode: could lead to bugs because the same was sometimes modified after when relaxing outgoing edges 2020-11-25 11:22:30 +01:00
Desone Burns II
1ce573ef35 Fix lua nil for MacOS 2020-11-24 08:26:24 -07:00
Desone Burns II
cf13a9714d clang-format-3.8 changed files 2020-11-24 08:06:26 -07:00
xlaussel
8697a6b14a Changes and corrections before change request
Cucumber successfull
2020-11-24 12:43:08 +01:00
xlaussel
9a32722634 other improvements.
Variable renaming with better names
2020-11-24 11:05:11 +01:00
Desone Burns II
24d0af6faf clang-format changed file 2020-11-23 17:12:13 -07:00
Desone Burns II
b1646622e6 Changed nil test to empty test 2020-11-23 17:07:10 -07:00
xlaussel
697c2ff88d other improvements.
Variable renaming with better names
2020-11-23 23:11:41 +01:00
xlaussel
e181cb325c other improvements.
Variable renaming with better names
2020-11-23 23:10:22 +01:00
xlaussel
41af9615cd Improvements 2020-11-23 23:00:27 +01:00
xlaussel
13067844ee Changes made 2020-11-23 22:33:08 +01:00
Desone Burns II
ca68518763 Remove context from get_nodes call 2020-11-23 13:24:44 -07:00
Desone Burns II
f6065de494 Added nil check to table conversion 2020-11-23 13:21:55 -07:00
Mateusz Łoskot
58fbda0483
Avoid dereferencing iterators over empty indexed data values
It seems the values can be empty even if size of blocks
is non-zero (e.g. blocks.size()==1)
2020-11-23 21:21:35 +01:00
Desone Burns II
e693b8963a Remove unsigned 0 comparison 2020-11-19 17:15:17 -07:00
Desone Burns II
5b6e82fa9c Revert "Copy nodes to lua table"
This reverts commit a7a088d416.
2020-11-19 17:14:38 -07:00
Desone Burns II
a7a088d416 Copy nodes to lua table 2020-11-19 15:39:31 -07:00
Desone Burns II
43b920bfb5 Merge branch 'master' of https://github.com/Project-OSRM/osrm-backend into upgrade_libsol2_v2.20.6 2020-11-18 17:11:02 -07:00
Desone Burns II
deacc8fb5c Update to sol2 v2.20.6 2020-11-18 17:01:43 -07:00
Denis Chapligin
a3f1c2afb0
Merge pull request #5882 from mjjbell/mbell/windows_contractor
Fix osrm-contract, tests, on Windows
2020-11-18 14:33:57 +02:00
Denis Chapligin
7e4fbaf4a8
Merge pull request #5884 from dburnsii/upgrade_libosmium_v2.15.6
Upgrade libosmium to v2.15.6
2020-11-18 10:41:28 +02:00
Desone Burns II
dfc1bfc27e Upgrade libosmium to v2.15.6 2020-11-17 14:59:06 -07:00
Michael Bell
96acdaf0d5 Fix osrm-contract, tests, on Windows
As part of graph contraction, node renumbering leads to
in-place permuting of graph state, including boolean vector elements.

std::vector<bool> returns proxy objects when referencing individual
bits. To correctly swap bool elements using MSVC, we need to explicitly
apply std::vector<bool>::swap.

Making this change fixes osrm-contract on Windows.

We also correct failing tests and other undefined behaviours
(mainly iterator access outside boundaries) highlighted by MSVC.
2020-11-15 14:22:26 +00:00
Denis Chapligin
98fd17589d
Merge pull request #5868 from wangyoucao577/feature/unify-turn-index-dump
Unify .osrm.turn_penalties_index dump same with turn_weight_penalties/turn_duration_penalties
2020-11-10 11:20:55 +02:00
Denis Chapligin
21444ce7cb
Merge pull request #5878 from mjjbell/mbell/fix_windows_partition
Fix bit-shift overflow in MLD partition step for Windows builds
2020-11-09 11:43:14 +02:00
Michael Bell
b840c0be95 Fix bit-shift overflow in MLD partition step for Windows builds
For very large graphs, generation of MLD level masks fail on Windows
due to bit shift overflow of unsigned long values.

Correct by using unsigned long long literals, which are 64 bit on
all major systems.
2020-11-08 03:51:11 +00:00
Jay Zhang
17eb39d0a9 fix: clangformat 2020-10-26 01:19:17 +00:00
Jay Zhang
c090457f1f docs: changelog 2020-10-23 09:48:21 +00:00
Jay Zhang
7d28b7aa3a feat: unify turn_penalties_index dump same with turn_weight_penalties and turn_duration_penalties 2020-10-23 09:38:56 +00:00
Guannan Du
1ba8aba466
Fix Issue#5864 build errors on mac OS (#5865)
* Fix Issue#5864 build errors on mac OS

Co-authored-by: Guannan Du <guannan.du@Guannans-MacBook-Pro-2.local>
2020-10-21 07:00:55 -07:00
Denis Chapligin
9f80f6d64d
Merge pull request #5859 from akashihi/protozeroupdate
Updated bundled protozero to v1.7.0
2020-10-20 10:45:32 +03:00
Denis Chaplygin
a8362d75b5 Updated bundled protozero to v1.7.0 2020-10-16 10:28:48 +03:00
Daniel Patterson
df3ed43d70
Reset master for next version. 2020-10-14 14:10:33 -07:00
Daniel Patterson
c021cea770
Prepare 5.23.0 release 2020-10-14 14:08:23 -07:00
Daniel Patterson
628784eb7d
Prepare 5.23.0-rc.2 2020-10-08 20:14:10 -06:00
Daniel Patterson
440fb61f8f
Merge branch 'master' into 5.23 2020-10-08 16:27:25 -06:00
Michael Bell
f87a324633
Fix crash in MLD alternative search if source or target are invalid (#5851)
In situations where there is not a valid source or target phantom
node (e.g. when snapping to an edge with a zero weight), a
heap assertion will fail in the MLD alternative search code.

We fix this by checking for empty heaps before proceeding with
the search.
2020-10-08 15:27:02 -07:00
Daniel Patterson
2222ee6a67
Prepare 5.23.0-rc.1 2020-10-07 16:21:00 -06:00
Michael Bell
e033e0b553
Fix table result when source and destination on same one-way segment (#5828)
Fixes #5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
2020-10-07 14:58:13 -07:00
Daniel Patterson
c24f917dcf
Cleanup changelog in master to match current release state. 2020-10-07 14:58:38 -06:00
Denis Chapligin
1e98ae7efe
Merge pull request #5849 from akashihi/leftfeature
Driving side property added to driving_side.geojson
2020-10-06 19:07:12 +03:00
Denis Chaplygin
55b3260cc3 Driving side property added to driving_side.geojson 2020-10-06 09:01:22 +03:00
Daniel Patterson
3451d1ec82
Lock access to facade_factory in data_watchdog to avoid accessing destructed object (#5844)
* Wrap access to facade_factory in a shared lock so it doesn't get changed partway through access which leads to a crash.
2020-09-30 18:45:44 -07:00
Michael Bell
4799b46eeb
Incorrect error message when unable to snap all input coordinates (#5846)
In cases where we are unable to find a phantom node for an input
coordinate, we return an error indicating which coordinate failed.

This would always refer to the coordinate with index equal to the
number of valid phantom nodes found.

We fix this by instead returning the first index for which a
phantom node could not be found.
2020-09-30 18:44:22 -07:00
Denis Chapligin
f6b313e958
Merge pull request #5836 from fofanov/mbell/remove_future
Remove unused future
2020-09-30 18:23:00 +03:00
Michael Bell
d3ab6f1fca Remove unused future
The serialization of the compressed node based graph was changed in
c410c2 to no longer be asynchronous.

This removes the unused future object.
2020-09-22 23:01:06 +01:00
Denis Chapligin
523d9e9c05
Merge pull request #5824 from alistairwoodcock/nodejs-doc-table-annotations
Annotations was missing as part of the table documentation
2020-09-10 10:29:01 +03:00
Alistair Woodcock
8e81034bb2 Annotations was missing as part of the table documentation 2020-09-10 09:23:25 +10:00
Denis Chapligin
4a47267455
Merge pull request #5821 from slavanap/master
Make MMapMemoryAllocator map files in read-only (O_RDONLY) mode
2020-09-09 14:09:31 +03:00
Vyacheslav Napadovsky
f545f2293e Make MMapMemoryAllocator map files in read-only (O_RDONLY) mode. Mapping with O_RDWR will cause copy_up across Docker layers. 2020-09-09 00:51:42 +03:00
Denis Chapligin
78160c0fe4
Merge pull request #5813 from woltapp/tbbdeprecation
Partially fixes use of deprecated TBB features
2020-09-08 11:17:32 +03:00
Denis Chapligin
a35961ca6a
Merge pull request #5814 from woltapp/boostdeprecation
Removed references to obsolete Boost.Test headers.
2020-09-08 11:12:38 +03:00
Denis Chaplygin
933e36190f
Removed catching of obsolete tbb:captured_exception, as TBB now supports C++ native std::exception_ptr inter-thread exception passing mechanism. 2020-09-04 09:33:43 +03:00
Denis Chaplygin
03d9e7a8ce
Deprecated tbb::task_scheduler_init replaced with std::thread and tbb::global_control 2020-09-04 09:33:43 +03:00
Denis Chaplygin
7e24dcfd0a
Removed references to obsolete Boost.Test headers. 2020-09-02 13:16:44 +03:00
Denis Chapligin
cdce2af1c9
Merge pull request #5536 from leighghunt/master
Updating extent of Hong Kong in list of left-hand drive countries
2020-09-02 11:48:36 +03:00
Leigh Hunt
3116734bec Merge branch 'master' of github.com:Project-OSRM/osrm-backend 2020-09-02 09:52:01 +12:00
Denis Chapligin
4d6272b030
Merge pull request #5569 from rdvelazquez/master
Update kCellsAtMostSameBy comment
2020-08-21 12:07:27 +03:00
Denis Chapligin
a7993eebac
Merge pull request #5760 from woltapp/nostxxl
Removed STXXL support.
2020-08-20 13:19:53 +03:00
Denis Chaplygin
2d0b2ca987
Removed STXXL support. 2020-08-20 11:54:02 +03:00
Lev Dragunov
699ca2bbd0
Merge pull request #5758 from woltapp/gcc10
Fixes signed/unsigned comparision spotted by gcc10.
2020-08-20 10:59:23 +03:00
Denis Chapligin
8b40c594be
Merge pull request #5784 from OgreTransporter/bugfix-cmaketbb-5782
Bugfix TBB linking #5782
2020-08-19 12:39:00 +03:00
Denis Chapligin
909570fd7f
Merge pull request #5711 from wingyplus/fix-debug-example
Fix profiles/debug_example.lua cannot interprete by lua
2020-08-19 11:15:06 +03:00
Denis Chapligin
df9fda177d
Merge pull request #5384 from wangyoucao577/clean-comments
correct comments for "compress edge if it crosses a traffic signal"
2020-08-18 17:21:23 +03:00
Jay Zhang
d2e7e6e9e6 improve comment description 2020-08-12 15:18:58 +08:00
Denis Chapligin
b9ebe0c369
Merge pull request #5628 from wangyoucao577/feature/disable-debug-log-compile-time-control
Control release mode debug logging output by ENABLE_DEBUG_LOGGING option
2020-08-11 10:27:27 +03:00
Jeroen Hoek
cd4e6a1fe3
Fix broken path in documentation (#5636)
Replaces references to
`include/extractor/guidance/road_classification.hpp` with
`include/extractor/road_classification.hpp`.

The latter is included in the project.
2020-08-10 08:50:15 -07:00
dburnsii
5cac188711
Update profiles.md (#5795)
Fixed a small typo
2020-08-07 13:44:32 -07:00
Jay Zhang
b7fa2c5981 docs: update changelog 2020-07-29 06:02:19 +00:00
Jay Zhang
106082f6f8 feat: add ENABLE_DEBUG_LOGGING option to control debug logging output 2020-07-29 06:00:47 +00:00
Jay Zhang
36d34073da Revert "chore: remove compile time debug log control"
This reverts commit 1ada466081.
2020-07-29 05:10:12 +00:00
Denis Chapligin
57ed232423
Merge pull request #5783 from OgreTransporter/bugfix-lua-5781
Bugfix Lua 5.4 not working
2020-07-28 15:52:58 +03:00
Denis Chapligin
24f12c9d1b
Merge pull request #5732 from lukasz-jagielski-bolt/lkj/compile_with_node_12
Try to fix node 12 compilation issues
2020-07-28 14:42:04 +03:00
Denis Chapligin
bdf2222f6a
Merge pull request #5729 from akashihi/builddataatwolt
Moved test data files to Wolt provided hosting.
2020-07-28 09:43:40 +03:00
Denis Chaplygin
220ad9fe8c
JS tests temporarily disabled as they fail with OOM. 2020-07-23 11:27:58 +03:00
Denis Chaplygin
ae6326719a
Removed CONSTEXPR requirement for a boost, as we need at least c++14 for rest of the code. 2020-07-23 11:27:58 +03:00
Denis Chaplygin
0503a2fcd3
Appveyor build now uses dependency files hosted at Wolt. 2020-07-23 11:27:57 +03:00
Denis Chaplygin
219f2c3aa9
Added windows dependencies building manual. 2020-07-23 11:27:57 +03:00
Denis Chaplygin
493e821b93
Monaco test map moved to the git repository. 2020-07-23 11:27:56 +03:00
Transporter
9c3eeffe2c Bugfix TBB linking #5782
The query if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug) only works if you call CMake explicitly with the build configuration Debug. But if you generate Debug and Release all libraries are linked to the release version.
2020-07-16 19:14:48 +02:00
Transporter
526191256c Bugfix Lua 5.4 not working #5781
In Lua 5.4 the function lua_resume now has an extra parameter. This out parameter returns the number of values on the top of the stack that were yielded or returned by the coroutine (in previous versions, those values were the entire stack.). The constant LUA_ERRGCMM was removed. Errors in finalizers are never propagated; instead, they generate a warning.
2020-07-16 19:08:37 +02:00
Łukasz Jagielski
9861faa456 nodejs: user worker thread friendly initialization 2020-07-07 09:01:52 +02:00
Denis Chaplygin
919fe74c40
Fixes signed/unsigned comparision spotted by gcc10.
Fixed by moving assertion to the actual point where signed values are used.
2020-06-17 13:18:21 +03:00
张庚昕
365121dac4
add generate_hints parameter info to document (#5754) 2020-06-11 06:43:03 -07:00
Łukasz Jagielski
cbec111eb6 include/nodejs/node_osrm.hpp: clang-format 2020-05-12 15:16:38 +02:00
Łukasz Jagielski
7d369b9ab9 Try to fix node 12 compilation issues 2020-05-05 23:34:26 +02:00
Thanabodee Charoenpiriyakij
2c13f2f735 Fix profiles/debug_example.lua cannot interprete by lua
After run `lua5.1 profiles/debug_example.lua`, I got result:

```
lua5.1: debug_example.lua:41: attempt to call field 'way_function' (a nil value)
stack traceback:
        debug_example.lua:41: in main chunk
        [C]: ?
```

This is because Debug has not way_function in the module. This changes
change it to process_way and it's works!!
2020-04-09 16:05:37 +07:00
Lev Dragunov
15f0ca8dda
Merge pull request #5608 from mariusre/http_parsing_fix
made whitespace between Header-key and value otional
2019-12-18 11:32:00 +03:00
Marius Rescheleit
d59ecb321e
added complete link to issue 2019-12-11 13:28:57 +01:00
Lev Dragunov
404ebb1898
Merge pull request #5624 from arnekaiser/patch-1
Update profiles.md
2019-12-10 10:23:18 +03:00
Jay Zhang
11b0a2e02a docs: update change log 2019-12-09 23:19:37 +08:00
Jay Zhang
1ada466081 chore: remove compile time debug log control 2019-12-09 17:53:28 +08:00
Arne
973722d0ec
Update profiles.md 2019-12-05 17:17:31 +01:00
Marius Rescheleit
ca5d17adab
Update CHANGELOG.md 2019-12-03 12:21:53 +01:00
Lev Dragunov
68dcab7c15
Merge pull request #5622 from jdhoek/bug/bicycle_use_sidepath
Bicycle: treat use_sidepath as no access
2019-12-02 14:32:30 +03:00
Jeroen Hoek
92406da194 Bicycle: treat use_sidepath as no access
Fixes #5557.
2019-12-01 18:34:58 +01:00
marius
6d8cf826d7 modified FSM so that the whitespace between header-key and value is optional 2019-11-19 18:30:21 +01:00
Lev Dragunov
48be5a5622
Merge pull request #5604 from jdesgats/fix-guidance-so
fix: install the osrm_guidance library
2019-11-19 14:41:21 +03:00
Julien Desgats
46ab931c64 fix: install the osrm_guidance library
In the case of a shared object compilation, the resulting binaries need
that library. It was not installed along the others, leading to failures
when running osrm-extract.

Fixes #5603
2019-11-15 10:32:27 +00:00
Lev Dragunov
0b139ff05d
Merge pull request #5572 from Tomonobu3110/tomo_less_memory
Reduce memory usage for raster source handling.
2019-11-14 12:58:59 +03:00
Tomonobu Saito
9da6cf8764 add: comment for RasterCache class 2019-11-13 11:01:07 +09:00
Tomonobu Saito
ee177efe41 fix: remove unused include / add const for necessity portion 2019-11-08 16:15:38 +09:00
Tomonobu Saito
fd0f1b60bb fix by revier comments 2019-11-06 11:06:29 +09:00
Tomonobu Saito
9c1c842b79 update CHANGELOG.md 2019-10-10 12:26:13 +09:00
Tomonobu Saito
17f32f4ca1 fix coding format 2019-10-09 13:35:19 +09:00
Tomonobu Saito
542c3ba872 Add singletone class RasterCache to handle global cache data. 2019-10-09 13:02:59 +09:00
Tomonobu Saito
f36707d1fb revert file mode to 664 2019-10-04 17:39:05 +09:00
Tomonobu Saito
a587b14006 destruct static vector and unorderd_map when last RasterContainer is destructed. 2019-10-04 17:30:35 +09:00
Tomonobu Saito
f9ee74d78e Add x range check to avoid data corruption. 2019-10-04 16:47:31 +09:00
Tomonobu Saito
eef072234e update delim chars 2019-10-04 15:14:20 +09:00
Tomonobu Saito
a9fce74e63 remove unused code (debug code) 2019-10-04 14:02:57 +09:00
Tomonobu Saito
432d49e23d bugfix: support multiple delimitor. 2019-10-04 13:50:13 +09:00
Tomonobu Saito
e4aaf07879 remove unused lines 2019-10-03 17:24:42 +09:00
Tomonobu Saito
d316ff9d41 Improvement of raster source loading to reduce consumed memory size. 2019-10-03 16:44:27 +09:00
Ryan Velazquez
921c2f9482
Update kCellsAtMostSameBy comment 2019-10-02 07:12:42 -04:00
Tomonobu Saito
62c8b70f78 use boost::filesystem::file_size() to get the file size (instead of seeking the file). 2019-10-02 19:04:01 +09:00
Lev Dragunov
f520379419
Merge pull request #5566 from akashihi/flatbuffernosoptional
Flatbuffers is not a boost::optional friendly
2019-10-02 11:12:19 +03:00
Tomonobu.Saito (Desktop PC)
d8d9ac8686 Add assert to check memory allocation 2019-10-02 15:47:16 +09:00
Denis Chaplygin
016c77a4de Flatbuffers is not a boost::optional friendly 2019-10-01 17:26:10 +03:00
Lev Dragunov
0205cbc578
Merge pull request #5561 from peoplestom/pessimistic_move
Removed un-needed calls to std::move
2019-10-01 17:12:39 +03:00
Tom Peoples
28895373fb Fixed flatbufferbuiler copy issues.
Compiling under gcc9.1 we get copy issues.
It appears we shouldn't pass builder classes by value, only ref.
2019-10-01 21:54:00 +10:00
Tom Peoples
018a9bc804 Removed un-needed calls to std::move
These calls were throwing a pessimistic move error and stopping compilation.
2019-09-26 17:55:19 +10:00
Lev Dragunov
71433c67b1
Merge pull request #5556 from akashihi/skipwaypoints
Skipwaypoints
2019-09-26 10:33:43 +03:00
Denis Chaplygin
d25a530942 Added cucumber test for skip_waypoint feature 2019-09-23 11:38:33 +03:00
Denis Chaplygin
a6097cdc01 Changelog updated 2019-09-17 17:56:27 +03:00
Denis Chaplygin
50a1c8a08d Added flatbuffers support to Table service cucumber tests 2019-09-17 17:42:52 +03:00
Denis Chaplygin
6214f16552 Updated http API documentation with skip_waypoints. 2019-09-17 17:42:52 +03:00
Denis Chaplygin
e97ec13064 Formatted the sources 2019-09-17 17:42:52 +03:00
Denis Chaplygin
fa5567e669 Added unit tests for 'skip waypoints' on Trip/Match services 2019-09-17 17:42:52 +03:00
Denis Chaplygin
a9d4e28e38 Added unit test for flatbuffers serialization of Match/Trip responses. 2019-09-17 17:42:52 +03:00
Denis Chaplygin
a5127539eb Added unit tests of 'skip_waypoints' option to the Nearest/Route/Table services. 2019-09-17 17:42:52 +03:00
Denis Chaplygin
660c0cc602 Implemented 'skip_waypoints' for the 'Table' service. 2019-09-17 17:42:52 +03:00
Denis Chaplygin
600f48e15a Implemented 'skip_waypoints' support in 'Route', 'Trip', 'Match' services. 2019-09-17 17:42:52 +03:00
Denis Chaplygin
1b47242a58 Implemented 'skip_waypoints' for the 'Nearest' service.
It actually makes no sence, as the only output on the 'Nearest' service
is a list of wypoints. On the other hand it can be used now as a simple
health check.
2019-09-17 17:42:52 +03:00
Denis Chaplygin
10c1b38139 Added new base parameter 'skip_waypoints' 2019-09-17 17:42:52 +03:00
Lev Dragunov
81071b5af9
Merge pull request #5546 from akashihi/keepaliveclear
clear input/output buffers during keepalive clean-up procedure.
2019-09-10 19:01:42 +03:00
Denis Chaplygin
746b2e94a0 Formatted the code 2019-09-10 15:50:13 +03:00
Denis Chaplygin
43f60bc69c We should check, is connections is still open and gracefully return on connection closed by remote. 2019-09-10 14:32:16 +03:00
Denis Chaplygin
145974bc92 clear input/output buffers during keepalive clean-up procedure.
Should fix #5545
2019-09-09 11:20:47 +03:00
Leigh Hunt
c9bd9a967c
Update driving_side.geojson
Removing copy/paste error
2019-09-04 12:49:41 +12:00
Leigh Hunt
3c607a4570
Update driving_side.geojson
Completely overwriting with latest version from https://github.com/openstreetmap/iD/pull/6827, as per @danpat's suggestion.
2019-09-04 12:48:15 +12:00
Leigh Hunt
6dfcfcb105
Adding entry to change log for #5535 2019-09-03 16:52:30 +12:00
Leigh Hunt
e701243641
Updating extent of Hong Kong
Might be a little rough around Sha Tau Kok
2019-09-03 16:45:50 +12:00
Lev Dragunov
f1a4b70a56
Merge pull request #5513 from akashihi/flatbuffers
Flatbuffers support added
2019-08-29 13:11:24 +03:00
Lev Dragunov
df60947794
Merge pull request #5528 from akashihi/nokeepaliveduplicates
connection's reply needs to be reset before handling next request on …
2019-08-29 12:56:27 +03:00
Denis Chaplygin
cd7229ba06 connection's reply needs to be reset before handling next request on same connection. 2019-08-28 17:22:07 +03:00
Denis Chaplygin
624724031d flatbuffers javascript libraries excluded from linting, as it makes no sene to lint generated code. 2019-08-26 15:29:27 +03:00
Denis Chaplygin
0be87c73cf Fixed typo in flatbuffers: longitute -> longitude. 2019-08-26 14:31:51 +03:00
Denis Chaplygin
b8182dd7ff Replaced 'in' and 'out' at the flatbuffers 'instersection' object
with 'in_bearing' and 'out_bearing' to get flatbuffers schema javascript friendly.

Added a cucumber test for flatbuffers support.
2019-08-26 14:03:29 +03:00
Denis Chaplygin
80e1abba0c Added setting 'data_version' to all flatbuffers response functions. 2019-08-26 11:09:38 +03:00
Denis Chaplygin
ce71e08ef1 Added tests for Nearest/Table/Route flatbuffers serialization. 2019-08-26 11:09:38 +03:00
Denis Chaplygin
97270ae473 Fixed nested offsets inside of the flatbuffers structure 2019-08-26 11:09:38 +03:00
Denis Chaplygin
a9c187c99b Updated changelog entry 2019-08-26 11:09:38 +03:00
Denis Chaplygin
ff46e98d21 Library example now shows, how to use different output formats. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
a196e67e1a Vendored flatbuffers headers should be installed with the libosrm 2019-08-26 11:08:56 +03:00
Denis Chaplygin
1a259ccca0 base_result is a part of public API now, so it needs to be installed 2019-08-26 11:08:56 +03:00
Denis Chaplygin
2a1593fe05 Flatbuffers now uses floats instead of double. We do not use that precision anyway and it make output much smaller. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
5888894787 Added short flatbuffers introduction. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
73f544d4da Slightly changed the serialization order. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
889c82516f Set flatbuffers root type and removed unneded array for rows/cols 2019-08-26 11:08:56 +03:00
Denis Chaplygin
306c047c14 Generalized flatbuffers response generation in 'Route','Trip','Match' services. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
533f1ffc6b Inlined routes and waypoints, as all services are using at least one of those object, so there is no need for another one level of indirection. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
a44a75b211 Unit tests are compatible with new plugin API. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
e26a5cc392 Added flatbuffers compatibility to the Node 2019-08-26 11:08:56 +03:00
Denis Chaplygin
90191c9f34 Added flatbuffers output support to the 'Match' service 2019-08-26 11:08:56 +03:00
Denis Chaplygin
b7e9e5f2c0 Added flatbuffers output support to the 'Trip' service. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
13287d9970 Optimizing FB schema:
* Replaced Response union with nullable fields
* "Ok" code replaced with a boolean and a separate structure for a error code and message.
* Inlined geometry, thus removing one layer of indirection.
2019-08-26 11:08:56 +03:00
Denis Chaplygin
affa8a4653 Added flatbuffers output support to the 'Route' service. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
9d7a74445d Added flatbuffers output support to the 'Nearest' service. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
acd3e81ab4 Removed ineffectivness in the serialization schema. Positions are
structs now and distance/duration matrices are just arrays.
2019-08-26 11:08:56 +03:00
Denis Chaplygin
ea111129dd Added full flatbuffers support to the Table service 2019-08-26 11:08:56 +03:00
Denis Chaplygin
7ddda105a3 Added flatbuffers support to the PluginBase::Error
This changes BREAKS osrm.
2019-08-26 11:08:56 +03:00
Denis Chaplygin
56406e80ce Added flatbuffer support to the server request handler. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
75aadb0f3f Passed ResultT down to engine plugins, so now they can form replies in different formats. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
f6f86b2a52 Added flatbuffers schema. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
3f34c8d88c Flatbuffers library added to the list of third party libraries. 2019-08-26 11:08:56 +03:00
Denis Chaplygin
59a83bd537 Added output format parser to the other services.
Same as for Route service, you can now specify either json or flatbuffers
as output format for the other services (except Tile service, where it
makes no sense).
2019-08-26 11:08:56 +03:00
Denis Chaplygin
59ca7840f4 Added output format parser to the Route service.
It is possible now to choose between json and flatbuffers (not yet implemented) output format.
Only route service is supported atm.
2019-08-26 11:08:56 +03:00
Lev Dragunov
88979d0d86
Merge pull request #5518 from akashihi/keepalive
Keepalive
2019-08-23 14:52:08 +03:00
Denis Chaplygin
2462826c20 Added changelog entry. 2019-08-23 13:07:17 +03:00
Denis Chaplygin
9efcab2108 Receive timeout should only be active for a second and
following requests on a keep-alive connections.
2019-08-23 12:21:54 +03:00
Denis Chaplygin
4fbf58adb3 Documented HTTP server 'keep-alive' support 2019-08-23 12:21:54 +03:00
Denis Chaplygin
a7b7d77e1f Formatted the code. 2019-08-23 12:21:54 +03:00
Denis Chaplygin
22550d078f Added timeout handling for keep-alive operations. 2019-08-23 12:21:54 +03:00
Denis Chaplygin
a0582a3e68 Added keep-alive support to the http server. 2019-08-23 12:21:54 +03:00
Denis Chaplygin
92c7b6fbd1 Added 'Connection' header extraction. 2019-08-23 12:21:54 +03:00
Lev Dragunov
86aebc0812
Merge pull request #5471 from stastnypremysl/master
Solving problem with g++8 and boost libs:
2019-05-28 17:45:06 +03:00
Přemysl Šťastný
b4f849adaa Solved this warning:
In file included from /home/travis/build/Project-OSRM/osrm-backend/include/storage/shared_data_index.hpp:4,
                 from /home/travis/build/Project-OSRM/osrm-backend/include/engine/datafacade/contiguous_block_allocator.hpp:4,
                 from /home/travis/build/Project-OSRM/osrm-backend/include/engine/datafacade/contiguous_internalmem_datafacade.hpp:5,
                 from /home/travis/build/Project-OSRM/osrm-backend/include/engine/plugins/nearest.hpp:5,
                 from /home/travis/build/Project-OSRM/osrm-backend/src/engine/plugins/nearest.cpp:1:
/home/travis/build/Project-OSRM/osrm-backend/include/storage/shared_datatype.hpp:102:26: warning: inline function ‘virtual void* osrm::storage::BaseDataLayout::GetBlockPtr(void*, const string&) const’ used but never defined
     virtual inline void *GetBlockPtr(void *base_ptr, const std::string &name) const = 0;
2019-05-28 12:45:47 +02:00
Přemysl Šťastný
d964d368aa added g++8 to travis; -Wno-cast-function-type flag added because https://github.com/nodejs/nan/issues/807 2019-05-28 12:44:48 +02:00
Přemysl Šťastný
38700e207e Solving problem with g++8 and new boost libs:
osrm-backend/src/storage/io_config.cpp:18:89: error: call of overloaded ‘is_regular_file(<brace-enclosed initializer list>)’ is ambiguous
         if (!boost::filesystem::is_regular_file({base_path.string() + fileName.string()}))
                                                                                         ^
In file included from /usr/local/include/boost/filesystem.hpp:17,
                 from /home/premy/packages/osrm-backend/include/storage/io_config.hpp:8,
                 from /home/premy/packages/osrm-backend/src/storage/io_config.cpp:1:
/usr/local/include/boost/filesystem/operations.hpp:473:8: note: candidate: ‘bool boost::filesystem::is_regular_file(const boost::filesystem::path&)’
   bool is_regular_file(const path& p)  {return is_regular_file(detail::status(p));}
        ^~~~~~~~~~~~~~~
In file included from /usr/local/include/boost/filesystem.hpp:17,
2019-05-28 12:43:27 +02:00
Lev Dragunov
817aeace55
Merge pull request #5417 from TehNrd/node-js-docs
Update nodejs api docs with dataset_name parameter
2019-05-27 15:13:16 +03:00
Lev Dragunov
501e866992
Merge pull request #5389 from gojuno/max_height_decrease
Decrease max height to 2 meters
2019-05-27 14:57:19 +03:00
Jason Venable
f2724e9e63 Update nodejs api docs with dataset_name parameter 2019-03-29 10:36:34 -04:00
Ilya Zverev
2820853fb6 Update changelog 2019-03-04 13:30:10 +03:00
Ilya Zverev
f5ebe8bc3b Update comment 2019-03-04 13:27:16 +03:00
Ilya Zverev
98294e3ddd Decrease max height to 2 meters 2019-03-04 13:23:17 +03:00
Jay Zhang
ce33f1ae98 correct comments 2019-03-01 22:33:44 +08:00
RhinoDevel
e86d93760f Table distances & durations work with MLD, too (v5.22.0) (#5377) 2019-02-26 08:41:33 -08:00
Ilya Zverev
a1e5061799 Decrease default car weight to 2 tons (#5371)
* Decrease default car weight to 2 tons
* Add a link to PR to the change log
2019-02-20 10:19:18 -08:00
Daniel Patterson
2c7c18fd24 Fix bug in snapping=any when bearings or radiuses are supplied. 2019-02-15 20:42:30 -08:00
Raf Czlonka
5ddbb25237 Use an environment variable instead of command substitution (#5364)
`$PWD` is already there so use it instead of running `pwd(1)` in a subshell each time.
2019-02-15 15:47:05 -08:00
Raf Czlonka
9ba60d0d5c Quote command line options which may contain special characters (#5362)
I.e. the example commands fail if $PWD contains a space character.
2019-02-15 08:59:02 -08:00
Daniel Patterson
4f0ec785f6
Configurable snapping behaviour (#5361) 2019-02-14 17:14:50 -08:00
Kajari Ghosh
02b50458b0 Update taginfo.json (#5356) 2019-02-07 14:55:57 -08:00
Daniel Patterson
0a556fe450
Fix changelog. 2019-02-04 16:15:19 -08:00
Daniel Patterson
f2f167c95d
Allow routing past barrier=arch. (#5352) 2019-02-04 16:14:43 -08:00
Lev Dragunov
8b45ff7a18
Store metadata about original OSM data, and return it in the API response, if available. 2019-01-30 15:31:56 -08:00
Daniel Patterson
4c665b24d9
Add optional builds for lts and node version aliases. This will give us a heads up when new Node (#5347)
versions break bindings, and might automagically get us support for new versions if it "just works".
2019-01-30 12:17:04 -08:00
Daniel Patterson
381d492a8f
Add waypoints parameter to viaroute API (#5345)
* Add silent waypoints to viaroute API.
2019-01-24 16:19:59 -08:00
Daniel Patterson
e250c83c21 Add BUILD_CONCURRENCY argument so that we can limit concurrency on Docker Hub (and thus reduce peak memory need for build) 2019-01-17 16:16:44 -08:00
Andrii Dmytrenko
e2e326d15e Fix cpack config by pointing to a correct LICENSE file 2019-01-17 09:45:11 -08:00
Daniel Patterson
4abca85474 Downgrade to debian:stretch-slim to ensure stable environment for building. 2019-01-11 16:46:28 -08:00
Daniel Patterson
2c78d862a3
Reset master for next release. 2018-12-18 16:25:51 -07:00
Daniel Patterson
b1451a7421
Release 5.21.0 2018-12-18 16:17:34 -07:00
Daniel Patterson
da1c251144
Prep 5.21.0-rc.1 2018-12-15 21:43:10 -07:00
Daniel Patterson
1eab7b41d1 Update CHANGELOG. 2018-12-15 21:07:06 -07:00
Daniel Patterson
1dca8ae76a Correct invalid tests - these captured the incorrect behaviour, the matrices should've been symmetrical (a->o == o->a for these cases) 2018-12-15 21:07:06 -07:00
Daniel Patterson
002e86863d Add test to ensure forward/reverse snapping distances are correct, and fix some tests that were incorrect due to the bug. 2018-12-15 21:07:06 -07:00
Daniel Patterson
1d82b01816 Count reverse offset from the back of the geometry, not the front. 2018-12-15 21:07:06 -07:00
Frédéric Rodrigo
714719c377 Lua maxspeed parsing refactoring (#5144)
* Lua maxspeed parsing refactoring
2018-12-14 21:58:07 -07:00
Huyen Chau Nguyen
77b4fbb69c Fix maxspeed to consider source:maxspeed tags (#5217)
* In Belgium the maximum speed in rural areas is 70 in the region Flanders
* parse maxspeed using source:maxspeed and maxspeed:type tags
* add changelog
* make maxspeed:advisory more important than maxspeed
* add test for source:maxspeed
2018-12-14 21:42:44 -07:00
Matt Riggott
11fde865f7 Document switch to Debian base images (#5281)
* Document switch to Debian base images
2018-12-14 21:36:09 -07:00
Salim KAYABASI
717406043a Remove unused Node binary publishing, and upgrade build environment.
Upgrades the build environment to Node 10, which let's us pull down some security fixes in package dependencies that were unfixed in Node 4.

Also removes Node 4 and 6 binary publishing which were almost never used (20 downloads out of 50,000).

Fixes https://github.com/Project-OSRM/osrm-backend/issues/5312
2018-12-14 21:34:48 -07:00
Daniel Patterson
1ef85c57cc Upgrade CI environment to Node 10, remove builds for < Node 8
Remove yarn, npm is fast now, and comes with node.
Synchronize package-lock.json and package.json
2018-12-14 14:56:21 -07:00
Daniel Patterson
d0180517a8
Merge branch 'master' of github.com:Project-OSRM/osrm-backend 2018-12-14 11:54:00 -07:00
Daniel Patterson
520b7ebbb6
Remove 5.20 build trigger from master branch - should only exist on release branches. 2018-12-14 11:53:48 -07:00
Dinesh Weerapurage
2caba96076 using libboost 1.67 in both build and run stages (#5311)
* using libboost 1.67 in both build and run stages, added execution permision for /opt
2018-12-14 11:51:05 -07:00
Daniel Patterson
81bc2f41a6
When matching, ignore 'is_startpoint' propert, snap to any edge (#5297)
Includes all edges in the rtree, but adds an `is_startpoint` flag to each.  Most plugin behaviour remains unchanged (non-startpoint edges aren't used as snapping candidates), but for map matching, we allow snapping to any edge.  This fixes map-matching across previously non-is_startpoint edges, like ferries, private service roads, and a few others.
2018-12-13 17:10:32 -07:00
Daniel Patterson
06e010b4d0 Include information on estimates in table response (#5259)
* Revert "Remove estimated_cells value in the response."

This reverts commit 364e35af06.

* Update changelog.

* fix linting

* adjust fallback_speed check

* change [].includes to [].indexOf !== -1 for compatibility with node 4

* change param name

* more cuke tests

* fix formatting
2018-12-11 12:21:57 -05:00
Kajari Ghosh
92d3ce789b
Fix scale_factor bug (#5303)
* check for scale_factor != 1

* changelog
2018-12-10 17:11:08 -05:00
Kajari Ghosh
01ca32c81c
Fix fallback speed validity checks (#5300)
* fix fallback_speeds check to only accept values > 0

* add invalid_fallback_speed
2018-12-10 14:53:30 -05:00
Kajari Ghosh
2e17f3010a
Add a multiplier to the matrix (#5298)
* add a multiplier to the matrix

* add rounding

* remove scale_factor restrictions

* clamp for overflow error

* update check to match error message

* enforce clamping on < 0 and increase test coverage

* add an invalid scale_factor value to node tests

* increase test coverage

* changelog
2018-12-10 13:41:44 -05:00
Kajari Ghosh
c4238c4ed6
Backport-v5.20.0 (#5301)
* Prepare RC.1

* Bump version.

* remove destination/sources length <= coordinates length check (#5289)

* Add node 10 builds to travis (#5246)

* Add node 10 builds to travis

* Add changelog

* bump version to rc5

* Fix fallback_speed vector access (#5291)

* add failing cuke test

* correctly access durations vector

* changelog

* one more cuke test

* bump rc version

* 5.20.0

* remove line from changelog about commit that isn't actually in here

* update CHANGELOG and osrm version in package.json for v5.20.0

* bump to restart appveyor
2018-12-10 11:27:13 -05:00
Kajari Ghosh
3d781e6f28
Fix fallback_speed vector access (#5291)
* add failing cuke test

* correctly access durations vector

* changelog

* one more cuke test
2018-12-05 00:41:06 -05:00
Daniel Paz-Soldan
4976233cff Add node 10 builds to travis (#5246)
* Add node 10 builds to travis

* Add changelog
2018-12-04 14:13:49 -05:00
Kajari Ghosh
98ea2a0b09
remove destination/sources length <= coordinates length check (#5289) 2018-12-04 13:35:26 -05:00
Dinesh Weerapurage
f978900ab0 adding a debian based docker image 2018-11-08 12:03:35 +01:00
Daniel Patterson
8b6580128b
Merge pull request #5255 from Project-OSRM/danpat_snapped_distance_everywhere
Return 'distance' in all waypoints for all APIs
2018-11-02 15:36:27 -07:00
Daniel Patterson
4dde9c7bbe
Include distance from input to snapped for all waypoints, not just on the nearest service. 2018-11-02 15:30:52 -07:00
Daniel Patterson
973837207b
Merge pull request #5257 from Project-OSRM/danpat_table_noroute_estimate
Use estimates for NoRoute in table requests
2018-11-02 01:41:50 -07:00
Daniel Patterson
364e35af06
Remove estimated_cells value in the response. 2018-11-02 01:08:59 -07:00
Daniel Patterson
985ab58f45
Add feature to fill null table entries with as-the-crow-flies estimates. 2018-11-02 01:07:24 -07:00
Daniel Patterson
cb1db646f2
Merge pull request #5251 from Project-OSRM/danpat_cache_distances
Pre-calculate distance values
2018-10-30 16:14:47 -07:00
Daniel Patterson
a67c4bf84d
Calculating durations is unavoidable due to tie-breaking minimums, but we can avoid accumulating distances if they're not requested. 2018-10-30 15:41:06 -07:00
Daniel Patterson
498259b220
Replace dynamic distance calculation for table plugin with pre-calculated distances on shortcuts, avoiding unpacking cost.
Adds approx 10% to total data size.  Speeds up large table requests by 2 orders of magnitude.

Co-authored-by: Kajari Ghosh <ghoshkaj@gmail.com>
2018-10-30 15:41:06 -07:00
Daniel Patterson
5327f8da4e
Timer script should error properly if something goes wrong, and print out what happened. 2018-10-30 15:41:06 -07:00
Daniel Patterson
802ccfb497
Merge pull request #5252 from Project-OSRM/danpat_pin_yarn
Pin Yarn to 1.11.1 so it works with Node4
2018-10-30 15:40:19 -07:00
Daniel Patterson
ec369d560a
Pin Yarn to 1.11.1 so it works with Node4 (https://github.com/yarnpkg/yarn/pull/6409#issuecomment-429181371) 2018-10-30 15:38:55 -07:00
Daniel Patterson
535647e439
Merge pull request #5242 from Project-OSRM/ghoshkaj_mmaperize
Support directly mmap-ing datafiles
2018-10-29 11:58:26 -07:00
Daniel Patterson
954121634f
Merge branch 'master' into ghoshkaj_mmaperize 2018-10-29 09:52:50 -07:00
Daniel Patterson
594a45e7e0
Re-use msinttypes bundled with RapidJSON when compiling on Windows. (#5249) 2018-10-29 09:51:56 -07:00
Daniel Patterson
96c7b47afe
Document new mmap_memory option in NodeJS API 2018-10-27 00:12:17 -07:00
Daniel Patterson
b7e7d32361
Expose new --mmap switch (mmap_memory: true in NodeJS), and run test suite in this mode, as well as shared memory mode. 2018-10-26 23:54:00 -07:00
Daniel Patterson
2f9cb44368
mmap tarfiles directly when mmapping is enabled, instead of copying data into separate mmapped block
Co-authored-by: Kajari Ghosh <ghoshkaj@gmail.com>
2018-10-26 23:53:59 -07:00
Daniel Patterson
d80318f8ea
Match serialized bit-packing for vector<bool> to match in-memory layout for vector_view<bool> so that data can be directly mmapped. 2018-10-26 23:53:50 -07:00
Daniel Paz-Soldan
b1791d1ab3 Fix anchor links in api docs (#5235) 2018-10-16 09:23:29 -07:00
Yota Toyama
a53da9095a Fix table node API docs (#5204) 2018-10-01 16:45:05 +03:00
Kajari Ghosh
72e03f9af9
update changelog after 5.19 release (#5203) 2018-09-11 00:34:40 -04:00
Kajari Ghosh
5597415f28
Revert "Improve speed of Map Matching" (#5196)
* Revert "Update changelog"

This reverts commit 9b779c704f.

* Revert "Fix formating"

This reverts commit 5bd7d04fe3.

* Revert "Fix bug in computation of distance offset for phantom node"

This reverts commit 0f78f7b2cc.

* Revert "Adjust text cases for flightly different matching due to rounding"

This reverts commit 8473be69d2.

* Revert "Round network distance to deci-meter to retain previous behavior"

This reverts commit c0124f7d77.

* Revert "Preserve heap state in map matching"

This reverts commit b630b4e32a.

* Revert "Use distance functions from many to many"

This reverts commit 89fabc1b9c.

* Revert "Use FCC algorithm for map matching distance calculation"

This reverts commit a649a8a5cf.
2018-09-06 12:05:28 -04:00
Jie
5476f6ab27 Fix GDB not work for osrm-routed on Linux (#5157)
As I mentioned in the issue #5156, I met below issue on my Win10+WSL(Ubuntu) env:
The remote debugger (VSCode on Win10, gdb on Ubuntu 18.04 LTS) works well from the beginning of the main() function. But when I step over the code pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask); (src/tools/routed.cpp(289)), below breakpoints can not work and displayed unverified breakpoint.

Then I found that gdb breakpoint need at least SIGTRAP, SIGSTOP to work (Please refer to [how debugger works](http://www.alexonlinux.com/how-debugger-works) for more details), but all signals are blocked in the source code until server initialized done.

In my understanding, block all signals DO NOT make sense for this osrm-routed process. Only several signals (SIGINT, SIGQUIT, SIGTERM) are expected to wait. So I made the change and it works well for me then.
2018-09-05 16:23:48 -07:00
Daniel Patterson
0971f06193 Add option to node bindings to return result as a pre-generated JSON string (this avoids a lot of overhead, and moves JSON string rendering out of the main event loop). 2018-09-05 15:09:13 -07:00
Daniel Patterson
85515f063a Render floating point numbers to string using Grisu2 algorithmt instead of stdlib to speed up JSON generation. 2018-09-05 14:20:47 -07:00
Daniel Patterson
69d7825542 Increase allowed shared memory regions to 512 from ~120 2018-09-05 11:48:02 -07:00
Patrick Niklaus
9b779c704f Update changelog 2018-08-02 12:19:24 +02:00
Patrick Niklaus
5bd7d04fe3 Fix formating 2018-08-02 12:19:24 +02:00
Patrick Niklaus
0f78f7b2cc Fix bug in computation of distance offset for phantom node 2018-08-02 12:19:24 +02:00
Patrick Niklaus
8473be69d2 Adjust text cases for flightly different matching due to rounding 2018-08-02 12:19:24 +02:00
Patrick Niklaus
c0124f7d77 Round network distance to deci-meter to retain previous behavior 2018-08-02 12:19:24 +02:00
Patrick Niklaus
b630b4e32a Preserve heap state in map matching 2018-08-02 12:19:24 +02:00
Patrick Niklaus
89fabc1b9c Use distance functions from many to many 2018-08-02 12:19:24 +02:00
Patrick Niklaus
a649a8a5cf Use FCC algorithm for map matching distance calculation 2018-08-02 12:19:24 +02:00
Frédéric Rodrigo
f928956584 Support maxlength and maxweight in car profile 2018-07-11 18:33:30 +02:00
Frédéric Rodrigo
7ff68792d7 Add helper for maxlength into measure.lua 2018-07-11 18:33:30 +02:00
Frédéric Rodrigo
3088dd0342 Better and flexible weight parsing in measure.lua 2018-07-11 18:33:30 +02:00
Frédéric Rodrigo
d2590989f5 Default maxspeed for fr:rural is now 80km/h 2018-07-11 17:54:46 +02:00
Antoine Giret
3a7b377586 Update profiles.md 2018-06-27 14:27:17 +02:00
Michael Krasnyk
82b5648c97 Don't collapse segregated intersections at roundabout exits, #5114 2018-06-21 15:24:03 +02:00
Antoine Giret
1628a3c4d5 Update profiles.md 2018-06-07 15:43:06 +02:00
Matthias Gilch
e5d8319c43 Removed unused variable
The variable name_data_mutex is declared in a block but never used
within this block. So I've removed the variable.
2018-06-02 22:49:30 +02:00
MichalPP
06699132eb allow routing over barrier=some_tag 2018-05-29 16:56:15 +02:00
MichalPP
918e794d6a change barrier_whitelist to barrier blacklist
change barrier_whitelist to barrier blacklist  in foot profile
fix #5067 and #3890 and #4823
2018-05-29 16:56:15 +02:00
MichalPP
8dd8ee1fc2 blacklisting barriers allow routing
blacklisting barriers allow routing over barrier=some_tag
2018-05-28 17:21:08 +02:00
MichalPP
c3d0efda93 change barrier_whitelist to barrier_blacklist 2018-05-28 17:21:08 +02:00
Patrick Niklaus
3b4e2e83ef Fix excluding nodes for one to all query 2018-05-08 15:50:25 +00:00
Patrick Niklaus
c459530cb6 Address PR comments 2018-05-08 15:50:25 +00:00
Kajari Ghosh
2a15e6dec8 Add support for annotations=distances in MLD
This commit brings feature parity with CH for the `table` pluging.
2018-05-08 15:50:25 +00:00
Huyen Chau Nguyen
1a1293608d fix example requests for distance tables 2018-05-02 17:25:01 +02:00
Michael Krasnyk
318df9deaa Adjust ebn_weight assertion to new node weights 2018-05-01 18:53:04 +02:00
Michael Krasnyk
cacb162520 Review and rebase updates 2018-04-28 08:59:18 +02:00
Michael Krasnyk
105709cb43 Don't handle response errors separately in osrm-runner 2018-04-28 08:59:18 +02:00
Michael Krasnyk
9695fa7941 Remove weight and duration from customizer::EdgeBasedGraphEdgeData 2018-04-28 08:59:18 +02:00
Michael Krasnyk
fd9bebbfa7 Add EBG node durations 2018-04-28 08:59:18 +02:00
Michael Krasnyk
db18e8669f Always read .osrm.enw file in updater 2018-04-28 08:59:18 +02:00
Michael Krasnyk
9b4a4fdd82 Add customizer::MultiLevelGraph 2018-04-28 08:59:18 +02:00
Michael Krasnyk
cdc7e5f021 Fix for updating node weights in contraction hierarchy 2018-04-28 08:59:18 +02:00
Michael Krasnyk
adc87149e2 List dataset blocks 2018-04-28 08:59:18 +02:00
Michael Krasnyk
8adbfe06ed Throw an exception if a shared region is not found 2018-04-28 08:59:18 +02:00
Patrick Niklaus
ae805f9ec8 Make cheap rulers static 2018-04-27 05:21:08 +02:00
Patrick Niklaus
be24689b0f Optimize distance calculation by getting rid of rounding 2018-04-27 05:21:08 +02:00
Michael Krasnyk
41c31a2388 Use mapbox::util::optional instead of std::experimental::optional 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen
8b866502d1 make eslint happy 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen
7837cd61df clang format 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen
b573485c31 only use half of rulers because earth is symmetric 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen
4e68f3a7e1 change haversine computation to cheap ruler in distance tables 2018-04-27 05:21:08 +02:00
Huyen Chau Nguyen
5ba26d3d6d refactor cheap ruler cache 2018-04-27 05:21:08 +02:00
Daniel Patterson
a6cf2eee7e Use faster method for calculating distances.
fix cmakelist
2018-04-27 05:21:08 +02:00
Patrick Niklaus
6843eb1479 Add changelog entries for profile changtes 2018-04-26 21:46:20 +02:00
Patrick Niklaus
b331885d3c Add test fo excluding ferries on bikes 2018-04-26 21:46:20 +02:00
Patrick Niklaus
73716bd651 Add support for classes on bicycle profile 2018-04-26 21:46:20 +02:00
Michael Krasnyk
9edd161da3 Test for "No turn issued for right turn on un-named roads", #4414
The issue is fixed by d166fc6a75
2018-04-26 18:53:47 +02:00
Kajari Ghosh
1bc3ff6491 fix the ascii art to make sense 2018-04-25 23:51:27 +02:00
Kajari Ghosh
b0f2ef287e fix the offset case when there is no packed path to unpack 2018-04-25 23:51:27 +02:00
Patrick Niklaus
16f53ff81a Sort unpacked paths by sharing 2018-04-25 16:07:31 +02:00
Patrick Niklaus
7a260dc2ba More parameter tuning 2018-04-25 16:07:31 +02:00
Patrick Niklaus
1c0d951f5e Adjust to PR comments 2018-04-25 16:07:31 +02:00
Patrick Niklaus
77a740c0fb Parameter tuning for different route lengths 2018-04-25 16:07:31 +02:00
Patrick Niklaus
61101db8cf Use duration and not weight for sharing 2018-04-25 16:07:31 +02:00
Patrick Niklaus
b51632a2fb Chose alternatives parameters based on coordinate distance 2018-04-25 16:07:31 +02:00
Patrick Niklaus
9d10503a9c Replace step function with contious scaling 2018-04-25 16:07:31 +02:00
Patrick Niklaus
7d50e5afe0 Refactor parameters to be selected at runtime 2018-04-25 16:07:31 +02:00
Patrick Niklaus
549216c792 Compute sharing weighted by edge weight
This ensures that small insignificat turns don't affect the overall
sharing metric too much.
2018-04-25 16:07:31 +02:00
Patrick Niklaus
1990de7dcc Fix inserting edges of shortest path for sharing check
This caused very sub-optimal routes to be selected.
2018-04-25 16:07:31 +02:00
Kajari Ghosh
89f6e2d55b
Parse table annotations param correctly (#5050)
* fix incorrect parameter parsing for node osrm and add tests

* fix boost spirit grammar parsing for annotations

* return NotImplemented when distance annotation is requested for MLD in table plugin

* update docs
2018-04-24 11:05:35 -04:00
Michael Krasnyk
c628ecbf24 Update tile unit tests 2018-04-24 15:40:57 +02:00
Jochen Topf
b6f19cd544 Use vtzero in tile plugin.
This uses the new vtzero library (https://github.com/mapbox/vtzero)
instead of using protozero directly.
2018-04-24 15:40:57 +02:00
Kajari Ghosh
14860b62e9
Unpack paths and return total distance in matrix plugin for CH (#4990) 2018-04-20 18:18:55 -04:00
Patrick Niklaus
9970b7d580
Merge pull request #5037 from Project-OSRM/subtrees-protozero-vtzero
Update libosmium and add protozero and vtzero libraries
2018-04-20 20:44:36 +02:00
Patrick Niklaus
7feb79ef91 Merge branch 'master' into subtrees-protozero-vtzero 2018-04-20 13:32:49 +00:00
Antoine Giret
6f84812903 Update profiles.md 2018-04-20 15:29:16 +02:00
Karen Shea
8085e86170
Change emoji 2018-04-20 13:19:48 +02:00
Karen Shea
35973576d9
Update releasing.md 2018-04-20 13:19:06 +02:00
Duane Gearhart
7740d5d7c0 Do not combine a segregated edge with a roundabout (#5040)
* Do not combine a segregated edge with a roundabout, add test
2018-04-20 11:41:53 +02:00
Patrick Niklaus
c4eff6cd65 Add option to osrm-runner to limit the distance 2018-04-20 08:14:03 +03:00
Michael Krasnyk
5c4353b46e
Removing submodules 2018-04-19 22:13:07 +03:00
Michael Krasnyk
05a5918909
Update CMakeLists.txt file 2018-04-19 22:13:06 +03:00
Michael Krasnyk
80ad38bbc6 Merge commit '6bee8866de99a602039feef463c22c972f0f86aa' as 'third_party/vtzero' 2018-04-19 22:03:52 +03:00
Michael Krasnyk
6bee8866de Squashed 'third_party/vtzero/' content from commit 2b43c8f5c
git-subtree-dir: third_party/vtzero
git-subtree-split: 2b43c8f5c7cc461a874a657673dfc15f8fb21d1d
2018-04-19 22:03:52 +03:00
Michael Krasnyk
ba92674c6e Merge commit '68019a1fb20928beaa7b0cb2d8310af29ffe789e' as 'third_party/protozero' 2018-04-19 22:03:49 +03:00
Michael Krasnyk
68019a1fb2 Squashed 'third_party/protozero/' content from commit d5d8debf1
git-subtree-dir: third_party/protozero
git-subtree-split: d5d8debf1b17c6bb652395957b76cde7787e5377
2018-04-19 22:03:49 +03:00
Michael Krasnyk
3a9acde2c3
Merge commit 'a3a7a822e136d2357660d85124d8e7bb26ea6f7c' into subtrees-protozero-vtzero 2018-04-19 22:03:25 +03:00
Michael Krasnyk
a3a7a822e1 Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b
d2c1d872b Release v2.14.0
9c9aedd50 Update embedded catch.hpp to version 1.12.1.
f94e70d32 Change comment on namespace closing brace to make clang-tidy happy.
ad9f03afc Prefer prefix increment operator.
a141b9c0c Update change log.
363fc7a15 Add more XML tests.
303a3090f Refactor XML tests.
a1ee5dd56 Make util namespace inline.
6f1709a83 Cleanup progress bar code.
1b02b65e0 Use Location setters taking a string in osmium_tiles example.
7ffdc7618 Disable clang-tidy warning.
882631085 Better implementation of str_to_int.
4cbf53725 Fix another bitwise op on signed integer.
903bfac9d Disable clang-tidy warning.
01de3f518 Don't change location if set_lon() or set_lat() functions throw.
9a27e899d Fix bitwise operation on signed integer.
61650224f Disable some clang-tidy warnings.
9dfa8437e Provide a way to better mock the getenv function in tests.
ae2c172a2 Explicitly set integer type for integers in test code.
878850068 Simpler implementation. We don't need to look at errno at all.
8f9b886f5 Formatting
cf4760cb0 Use bit operations on unsigned where possible.
c7cb4cde8 No conversion needed later if we declare it this way.
01357a540 Add missing inline for free function.
3feef81ee Disable clang-tidy warning in place we can't do anything about.
bf083b8ee Avoid binary bitwise operations on signed integers.
f70b1c803 Move content of osmium::util::detail namespace into osmium::detail.
caf2f0033 Remove use of atoi and atol from code.
f564cef07 Formatting.
f0885fc73 Disable travis build with sanitizers.
858c58444 Use explicit asserts and then casts, not static_cast_with_assert.
a613b1b0a Disable clang-tidy warning.
50e327677 Always build and run data tests on travis.
20d7a09b0 Update submodule to add more XML tests.
6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp
38ea437c0 Make XML parser more strict.
7788f5108 Remove object_order_type_id_reverse_version_without_timestamp
fe2223d25 Ignore timestamps if only one object has a valid timestamp
a4515161a Code cleanup.
eb5ea1a0e Use explicit conversions.
105905c45 Only disable warning on non-MSVC compilers.
80fc1b35d Change the way IDs are parsed from strings.
78aedf91e More tests for StringMatcher and disable a clang-tidy warning.
644a00752 Move catch.hpp into its own directory.
19842756c Update to newest osm-testdata submodule.
0402f64d7 Fix the problem with "git submodule" in appveyor.
ec4095d32 Cleanup metadata_options code.
d7390741e Add static_cast to avoid conversion warning.
dd16be1c3 Remove else after throw.
ef4d618de Remove unused variable.
0fdb58d13 Check out submodule in appveyor builds.
6406282d3 Merge pull request #248 from Nakaner/metadata-options-more
eb138a902 make clang < 3.9 work
e703b0d1d make sections their own independent test cases
f68888006 detect_available_metadata must be inline
b53224588 move metadata_options into osmium namespace
edd363cfa make const what could be const
302a485e5 remove unnecessary include, add missing include
93a76e07e give osmium::io::metadata_from_object a better name
91dfbc427 update documentation
453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo)
247c3b021 replace friend function by setter methods
0a62e589c performance improvement: check first character instead using std::strlen()
73568bbff move ctor of metadata_options which taks an OSMObject out of class
1879c9e47 restore metadata_options::to_string
71a303608 add more unit tests for osmium::io::metadata_options
843cdc89c replace osmium::io::metdata_options::to_string fully by operator<<
6402a8793 Fix bug in code which determines if an OSM object has a valid user.
a6d8143ae Move metadata_options out of "detail" subnamespace
61e32df10 add metadata_options::operator|=
d5f7cc0ab Use newest osm-testdata submodule.
31e34f10c add operator&=, operator<< and a to_string method to metadata_options
77d507172 Formatting fixes.
1c38b2a61 Update some URLs. Use https where possible.
10066cb3e Merge pull request #247 from Nakaner/issue-245
3c938ce82 Allow version=-1 and changeset=-1 for PBF input.
9a542c133 Add ReaderWithProgressBar class.
49839a1ce Replace strftime by our own implementation.
b32b90942 Update osm-testdata version used.
f88b6e548 Add more tests.
cb7e778f6 Handle NULL geometries in test cases.
1961a9c95 Clean up some test cases.
d7f45e071 Update osm-testdata submodule.
73a2ef18f Remove check for lost ways in multipolygon assembler.
1244e498a Update submodule also in msys2 build.
229fc2453 Revert "Make util namespace inline."
9f942d2e9 Revert "Add inline declaration to one util namespace we forgot."
40d4835ea Really fix appveyor build (I hope).
5ae071135 Add inline declaration to one util namespace we forgot.
e0916257c Clean up debug message.
2ddc474cc Make util namespace inline.
4b4e25f87 Travis config: Do not install clang-tidy, we are not using it.
5a608fba1 Fix travis build.
a075cc323 Fix appveyor build.
41ee9920b Add submodule with osm-testdata repository.
4d42245c0 Revert "Add clang-tidy build to travis."
9df355b64 Fix issue on some compilers.
c8a3c00d6 Add clang-tidy build to travis.
2fc80ad17 Fixed clang-tidy config file order.
2adf05267 Fix various clang-tidy warnings
1dca92459 Use the right syntax to override clang-tidy settings in the code.
25baecb46 Fix some issues found by clang-tidy.
54a8de6c0 Disable more clang-tidy tests.
de46d562e Also look for clang-tidy-6.0 in CMake config.
2172553d8 Add build with sanitizers on travis.
7e4e45562 Add object comparators ignoring the timestamp.
92fb231a1 Fix test code.
e541df0fc Cleanup test code.
5640269da Add comment in appveyor script about unusual parameter.
acb872376 Workaround for failing appveyor MSYS2 build.
0634bcf70 Set default value for m_file_size member.
3a2fe5781 Set default values on output options.
43d289fda Make metadata_options constructor explicit.
6e54992b4 Update change log.
e54b955cf Update included `catch.hpp` to version 1.12.0.
e50b40d53 Update copyright date.
0d8b401b6 Merge branch 'metadata'
c7da3a3b6 Remove superfluous has_visibles boolean.
7f74d33d3 Some cleanups of metadata code and fixes test.
5b3c34990 Output XML attributes uid and user independently of each other.
384167334 Merge pull request #243 from Nakaner/metadata_other
733f1916c Change path of nuget installs in appveyor config.
e48672999 Debug output from FindOsmium.cmake script is better formatted now.
79663be5d Change appveyor scripts to work without deprecated prebuilt libs.
443f7a9e4 Remove dependency on (win)getopt completely.
c133b8b14 Fix osmium_convert: Long options with = syntax.
b55daf00a Remove dependency on (win)getopt from area_test and convert examples.
92f7275a9 output visibility directly after the object ID in debug format
a771279f0 deprecate format option pbf_add_metadata
18e3f6005 The value "no" should be treated as "none" by metadata_options
c8b0b2e28 re-assign metadata_options instead of calling a public method of it
15bc4a200 Add more flexible metadata handling to PBF output
b085632b7 add more flexible metadata handling to OPL and debug output
a12c65974 Remove now wrong check.
767ad883a Allow PBF DenseNodes with only some attributes to be read.
fd5a7eb6c More flexible metadata encoding in OSM files.
d16c18581 Add instructions for bug reporting.
db52591ab Use __COUNTER__ instead of name for internal dummy name.
89e634dfc Cleanup.
931ec30ca Marks some false positives for clang-tidy google-runtime-int warning.
b59ef02a2 More rule of zero/rule of five fixes.
1b72b3386 Pass by value and use std::move.
b7d7017cc Handle some clang-tidy google-runtime-int warnings.
c043ca016 Fix special functions.
41d9f0795 Use fixed sized ints where possible.
0899a66a7 Revert some changes older compilers don't like.
41e05989a Fix several rule of zero/rule of five issues.
4e78a828f Various fixes based on clang-tidy reports.
636bda372 Default initialize arrays.
466e5aa6a Handle various clang-tidy warnings.
9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning.
5e97bf29f Mark Reader and Writer non-movable.
3a2221b27 Add minimal tests for thread-safe queue class.
affdeed6f Add some tests.
5ed055d50 Handle some warnings regarding "explicit".
b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning.
254c25349 Make ADL work for begin()/end() of InputIterator<Reader>.
b64cb32ae Disable clang-tidy android-cloexec-* warnings.
6d6934ffc Fix various warnings reported by clang-tidy.
30dcabaed Another travis build fix.
88c59e669 Fix travis build.
2facb461f Fix travis and appveyor builds.
bba631a51 Remove protozero from repository.
aebe4a914 Use pass by value and std::move in some constructors.
c8c24c8fd Name unused parameters in comments.
9c2e321f9 Make deleted special functions public.
265c16284 Fix some problems with older compilers.
174e95211 Modernize class initialization code for some classes.
4e3e584f8 Disable more clang-tidy warnings.
6b53981bb Fix some class initializations.
fe1405ef8 Add/remove special functions for some classes.
c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning.
0d09210ec Disable misc-unused-parameters warning in clang-tidy.
1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning.
91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons
438076b09 Cleanup: Avoid else after return/break.
e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check.
c822888fc Mark C style cast in macro from a library as NOLINT.
662d4a641 Moving a TypedMemoryMapping is noexcept.
aec1c4526 Use auto (clang-tidy check modernize-use-auto).
64857589d Consistent include order.
d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check.
0d3902420 Refactor test without SECTION.
32e9e9e1e Rewrite test avoiding nested sections.
eeb532902 Reorder includes according to best practice.
249e7b553 Revert "Add build with sanitizers to travis."
362cb419a Set CC env var in travis config.
9f520eca3 Add build with sanitizers to travis.
cfc18fef0 Travis config cleanup.
212c6cd42 Remove tests that triggers undefined behaviour in the std lib.
f30985884 Bugfix: Avoid undefined behaviour.
90191619a Make test work even if unused memory isn't returned to OS.
876867e68 Make older compilers happy.
925d1a797 Add names for unused parameters.
014b3a056 Avoid repeating the return type from the declaration
c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings.
8c03b3827 Disable some warnings.
c49962ffe Refactor test to avoid spurious use-after-move warning.
04a0afbba Sort includes.
2aaab9a89 Use auto where possible.
e2d84109b More changes for old compilers.
5364ca2a8 Changes for old compilers.
098fc1fa2 Move initializations of class members to the declaration.
eea463026 Fix buffer overflow in o5m parser.
5dc74f2d5 Remove check from static cast (and document why).
7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr.
01fa05f1e Clang-tidy config cleanup.
5e8f8df3f Order includes.
6b78d9b24 Various small fixes for problems detected by clang-tidy.
b815f71b7 Fix gdal check in CMake config.
d47487093 Fix integer type error.
dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep.
85e37723b Various small cleanups.
5f40d726a Additional checks in o5m parser.
b59b4b6a6 Check before static cast and throw.
e57b15700 Disable compiling some header files if gdal lib is not available.
1d3056646 Better checking that PBF data is in range.
c586521d3 Add some consts to the code.
df17e8189 Trying to get the types right...
8e9b759e0 Check read and write system call for EINTR.
28c676054 Rename license file so that Github finds it.
be29e9a52 Remove duplicate space character.
36c14136f Update protozero to newest version (1.6.0).
a19181998 Make libosmium work with different protozero versions.
5c5d9fb36 Use tag and type from protozero to make PBF parser more robust.
03f894400 Add repology.org badge to README.md.
1840739dd Merge pull request #234 from AMDmi3/patch-1
d8e737196 Add support for DragonFly BSD
8de181c8d Revert "Return const object from postfix ++ operator."
0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories
150e05aea Fix indentation.
6fdee974a Merge pull request #229 from alex85k/no-winsock
f302f08ce Merge pull request #228 from alex85k/fix-test-win
bfb60c888 remove ws2_32 from needed libraries
ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace
9343f8453 Fix testdata-multipolygon test on Windows (executable path differs)
381cf9272 Do not return const from postfix increment operator.
46ec985e9 Add const version of OutputIterator::operator*.
c67de374f Disable clang-tidy test for const params.
f5eda165f Make functions noexcept and return const value from post increment op.
1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings.
8893d16be Mark some tests using size() with NOLINT.
f8a74a8aa Make functions noexcept.
45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability.
fc173dae7 Merge pull request #227 from alex85k/msys2-appveor
0a281c064 Add MSYS2 building to Appveyor
c93f73120 fix FindGem for Windows Ruby distributions
8bf6702b3 Merge pull request #226 from alex85k/master
e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64
d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body
6830ee9bd ftruncate is not available only on MSVC (MinGW has it)
c0597584f Disable some clang-tidy checks.
578db8e4a Use empty() instead of size() or == "" to check for empty collections.
53c8f3a21 Return const object from postfix ++ operator.
bd5e4d109 Use emplace_back() instead of push_back().
0a0a4f24c Use correct C++ header.
35226ea86 Remove unused move.
df843a9cf Fix header guard.
759e76131 Avoid default argument on virtual function.
db4f1bdb9 Update included catch.hpp to version 1.10.0.
59e70e5c6 Pass constructor arguments by value and std::move() into members.
ee9b598ed Add tests for thread_handler.
ac661209a CMake config: Update list of clang-tidy versions we look for.
d7281215c Add comment to unusual code.
cbb4c09fb Split up some overlong test functions.
9870a6b90 Fix noexcept specification.
5e27c37d0 Use array instead of map to store input/output format creators.
987d12922 Mark some constructors noexcept.
17f4d8b7e Avoid static variable only needed as constant value.
fe705cef0 Avoid else after return in several cases.
d4a85878e Beautifying travis config.
f07d1e375 Make some special functions noexcept.
4bb0f7f22 Do not declare special functions on some classes.
bc6c5943d Disable some clang-tidy checks that produce false positives.
6b6598a5b Remove superfluous std::move() of POD type.
71c3f5e16 Make some special functions noexcept.
1cb32778c Remove explicit true/false in tests.
929ba89cf Always catch by const ref.
a9a255820 Code readability: No else clause after return.
f14364bd3 Code formatting fixes.
f41feb6a5 Simplify code.
727f6eff4 Mark dummy includes for IWYU.
72d20f835 Switch travis build to 'trusty'.
c480e6808 Do not run gcov from codecov script.
d16c6e90a Clean up lambda captures in xml_input_format.hpp.

git-subtree-dir: third_party/libosmium
git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 22:03:25 +03:00
Michael Krasnyk
c7d22c2b92
Update dependencies script 2018-04-19 22:03:20 +03:00
Michael Krasnyk
b2aeb47630 Remove dummy edges before inplace permutation 2018-04-19 12:18:48 +02:00
Patrick Niklaus
0a1d1901cc Fix help text and banner 2018-04-17 18:02:28 +02:00
Patrick Niklaus
29db0c80d9 Use CSV stringify to properly escape data in CSV 2018-04-17 18:02:28 +02:00
Huyen Chau Nguyen
4654751872 add dev dependencies for osrm runner 2018-04-17 18:02:28 +02:00
Marcel Radischat
b5b18d8afc Update profiles.md
Add api-version 4 for lua profiles as latest api-version
2018-04-17 17:23:08 +02:00
Huyen Chau Nguyen
15139c934f add changelog entry 2018-04-16 11:39:44 +02:00
Huyen Chau Nguyen
7b8619e37c adjust tests to changes 2018-04-16 11:39:44 +02:00
Huyen Chau Nguyen
f52b5c31b6 refactor bike profile 2018-04-16 11:39:44 +02:00
Huyen Chau Nguyen
e98859e4c0 make primaries and secondaries more dangerous
only apply oneway safety considerations on primaries

re-adjust primary and secondary safeties
2018-04-16 11:39:44 +02:00
Patrick Niklaus
c5cc4c5a74 Remove double log printing 2018-04-13 10:13:57 +00:00
karenzshea
e3b831364f empty list of shmem regions if none found 2018-04-13 12:07:10 +02:00
karenzshea
730d2b5ef2 log err instead of throwing when no shmem regions found 2018-04-13 12:07:10 +02:00
Michael Krasnyk
16abee1022 Avoid using signed integers for edge IDs 2018-04-12 10:03:37 +02:00
Patrick Niklaus
69fa52a010 Use byte based tar size encoding above 8GB 2018-04-10 21:12:39 +02:00
Patrick Niklaus
e1efa4c6ab Add test case for writing and reading huge tar file
This test case is disabled by default because it needs too much storage,
but serves as documentation for the future.
2018-04-10 21:12:39 +02:00
Michael Krasnyk
17cd1575f6 Use base-256 encoding for files larger 68G
Reference:
http://lists.busybox.net/pipermail/busybox/2011-May/075596.html
2018-04-10 21:12:39 +02:00
Michael Krasnyk
3cd8e0fef8 Use 12 octal digits in mtar_raw_header_t::size 2018-04-10 21:12:39 +02:00
Michael Krasnyk
397bb694fd Fix mtar file size truncation to 4G 2018-04-10 21:12:39 +02:00
Patrick Niklaus
473ebfcbf6 Fix debug printing for coordinates 2018-04-10 18:08:18 +02:00
Patrick Niklaus
a06171438e Fix hard-coded hint strings in unit-tests 2018-04-10 18:08:18 +02:00
Patrick Niklaus
ea0881553e [skip ci] Bump master to 5.18 2018-04-09 13:14:43 +00:00
Michael Krasnyk
c4bf450fc6 Restore storage constructors with one arguments 2018-04-09 15:08:00 +02:00
Patrick Niklaus
bf2b45120a Use ArrayStorage for boundary nodes to optimize MLD
For the MLD algorithm we can partition the NodeID range into boundary
and non-boundary nodes. Since there are only we boundary nodes we can
use the ArrayStorage for those yielding much faster query times.
2018-04-09 15:08:00 +02:00
Patrick Niklaus
7edf0f218c Better statistics for osrm-partition and osrm-custimize 2018-04-09 13:39:39 +02:00
Patrick Niklaus
600ca06166 Simplify toEdges and make it more robust against accidental memory allocations 2018-04-09 13:03:28 +02:00
Michael Krasnyk
8d8042ebae Use ranges with fixed types 2018-04-09 11:05:01 +02:00
Kajari Ghosh
be123cd72f Use ranges in datafacade instead of vectors
Range type must use immutable references due to a
regression in `boost::any_range`.
References:
https://svn.boost.org/trac10/ticket/10493
https://stackoverflow.com/questions/42427395/boostany-range-with-optimization-level-o2-causes-crash/42427662
2018-04-09 11:05:01 +02:00
Daniel Patterson
282415bbc1
Honour British spelling of manoeuvre relation (#5004)
* Support British spelling of manoeuvre to comply with OSM standards.
2018-04-06 17:08:30 -07:00
Patrick Niklaus
b08191b2c4 Add changelog entry for osrm-datastore 2018-04-07 00:22:29 +02:00
Patrick Niklaus
39dd484f45 Restore the connectivity checksum check 2018-04-07 00:22:29 +02:00
Patrick Niklaus
5450574d63 Better test coverage for datastore options 2018-04-07 00:22:29 +02:00
Patrick Niklaus
29d1b34140 Fix formating 2018-04-07 00:22:29 +02:00
Patrick Niklaus
a915542916 Add option to only update the metric dependent data 2018-04-07 00:22:29 +02:00
Patrick Niklaus
fea07f343b Load data in two separate data regions 2018-04-07 00:22:29 +02:00
Patrick Niklaus
c7daa521ad Address PR comments 2018-04-05 15:12:47 +02:00
Patrick Niklaus
c2532b1589 Add test case from @oxidase for datastore parameters 2018-04-05 15:12:47 +02:00
Patrick Niklaus
4610fd9ff1 Fix formating 2018-04-05 15:12:47 +02:00
Patrick Niklaus
c4b90f52c0 Run cucumber in its own dataset namespace so it does not interfere 2018-04-05 15:12:47 +02:00
Patrick Niklaus
0e8b8b4901 Add nodejs test for dataset name 2018-04-05 15:12:47 +02:00
Patrick Niklaus
2c80f76004 Add support for naming the dataset 2018-04-05 15:12:47 +02:00
Patrick Niklaus
666ce46d36 Refactor shared memory storage to allow for multiple named datasets 2018-04-05 15:12:47 +02:00
Michael Krasnyk
bc120776f0 Don't apply unimplemented SH and PH conditions 2018-04-05 13:31:48 +02:00
Daniel Patterson
5693ffd2cf Validate format of changelog entries. 2018-04-05 10:56:28 +02:00
Patrick Niklaus
51fe0dd5a0 Add missing check of a tar writing function 2018-04-05 00:54:50 +02:00
Michael Krasnyk
14d2199cd8 Always create a new kv pair to avoid using shared strings 2018-04-04 12:38:40 +02:00
Patrick Niklaus
9889a454ce Fix test compilation 2018-04-04 12:38:40 +02:00
Patrick Niklaus
cb4586ebee Make use of the view factory in the data facade 2018-04-04 12:38:40 +02:00
Patrick Niklaus
44924b4bb4 Refactor view creation to own header file 2018-04-04 12:38:40 +02:00
Patrick Niklaus
3af3e06e75 Remove canary to get a consistent interface for getting a block pointer 2018-04-04 12:38:40 +02:00
Patrick Niklaus
39effb8f7e Fix checking for non-empty string in prefix check 2018-04-04 12:38:40 +02:00
Patrick Niklaus
5a68f4c214 Refactor setting up vector_view 2018-04-04 12:38:40 +02:00
Patrick Niklaus
f558b16147 First step for better vector encapsulation 2018-04-04 12:38:40 +02:00
Patrick Niklaus
4c2d578561 Fix unit-test compilation due to broken readGraph 2018-04-04 12:38:40 +02:00
Patrick Niklaus
81a4747acb Fix formating 2018-04-04 12:38:40 +02:00
Patrick Niklaus
9fc2c32408 Fix errors when loading an incompatible dataset. 2018-04-04 12:38:40 +02:00
Patrick Niklaus
24e0028afb Remove CheckCompability because it now duplicates logic in the datafacade 2018-04-04 12:38:40 +02:00
Patrick Niklaus
c334d11e95 Refactor metric storage 2018-04-04 12:38:40 +02:00
Patrick Niklaus
aec9b6a178 Fixed reading DataLayout from shared memory 2018-04-04 12:38:40 +02:00
Patrick Niklaus
81929c984b Use boost array sink to avoid copying buffer for BufferReader 2018-04-04 12:38:40 +02:00
Patrick Niklaus
5395290fd5 Add directory listing 2018-04-04 12:38:40 +02:00
Patrick Niklaus
b3ef2a0383 More refactor 2018-04-04 12:38:40 +02:00
Patrick Niklaus
9e97748700 Add datalayout tests 2018-04-04 12:38:40 +02:00
Patrick Niklaus
4a9fdca7b2 Remove fixed block identifiers 2018-04-04 12:38:40 +02:00
Daniel Patterson
f3b7ab92ff Fix typo. 2018-04-04 12:24:09 +02:00
Daniel Patterson
eae9e7fab6 Only listen on 127.0.0.1 (unless overriden by environment) during test runs by default. 2018-04-04 12:24:09 +02:00
Daniel Patterson
649d4ee512
Add support for the 'straight' maneuver direction (#4995)
Add support for the 'straight' maneuver direction
2018-04-03 17:20:18 -07:00
Daniel Patterson
b5a4ffed96
Return datasource names along with datasource annotation (#4973)
* Add new `datasource_names` annotation that returns the string version of the `datasources` annotation
2018-04-03 15:13:25 -07:00
Duane Gearhart
8a63ad9b4b
Added post process logic to collapse segregated turn instructions (#4925)
* Added post process logic to collapse segregated turn instructions

* format updates

* Fixed coordinates to reflect reality
Updated left turn road name

* fixed coordinates to fix test

* Skip last step when processing segregated steps

* updated segregated turn test

* Updated segregated test

* Updated test: Segregated Intersection, Cross Belonging to Correct Street - features/guidance/collapse.feature:79

* Fixed all but one for features/guidance/collapse.feature:124

* Fixed Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second - features/guidance/collapse.feature:219

* Fixed 7 of th 9 failures for Scenario: Partly Segregated Intersection, Two Segregated Roads, Intersection belongs to Second - features/guidance/collapse.feature:219

* Fixed 7 of the 9 failures for Scenario: Segregated Intersection, Cross Belonging to Mixed Streets - Slight Angles (2) - features/guidance/collapse.feature:318

* Fixed Scenario: Segregated Intersection into Slight Turn - features/guidance/collapse.feature:581

* Updated Scenario: U-turn after a traffic light - features/guidance/turn-lanes.feature:1220

* Updated how we combine segregated steps

* Added test to Verify end of road left turn across divided roads

* Fixed divided highwat tests

* Fixed test failure

* fixed Scenario: Partitioned turn, Slight Curve - maxspeed - features/guidance/turn-lanes.feature:936

* Fixed Scenario: Partitioned turn, Slight Curve - features/guidance/turn-lanes.feature:961

* Added strategies to combine segrgated intersections

* Added setModifier alias for readability

* Added strategies to combine segrgated intersections

* Format updates

* Fixes segregated indentification to not mark `circular` edge as segregated

* Added intersection prior to turn so we still call out end of road

* updated expectation to be turn instead of continue

* Confirmed with @oxidase that the lane information if correct - updated the expectation

* Added logic to handle wider straights
Fixed tests

* Update CHANGELOG.md

Added #4925

* Removed TODO

* Process straight step prior to wider straight step
2018-03-30 07:43:56 -04:00
karenzshea
0d9f18fe1f add microtar to executables 2018-03-27 20:50:34 +02:00
Patrick Niklaus
2690dd0621
Merge pull request #4960 from Project-OSRM/refactor/tar_files
Use tar-format to encapsulate data
2018-03-27 14:34:08 +02:00
Patrick Niklaus
4ef331db1f Use read-only mmap as member in StaticRTree 2018-03-27 10:20:33 +00:00
Michael Krasnyk
e572d6c340
msvc fixes 2018-03-26 21:45:27 -04:00
Patrick Niklaus
0c48f5fe2f Make sure to return const char* paths for mtar 2018-03-26 13:13:17 +00:00
Patrick Niklaus
3ee8a963cb Fix formating again 2018-03-26 12:13:07 +00:00
Patrick Niklaus
c322d93435 Make the block size of vector<bool> consistent 2018-03-26 12:12:41 +00:00
Patrick Niklaus
c0dd5d7c76 Fix formating 2018-03-26 11:02:34 +00:00
Patrick Niklaus
993f5badf1 Use OSRM runtime error for tar reader as well 2018-03-26 11:02:34 +00:00
Patrick Niklaus
a542da3678 Remove old io::FileWrite serialization code 2018-03-26 11:02:34 +00:00
Patrick Niklaus
f1a392c4df Fix test include path 2018-03-26 11:02:33 +00:00
Patrick Niklaus
f2bace6c1f Wrap lambda in std::function because of boost version issues 2018-03-26 11:02:33 +00:00
Patrick Niklaus
921235b2dc Use pair instead of tuple for implicit construction 2018-03-26 11:02:33 +00:00
Patrick Niklaus
bde51a9ef5 Add tar file mmaping 2018-03-26 11:02:33 +00:00
Patrick Niklaus
a52213c885 Get offset of data inside tar file 2018-03-26 11:02:33 +00:00
Patrick Niklaus
8e800c48bc Add function to stop and continue writing to a tar file 2018-03-26 11:02:33 +00:00
Patrick Niklaus
e25654c210 MICROTAR: Patch microtar to allow reading from files we are writing to. 2018-03-26 11:02:33 +00:00
Patrick Niklaus
ee447afd72 Fix DealloctingVector from initializer list constructor
It was not setting the number of elements.
2018-03-26 11:02:33 +00:00
Patrick Niklaus
c410c200bd Port .cnbg file to tar format 2018-03-26 11:02:33 +00:00
Patrick Niklaus
8152dcfb4c Port .ramIndex to tar file and mmap .fileIndex directly 2018-03-26 11:02:33 +00:00
Patrick Niklaus
86ffce3a50 Fix missing removal of timestamp in offline facade 2018-03-26 11:02:33 +00:00
Patrick Niklaus
bed53f5fd5 Remove timestamp file 2018-03-26 11:02:31 +00:00
Patrick Niklaus
2b010fc6f3 Port .enw file to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus
b8260e44fa Port .names file to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus
a594008e57 Port .edges file to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus
f407afa694 Move .osrm file to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus
06f28ffd34 Add BufferWriter/BufferReader and simplify interface for ConditionalRestrictions 2018-03-26 11:02:04 +00:00
Patrick Niklaus
4f454a3761 Add buffer reader/writer for per-element serialization 2018-03-26 11:02:04 +00:00
Patrick Niklaus
d4300e73f3 Remove line reading interface from FileReader 2018-03-26 11:02:04 +00:00
Patrick Niklaus
990e411361 Port turn duration penalties to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus
73b3d37837 Port maneuver overrides to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus
5d7d5fceba Port .tld and .tls data 2018-03-26 11:02:04 +00:00
Patrick Niklaus
b1dfbce675 Port .ebg_nodes to tar file 2018-03-26 11:02:04 +00:00
Patrick Niklaus
da5aebaef3 Port .geometry file to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus
bced9a5a6d Port .datasource_names to tar format 2018-03-26 11:02:04 +00:00
Patrick Niklaus
2c5e4e6c02 Add test cases for range table and packed vector serialization 2018-03-26 11:02:04 +00:00
Patrick Niklaus
6ea296fb5c Port .nbg_nodes file to tar 2018-03-26 11:02:04 +00:00
Patrick Niklaus
cf5f6be472 Swtich EBG to tar file 2018-03-26 11:02:04 +00:00
Patrick Niklaus
c61198b26b Port over profile properties 2018-03-26 11:02:04 +00:00
Patrick Niklaus
5d1b4ce71d Port .osrm.icd file over to tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus
c664d0392a Add test cases for int and unsigned vector for tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus
aaf39162a8 Fix vector<bool> serialization for tar files and add unit tests 2018-03-26 11:02:03 +00:00
Patrick Niklaus
cb31f9ec29 Port hsgr file to tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus
fed77c4066 Port cell metrics to tar files 2018-03-26 11:02:03 +00:00
Patrick Niklaus
6a09d2aa9b Remove file size checks from compability logic 2018-03-26 11:02:03 +00:00
Patrick Niklaus
15b53de056 Switch over partition/ files to tar format 2018-03-26 11:02:03 +00:00
Patrick Niklaus
6d96a9a2e3 Serialize mldgr using the new tar writer 2018-03-26 11:02:03 +00:00
Patrick Niklaus
653f647fee Use static alignment for DataLayout 2018-03-26 11:02:03 +00:00
Patrick Niklaus
f7b7335d75 Write/read tar for mldgr 2018-03-26 11:02:03 +00:00
Patrick Niklaus
495131efd7 Add vector serialization 2018-03-26 11:02:03 +00:00
Patrick Niklaus
2eb633bc41 Add unit tests for tar reading 2018-03-26 11:02:03 +00:00
Patrick Niklaus
86bfe1ede1 First step towards reading/writing tar 2018-03-26 11:02:03 +00:00
Patrick Niklaus
c04e1b2ded Merge commit '098d77c658fa846aff55a35c0ad42955e9f736ee' as 'third_party/microtar' 2018-03-26 11:01:50 +00:00
Patrick Niklaus
098d77c658 Squashed 'third_party/microtar/' content from commit 956791770
git-subtree-dir: third_party/microtar
git-subtree-split: 956791770defa4d06696b30db276e88a09ad3538
2018-03-26 11:01:50 +00:00
Patrick Niklaus
385bba4949 Add microtar to dependencies 2018-03-26 10:59:55 +00:00
Duane Gearhart
bc980e72bf Update CHANGELOG.md
Updated #4968: Updated segregated intersection identification
2018-03-23 11:41:52 +01:00
Duane Gearhart
535bb49893 Fixed segregated identification code to not mark circular edges as segregated 2018-03-21 18:02:26 +01:00
Michael Krasnyk
b56a7579a8 Review updates 2018-03-20 16:33:15 +01:00
Michael Krasnyk
8b52c6c7ac Update tests expectations and obvious detection 2018-03-20 16:33:15 +01:00
Michael Krasnyk
d166fc6a75 Restructure Obvious Turn Handling, code transfer from #4426 2018-03-20 16:33:15 +01:00
Huyen Chau Nguyen
bdb116afe5
Fix wrong one-way identification in the bike profile
* upgrade to api version 4

* set bike pushing speed to 4km/h and add mode change penalty

* set cycleways for two-way and one-way roads according correctly

* add changelog

* adjust tests according to change of the walking speed

* adjust tests according to new behaviour of opposite, track and lane in one-ways

* refactor the cycleway identification

* comment to understand weird counterintuitive testcase

* adjust sliproad test because walking speed is now slower
2018-03-19 16:02:25 +01:00
Michael Krasnyk
873e766d2e Add Github releases step 2018-03-18 15:27:11 +01:00
Huyen Chau Nguyen
a84277f246 add tests in left-side-countries 2018-03-18 14:30:40 +01:00
Patrick Niklaus
b80764b6b8 Refactor shared memory layout to expose Block as interface 2018-03-14 17:05:55 +01:00
Frédéric Rodrigo
14082d0e00 Fix typo 'Maximum number of classes if' 2018-03-14 03:16:13 +01:00
Daniel Patterson
f7775f5e0b
Add source phantom weight to first segment when merging legs (#4949)
Fix annotation values for annotations on edges where phantom nodes are snapped.
2018-03-13 11:31:29 -07:00
Michael Krasnyk
b7af6eb2a4 Remove correctly the last segment in annotation 2018-03-09 15:59:21 +01:00
Daniel Patterson
a4ee2ccb13 Avoid copying json::Value objects a lot when reallocating vector 2018-03-08 16:01:16 +01:00
Manuel Martin
c61acaf8be Add documentation about OSM node ids in nearest service response 2018-03-06 16:10:22 +01:00
Michael Krasnyk
0fc8b6289c Merge IntersectionShapeData and IntersectionEdgeGeometry 2018-03-05 13:19:57 +01:00
Michael Krasnyk
0f93a7dd05 Cleanup EBGF code 2018-03-05 13:19:57 +01:00
Michael Krasnyk
4d0fb89489 Adjust Straight direction modifiers of side roads in driveway handler 2018-03-05 13:19:57 +01:00
Michael Krasnyk
6f4af330ed Handle oneways in get_forward_backward_by_key 2018-03-05 13:19:57 +01:00
Michael Krasnyk
7c8c25f7bc Don't use obviousness for links bifurcations 2018-03-05 13:19:57 +01:00
Michael Krasnyk
cf56b5ddbf Increase precision of coordinates in OSM links 2018-03-05 13:19:57 +01:00
Lev Dragunov
ac23e3b223 clang-format 2018-03-01 11:32:18 +01:00
Lev Dragunov
7922a6172a Bearing calculation on matching short segments fix. 2018-03-01 11:32:18 +01:00
Daniel Patterson
e34f2db4db Get OSRM_VERSION_* fields from package.json so we don't have to change things in two places.
No longer need to update CMakeLists.txt version field manually.
2018-03-01 12:05:00 +11:00
Daniel Patterson
5df33e5b90 Make alternative routes tests stable by only being single-threaded 2018-03-01 12:03:18 +11:00
karenzshea
db608559f6 avoid testing self-intersecting way 2018-02-28 15:21:47 +01:00
Michael Krasnyk
c048a36a4c Use smaller range for U-turn angles in map-matching 2018-02-28 15:21:47 +01:00
Duane Gearhart
33021d37a1 Updated segregated intersection identification (#4845)
* Initial internal intersection updates
paired with @oxidase and @kdiluca
TODO fix tests and add in new ones

* Added Internal Intersection Model

* removed debug info

* updates per PR 4845

* fixing build errors

* fixing all compile errors

* fixed EdgeID param

* Added is_internal_straight lambda
Added/Updated constexpr names and values

* added rejection case turn degree logic

* debug logging

* added turn angle logic to reject if there are incoming edges that have opposite turn degrees than outgoing edges or if the outgoing edges have opposing turn degrees; also merged with master v5.16

* fixed formatting

* fix to decrease tile size based on latest turn angle internal intersection updates

* Removed breaks

Breaks in code were a mistake and caused a change in the internal intersection identification.

* Update segregated_intersection_classification.cpp

* Update CHANGELOG.md

Added CHANGED #4845: Updated segregated intersection identification to Unreleased
2018-02-27 15:11:23 -05:00
Patrick Niklaus
31d6d74f90 Update documentation and changelog 2018-02-26 23:32:34 +01:00
Patrick Niklaus
bec57258a4 Add mmap allocator 2018-02-26 23:32:34 +01:00
Karen Shea
43f0723b73 Remove deduplication of unpacked_path_segments in MM collapsing (#4911)
* remove deduplication of unpacked_path_segments
2018-02-24 12:42:11 +11:00
Huyen Chau Nguyen
9b74a47c91 build osx binary for node4 and bump to RC 2 2018-02-24 11:42:08 +11:00
Huyen Chau Nguyen
993a36ea20 update master changelog after version release 2018-02-24 11:42:08 +11:00
Huyen Chau Nguyen
8b5af24eb8
add 5.15.2 to changelog (#4910) 2018-02-23 14:41:02 +01:00
Thomas Brüggemann
5c9a7a0152 Fixed the order of lon/lat in osrm.route() example 2018-02-22 23:41:54 +01:00
Michael Krasnyk
83588fd00f Renumber node IDs in .osrm.maneuver_overrides 2018-02-22 11:42:33 +01:00
Michael Krasnyk
5acf660f37 Check required tags of maneuver relations 2018-02-21 14:49:15 +01:00
Michael Krasnyk
de13834c12 Handle motorway forks with links as a normal motorway ...
passing some ramps or mering onto another motorway
2018-02-21 14:19:53 +01:00
Michael Krasnyk
49811e1f46 Test case for a highway fork with a link 2018-02-21 14:19:53 +01:00
Mateusz Loskot
8788b0fae8 Add .editorconfig file
Propose basic settings for controlling EOL encoding and
space-only indentation of CMake and other scripts.
2018-02-20 16:16:26 +01:00
Michael Krasnyk
1cafafc4cd Don't use obvious directions at ramp bifurcations, #4895 2018-02-20 09:02:24 +01:00
Michael Krasnyk
e2c1956aa5 Test for a ramp bifurcation obviousness 2018-02-20 09:02:24 +01:00
Huyen Chau Nguyen
a8bc2cf8a7
update package.json (#4889) 2018-02-15 16:14:18 +01:00
Huyen Chau Nguyen
975ede4bec
Update package.json
add mkdirp and rimraf to bundledependencies in order for node-pre-gyp to properly install with node
2018-02-15 14:34:35 +01:00
Mateusz Loskot
faff2c774d [msvc] Fix quoting of OSRM_PROJECT_DIR as preprocessor define
It looks MSVC still special handling, no quotoing as well as
additional quoting like add_definitions(-DFOO="\\"foo\\"")
as per https://cmake.org/pipermail/cmake/2007-June/014611.html
does not seem to handle CMake variables correctly.

This Visual C++ specific fix is based on this solution
https://cmake.org/pipermail/cmake/2006-September/011292.html
2018-02-14 13:54:54 +01:00
Mateusz Loskot
d8e3b03ec1 Ignore CMakeSettings.json for CMake integration with VS2017
CMakeSettings.json is an auxiliary file used to customize
CMake configuration while building from within VS2017.

[ci skip]
2018-02-14 13:30:32 +01:00
Mateusz Loskot
ae41066fbe Prefer logical punctuators instead of named operator keywords
Some compilers (eg. MSVC) still require inclusion of <ciso646>
in order to import named operator keywords.
It is easier to stick with traditional punctuators.
2018-02-14 13:26:41 +01:00
Fred-Byrd
342da81591 web_mercator to double 2018-02-13 12:54:52 +01:00
Fred-Byrd
df9195b939 coordinate_calculation doubles 2018-02-13 12:54:52 +01:00
Michael Krasnyk
519eae63c6 Use links with lower priority in the motorway handler
Ref:
https://wiki.openstreetmap.org/wiki/Highway_link
https://wiki.openstreetmap.org/wiki/Link_roads_between_different_highways_types
2018-02-13 11:20:27 +01:00
Michael Krasnyk
5f598da76d Add OSM node barrier=height_restrictor handling 2018-02-12 11:40:35 +01:00
Patrick Niklaus
0da2029d2d Remove publishing binary artefacts on Windows. 2018-02-09 21:18:39 +01:00
Patrick Niklaus
e82b51d0cb Fix default value for matching radius in routed 2018-02-09 21:12:14 +01:00
Daniel Patterson
5531cace7f
Support maneuver relations (#4676) 2018-02-10 05:32:09 +11:00
Patrick Niklaus
1aed13500d Remove GCC 4.9 support. Minimum is now 5.0. 2018-02-09 17:51:58 +01:00
Patrick Niklaus
f6db8ff3b0 Disabel missing initialization warning on GCC 4.9 2018-02-09 17:51:58 +01:00
Patrick Niklaus
26e5c4eae2 Fix formating 2018-02-09 17:51:58 +01:00
Patrick Niklaus
bee3bdb576 Don't throw errors on -Wmaybe-uninitialized because of false-positives 2018-02-09 17:51:58 +01:00
Patrick Niklaus
b96d36f482 Try initializing all of ProfileProperties for GCC 4.9 2018-02-09 17:51:58 +01:00
Patrick Niklaus
d13d6566f8 Fix infinite recursion warning 2018-02-09 17:51:58 +01:00
Patrick Niklaus
aa1048154c Add missing initializer around sub-object 2018-02-09 17:51:58 +01:00
Patrick Niklaus
6c2d26f9bd Make LUA_SOURCE a global for gcc 4.9 2018-02-09 17:51:58 +01:00
Patrick Niklaus
84845ffaa6 Replace optional<EdgeWeight> with constant value 2018-02-09 17:51:58 +01:00
Patrick Niklaus
f65958fc14 Disable error on -unused-local-typedef for clang since it has false positives 2018-02-09 17:51:58 +01:00
Patrick Niklaus
3d6b667997 No unused warning for alias benchmark 2018-02-09 17:51:58 +01:00
Patrick Niklaus
97d027a173 Fix unused lambda capture warnings 2018-02-09 17:51:58 +01:00
Patrick Niklaus
f48dd665ad Fix error due to GLIBC workaround warning 2018-02-09 17:51:58 +01:00
Patrick Niklaus
eb1e83858a Use BOOST_CHECK instead of BOOST_ASSERT to make tests work in release mode 2018-02-09 17:51:58 +01:00
Patrick Niklaus
371dc57dfc Fix uninitialized warning because of boost::optional 2018-02-09 17:51:58 +01:00
Patrick Niklaus
425a46fe78 Fix warnings in unit tests 2018-02-09 17:51:58 +01:00
Patrick Niklaus
fa553659de Turn all warnings to errors for GCC and Clang 2018-02-09 17:51:58 +01:00
Patrick Niklaus
03cffd0f56 Ignore unused-variable warnings cause by V8 header
This can be removed after https://github.com/cjntaylor/node-cmake/pull/37
is merged and released.
2018-02-09 17:51:58 +01:00
Patrick Niklaus
a06d1782c0 Fix multi-line warning 2018-02-09 17:51:58 +01:00
Karen Shea
05f6b55036
Expose waypoints parameter in match interface (#4859)
* expose waypoints parameter in match interface

* Sync target_traversed_in_reverse with target_phantom
2018-02-07 17:33:54 -05:00
Huyen Chau Nguyen
fa8d788bb6
Add road priority class to turn function (#4858)
* expose road priority class to turn function

* update docs
2018-02-07 11:39:02 +01:00
Patrick Niklaus
92b7d581ce Removed unused geojson logging in partitioner 2018-02-06 11:51:33 +01:00
Patrick Niklaus
19651c3d91 Remove unused shapefile/gdal dependencies 2018-02-06 11:51:33 +01:00
Patrick Niklaus
b4cfc8d6e0 Fix formating 2018-02-06 11:51:33 +01:00
Patrick Niklaus
71cfb03738 Remove broken check-conditionals tool 2018-02-06 11:51:33 +01:00
Patrick Niklaus
e7bb612050 Move debug printer code to own header 2018-02-06 11:51:33 +01:00
Patrick Niklaus
83d7a57b73 Remove OSM link debug printing from public class 2018-02-06 11:51:33 +01:00
Patrick Niklaus
cac310123b Remove debug printing code from Rectangle 2018-02-06 11:51:33 +01:00
Patrick Niklaus
bb71d9b28a Remove unused code in partitioner 2018-02-06 11:51:33 +01:00
Kushan Joshi
ea4d0fa1dd Update README.md
This PR makes the path of host `.osm.pbf` file clearer.
2018-02-06 01:07:09 +01:00
karenzshea
91561992a7 update changelog for 5.15.1 2018-02-05 12:21:49 -05:00
Patrick Niklaus
a3ea825a11 Add build job for GCC 6 2018-02-05 13:07:09 +01:00
Patrick Niklaus
7ebbd5cebe Upgrade version of compilers and node on Travis CI
We now build using GCC 7 and Clang 5 and only build
binaries for node 8.x and 4.x.
2018-02-05 13:07:09 +01:00
Michael Krasnyk
9e93f198ae Add CRC checksums to EBG and turns data 2018-02-02 11:33:38 -05:00
Michael Krasnyk
10de243556 Move guidance turn generation out of EBGF 2018-02-02 11:33:38 -05:00
Michael Krasnyk
988b6e3311 Split intersection analysis and guidance code
Intersection analysis occupy in osrm::extractor::intersection namespace
and guidance code osrm::guidance
2018-02-02 11:33:38 -05:00
Michael Krasnyk
36877e4de5 Move guidance pre-processing code into GUIDANCE library 2018-02-02 11:33:38 -05:00
Michael Krasnyk
1794185d43 Refine logging output 2018-02-02 11:33:38 -05:00
Kajari Ghosh
de938df560 remove TurnData from generate_edge function 2018-02-02 11:33:38 -05:00
Kajari Ghosh
e02c5c3c6d comments 2018-02-02 11:33:38 -05:00
Michael Krasnyk
90ff725125 Duplicate edges and turns generation code 2018-02-02 11:33:38 -05:00
Michael Krasnyk
1cbfbd34cf Remove unnecessary loading of turns data in updater 2018-02-02 11:33:38 -05:00
Mateusz Loskot
c6d12e064c Add basic facades for Customizer and Partitioner run methods 2018-02-02 15:52:30 +01:00
Mateusz Loskot
30ed1fae99 Move setting up task_scheduler_init from executables to library
Make entry points of individual pipeline stages responsible for
configuring the task scheduler with requested number of threads
passed in corresponding configuration bundle (ie. follow extractor).
2018-02-02 14:34:20 +01:00
Alain ANDRE
2987292cc0 Add support for non-numerical units in car profile for maxheight #4763 2018-02-02 11:07:43 +01:00
Mateusz Loskot
8114104a43 Rename namespace partition to partitioner
Rename module partition to partitioner.
This cultivates naming used in existing modules like extractor,
customizer, etc. - noun vs verb (word partition is both though).
2018-02-02 11:07:18 +01:00
Patrick Niklaus
03f598b93d [skip ci] Update PR template 2018-02-01 12:06:50 +00:00
Alain ANDRE
5a844f4b7d Addition of left-hand drive countries 2018-02-01 12:48:12 +01:00
Michael Krasnyk
91e6d68604 Increase MAXIMAL_ALLOWED_SEPARATION_WIDTH to 12 meters
the check should cover merging of roads at intersections similar
to https://www.openstreetmap.org/node/53020993#map=18/37.86590/-122.25083
2018-02-01 06:21:08 -05:00
Michael Krasnyk
1119a542d6 Announce reference change if names are empty, #4830 2018-01-29 16:32:59 -05:00
Michael Krasnyk
d706696179 Test case for ref changes with empty names, #4830 2018-01-29 16:32:59 -05:00
Karen Shea
c154875272
Only run step collapsing based on original waypoints parameter (#4829) 2018-01-29 12:35:55 -08:00
Michael Krasnyk
77f8a4f741 Set type of trivial intersections where classes change to Suppressed
... instead of NoTurn
2018-01-25 11:43:44 -05:00
Huyen Chau Nguyen
61e06fcaba
Making the turn function more flexible (#4789)
* set and store highway and access classification for the turn function
* expose highway turn classification and access turn classification and speed to the lua profile turn function
* expose whether connection road at turn is incoming or outgoing
* add lua tests for exposed information to turn function
* update docs about attributes in process_turn
* add turn_classification info to docs
* adding warning if uturn and intersection dont match
* handle u turns that do not turn into intersection[0]
* split OSM link generation in an accessible coordinate function
2018-01-24 15:39:55 -05:00
Kajari Ghosh
13bb997525 Revert "Get actual paths for every entry in a matrix."
This reverts commit 350bc6f756.
2018-01-24 11:52:43 -05:00
Kajari Ghosh
350bc6f756 Get actual paths for every entry in a matrix. 2018-01-24 11:30:26 -05:00
karenzshea
02712cd513 Allow restricted access on highway=service roads for the car profile
We still backlist `access=private` for the car profile though.
2018-01-23 17:40:18 +01:00
Michael Krasnyk
a9d94d35a2 [skip ci] Bump OSRM version to 5.16 2018-01-22 17:24:07 +01:00
Kajari Ghosh
155772f01f
Refactor isThroughStreet/Intersection options (#4751)
* refactor isThroughStreet 
* refactor HaveIdenticalName
* fix a typo in the unit tests
2018-01-19 13:49:00 -05:00
Michael Krasnyk
341a5345da Ignore no_*_on_red turn restrictions (#4804) 2018-01-19 15:50:54 +01:00
Kajari Ghosh
72de59ac91
add tunnel as a class in lua (#4812) 2018-01-19 09:47:27 -05:00
Michael Krasnyk
a7f1cd36fb Fix formatting 2018-01-19 13:55:05 +01:00
Michael Krasnyk
26f0b4dc77 Add assertion and adjust unit test expectations check 2018-01-19 13:55:05 +01:00
karenzshea
181eff29c7 add unit test for split submatch waypoints indices 2018-01-19 13:55:05 +01:00
karenzshea
cdad265d49 only adjust waypoint index in tracepoints when waypoints parameter is specified 2018-01-19 13:55:05 +01:00
Patrick Niklaus
6eb4247484 Fix overflow on zero duration segments, fixes #4283.
As a form of smoothing we use the previous speed value instead.
This makes sense because the zero duration segments have to be very
short, potentially also zero length.
2018-01-18 17:29:23 +01:00
Huyen Chau Nguyen
72a23645a8
Remove "can't parse value" log messages (#4810)
* remove log output of measure.lua
* remove unneccessary return
* quick fix of #4794
2018-01-18 17:27:45 +01:00
Raphael Dumas
c3e06356d6 Provide more detail on docker commands
Helps with #4253 #4095 #4510
2018-01-17 17:37:50 +01:00
Marcel Radischat
7a8390e68e Move description to first row of table 2018-01-17 17:35:29 +01:00
Patrick Niklaus
168e313f73 Correctly mark edges going to/from core with exclude flags 2018-01-11 12:46:49 +00:00
Patrick Niklaus
30f910e861 Add regression test from @fijemax 2018-01-11 12:46:49 +00:00
Huyen Chau Nguyen
e998c1193d
Update docs for process_turn in the profile docs (#4786)
* update correct attributes available in process turn

* make travel mode in ExtractedTurn const

* fix mismatch of struct and class
2018-01-10 11:31:24 +01:00
Michael Krasnyk
a8f3474996 Use unsigned type in percent_encoding to prevent overflow for %80..%ff
Related fix in Boost.Spirit 80414bc688
2018-01-08 12:09:33 +00:00
karenzshea
55cc06fd8b Add waypoints parameter to matching service, returns map matching result
with selective input coordinates as waypoints
2018-01-08 12:28:20 +01:00
Karen Shea
8883d8cc56
Update http.md 2018-01-08 12:21:41 +01:00
Mateusz Loskot
5b2af6ef09 Restore use of user-provided osmium:🧵:Pool instance
Pool instance has been removed from Reader ctor parameters
list in PR #4438, presumably unintentionally.
It is required to prevent potential deadlock during
Pool shutdown as explained in PR #4452.
2018-01-07 18:29:43 +01:00
Patrick Niklaus
6d801e7086 Bumped version to latest.4 2018-01-05 17:35:11 +01:00
Michael Krasnyk
17eb7052ba Make distance_between_roads symmetrical 2018-01-05 17:35:11 +01:00
Michael Krasnyk
330f25eddb Reduce extraction distance to 120 meters
For intersection at https://www.openstreetmap.org/node/65299217
`are_parallel` in MergableRoadDetector::HaveSameDirection is false
for South Van Ness Avenue with 150 meters
2018-01-05 17:35:11 +01:00
Michael Krasnyk
08b88bad63 Still use low precision bearings 2018-01-05 17:35:11 +01:00
Michael Krasnyk
153f9b02a5 Add low precision intersection views back 2018-01-05 17:35:11 +01:00
Michael Krasnyk
0568dca4a3 Adjust to review findings 2018-01-05 17:35:11 +01:00
Michael Krasnyk
60ef179d18 Remove handling of U-turns on motorways 2018-01-05 17:35:11 +01:00
Michael Krasnyk
c64904f5ea Move roads re-ordering to convertToIntersectionView 2018-01-05 17:35:11 +01:00
Michael Krasnyk
4b9e3a8068 Remove IntersectionGenerator 2018-01-05 17:35:11 +01:00
Michael Krasnyk
db7c76d04d Remove GetConnectedRoads from IntersectionGenerator 2018-01-05 17:35:11 +01:00
Michael Krasnyk
cc1a5ea78d Remove usage of IntersectionGenerator in EBGF 2018-01-05 17:35:11 +01:00
Michael Krasnyk
9c033ff461 Free functions for guidance intersections analysis 2018-01-05 17:35:11 +01:00
Michael Krasnyk
3c3322173c Allow to specify empty bearings string in input parameters 2018-01-05 17:35:11 +01:00
Michael Krasnyk
e805f85407 Print statistics only for allowed turns 2018-01-05 17:35:11 +01:00
Michael Krasnyk
4d54456f66 Don't fail if a registered printer has no name 2018-01-05 17:35:11 +01:00
Daniel J. Hofmann
7359d0542f Updates readme link for demo server wiki page, closes #4773 2018-01-05 15:19:33 +01:00
Mateusz Loskot
da4fb13aa3 Tidy up #include-s for Intel TBB headers
Remove unused and add missing headers.
2018-01-05 11:00:31 +01:00
Michael Krasnyk
3649ab4d31 Use default maxspeed value for ua:urban 2018-01-02 20:43:42 +01:00
Michael Krasnyk
9e9e3fb1e4 Change default urban speed in Ukraine to 50kmh
From 1/1/2018 60kmh speed limit changed to 50kmh
http://zakon3.rada.gov.ua/laws/show/883-2017-%D0%BF
2018-01-02 15:34:05 +01:00
Darafei Praliaskouski
e73aa01725 Belarus speed limits (#4764)
* Belarus speed limits

https://en.wikipedia.org/wiki/Speed_limits_in_Belarus

* taginfo.json update

* Update CHANGELOG.md
2018-01-02 14:49:36 +01:00
Michael Krasnyk
a5353c7179 Use consistent EBG node weights in duplicated via nodes 2018-01-02 14:26:35 +01:00
Michael Krasnyk
a5e0d7011b Update CHANGELOG entry 2017-12-26 16:18:27 +01:00
Michael Krasnyk
742c32d936 Don't use to_string conversion in requiresNameAnnounced 2017-12-26 16:18:27 +01:00
Michael Krasnyk
3dec680058 Remove check unnamed check in sliproad handler 2017-12-26 16:18:27 +01:00
Michael Krasnyk
9237430be2 Test for sliproads to roads with empty names 2017-12-26 16:18:27 +01:00
Patrick Niklaus
12d1d84b11 Add test case for sliproads converted from forks 2017-12-26 16:18:27 +01:00
Patrick Niklaus
6dd029e6ea Restore original intend of roundabout test
When doing the new Lua version refactor we changed the expectation to
use `continue uturn` instead of making a whole circle in the roundabout
as the original test case. This was only the shortest path since there
was no roundabout penalty.
2017-12-26 13:28:12 +00:00
Patrick Niklaus
e45d44cb8e Make sure we only count turns as UTurns for the turn_function 2017-12-26 13:28:12 +00:00
Kajari Ghosh
84b6ef4340
add osrm-routed and node-osrm flags to configure mapmatching radius limit (#4721) 2017-12-20 16:53:43 +05:30
Frédéric Rodrigo
5af776d963 Car Profile. Route by supporting physical limitation of height and weight 2017-12-19 13:51:33 +00:00
Frédéric Rodrigo
ddf11cc2cc Profile: stronger unit parsing 2017-12-19 13:51:33 +00:00
Denis Koronchik
c7b1d0c131 Add support of maxweight in profiles 2017-12-19 13:51:33 +00:00
Denis Koronchik
423a4ef326 Add maxheight/maxwidth support into profiles 2017-12-19 13:51:33 +00:00
Patrick Niklaus
ccfbce5300 Remove superflous sentinel in DynamicGraph, fixes #4738 2017-12-18 10:23:29 +00:00
Marcel Radischat
b99d3a0a69 Avoid all highways listed in the avoid set
Even though the speeds are defined for a certain road class, routing should
be avoided as it is listed in the `avoid set`.
2017-12-16 23:45:04 +00:00
Marcel Radischat
659b470320 Add failing test
The avoid set should take precedence over the speed limits.
2017-12-16 23:45:04 +00:00
karenzshea
9a8ed30e95 add assert for untested sliproad cases, removed redundant empty_nameid checks 2017-12-11 15:37:56 +00:00
karenzshea
4166b1ebbf check for empty on string_ref, rather than string itself 2017-12-11 15:37:56 +00:00
karenzshea
89080fb2b0 check for empty name_id before getting data 2017-12-11 15:37:56 +00:00
karenzshea
56459d37d1 access way names through RouteStep in post processing 2017-12-11 15:37:56 +00:00
karenzshea
d5232d5f5c check empty name string in roundabout handler 2017-12-11 15:37:56 +00:00
karenzshea
3f7b5da683 check empty name string in turn collapsing 2017-12-11 15:37:56 +00:00
karenzshea
24562acd30 check empty name string in turn handler 2017-12-11 15:37:56 +00:00
karenzshea
8bce061691 check empty name string in sliproad handler 2017-12-11 15:37:56 +00:00
karenzshea
701c5f853d check empty name string in motorway handler 2017-12-11 15:37:56 +00:00
karenzshea
d1e4ba373a check empty string name in mergable road detector 2017-12-11 15:37:56 +00:00
karenzshea
8cf8f0d7d6 check empty name string in findBasicTurnType 2017-12-11 15:37:56 +00:00
Daniel J. Hofmann
978350c388 Adds cucumber test for continue not taking ref into account when name is empty 2017-12-11 15:37:56 +00:00
Patrick Niklaus
2e97c78181 Remove code for checking the .core file, since we do not create it anymore 2017-12-08 11:28:34 +00:00
Minh Nguyễn
979ec7fa78
Merge pull request #4726 from Project-OSRM/1ec5-pronunciation-doc
Clarify pronunciation property
2017-12-07 11:02:46 -08:00
Minh Nguyễn
1d7f179374
Clarified pronunciation property 2017-12-06 13:13:17 -08:00
Patrick Niklaus
994fae0ef6 Fix formating 2017-12-05 19:09:06 +00:00
Patrick Niklaus
88ee51ba2e const-correctness 2017-12-05 19:09:06 +00:00
Patrick Niklaus
25ee26de3b Refactor segregated intersection classification to right module 2017-12-05 19:09:06 +00:00
Daniel Patterson
353829a4cc
This test now passes, including in the test suite. (#4712) 2017-11-29 13:16:07 -08:00
Michael Krasnyk
6fd0b56e32 Don't use removed alternative paths in filterPackedPathsByCellSharing 2017-11-29 13:17:24 +01:00
Daniel Patterson
c1efefae27
Use the correct driving_side property on the arrive step. (#4708)
Use the correct driving_side property on the arrive step.
2017-11-27 13:16:33 -08:00
Daniel Patterson
0c96f093ff Add Macau and Hong Kong to the left-side driving polygon file. 2017-11-27 11:43:34 -08:00
Daniel Patterson
6f835d57b4 Add checkbox for changelogs to all PRs. 2017-11-27 10:30:46 -08:00
Daniel J. Hofmann
e1e53d274b Makes MLD default algorithm in example to avoid confusion, see #4702 2017-11-27 12:12:49 +01:00
brian lewis
d9a03f8365 Refer to Lua scripting language by its correct name 2017-11-27 12:10:49 +01:00
brian lewis
ce5f284ec6 Fix typos in profiles documentation 2017-11-27 12:10:49 +01:00
Daniel Patterson
02a2d25a3f
Reset versions/changelog for next release - 5.14 work happens on the 5.14 release branch. 2017-11-22 12:37:34 -08:00
Daniel Patterson
9fca6987c9
Update CHANGELOG for 5.14 release prep 2017-11-22 12:34:03 -08:00
Michael Krasnyk
7361558c19 Allow single edge paths in MLD alternatives, #4691 2017-11-21 12:28:44 +01:00
karenzshea
834890cf0b construct extract/contract configs to disable conditional restriction parsing by default 2017-11-20 16:55:17 +00:00
vng
a53794f864 Code review fixes. 2017-11-16 15:08:30 +01:00
vng
8fa98ed27d Increase max segregated distances. 2017-11-16 15:08:30 +01:00
vng
111030864c Use segregated flag as a bit in EdgeBasedNode. 2017-11-16 15:08:30 +01:00
vng
90e361c3dc Use immutable node-based-graph for segregated edges. 2017-11-16 15:08:30 +01:00
vng
32e6ccb037 Code review fixes. 2017-11-16 15:08:30 +01:00
vng
258fcd8626 Fixed test tile test according to new algorithm output. 2017-11-16 15:08:30 +01:00
vng
92c4a228e1 Revert suppressSegregated routing. 2017-11-16 15:08:30 +01:00
vng
9eae1de9bc Fixes for segregated length threshold. 2017-11-16 15:08:30 +01:00
vng
76f793533a Use copressed node-based graph for segregated edges check. 2017-11-16 15:08:30 +01:00
vng
ec7e58e10e Pass edge-based node segregated flag to the post processing routine. 2017-11-16 15:08:30 +01:00
vng
ac5e095d17 Store and pass segregated flag to the data facade. 2017-11-16 15:08:30 +01:00
vng
ee7912f882 Calculating segregated node-based edges. 2017-11-16 15:08:30 +01:00
Denis Koronchik
f460a9f17e Add code to draw segregated nodes in a tile layer 2017-11-16 15:08:30 +01:00
vng
37685dae73 Added segregated test #4273. 2017-11-16 15:08:30 +01:00
Daniel Patterson
5b58445535 Expose driving_side as a property on RouteStep 2017-11-09 10:08:11 -05:00
Michael Krasnyk
5b79640b44 Don't compute new modifier for merge instructions in collapsing 2017-11-08 11:26:47 -05:00
Michael Krasnyk
921471a153 Test of merging onto a motorway with junction references 2017-11-08 11:26:47 -05:00
Daniel J. Hofmann
3a1bf2c85d Slightly decreases roundabout turn radius from 25m to 15m 2017-11-07 13:45:57 -05:00
Daniel J. Hofmann
9b83649a03 Fixes AppVeyor tests 2017-11-06 14:38:21 -05:00
Daniel J. Hofmann
2224389fb3 Filters zero value histograms, formats numbers 2017-11-06 14:38:21 -05:00
Daniel J. Hofmann
aed7bd852d Prints turn types and modifiers as strings 2017-11-06 14:38:21 -05:00
Daniel J. Hofmann
c5b48e3506 Adds a statistics handler for turn types and modifiers 2017-11-06 14:38:21 -05:00
Kajari Ghosh
73f4e1d45a update changelog 2017-11-06 13:34:02 -05:00
Kajari Ghosh
002da129c8 update tests 2017-11-06 13:34:02 -05:00
Kajari Ghosh
1b545fee8a update lua profile to use new process_turn 2017-11-06 13:34:02 -05:00
Kajari Ghosh
cbc96ec492 refactor ExtractionTurn and ProcessTurn c++ code 2017-11-06 13:34:02 -05:00
Daniel J. Hofmann
c95d845876 Adds Node 8 jobs to Travis, resolves #4657 2017-11-02 20:17:17 +00:00
Daniel Patterson
ac7705e9a0 Ensure .pc installation to the same heirarchy as the actual libraries (usually /usr/local/lib) 2017-11-01 19:40:31 +00:00
Patrick Niklaus
0b6eb85106 Fix formating 2017-11-01 14:25:07 +00:00
Moritz Kobitzsch
e197dae54d do not consider empty-names + empty-refs a valid name for u-turns 2017-11-01 14:25:07 +00:00
Moritz Kobitzsch
4bf3c97476 add test-case illustrating misuse of names in collapse 2017-11-01 14:25:07 +00:00
Daniel Patterson
19d2e82d15 Reduce docker image size to about 20MB by using a multistage build. 2017-10-31 23:35:01 -04:00
Michael Krasnyk
eb48945807 Add use of LUA_LIBRARY_DIRS, #4646 2017-10-31 23:35:01 -04:00
Patrick Niklaus
a68db86dc8 [skip ci] Bump OSRM version to 5.14 2017-10-31 16:17:07 +00:00
Daniel J. H
948025440f Clarifies docs for roundabout exits (#4640) 2017-10-26 14:44:06 -07:00
Daniel J. Hofmann
8365e20d4f Adds cardinal_directions flag to profiles and disables ref-rewriting by default 2017-10-26 20:38:41 +01:00
Denis Koronchik
0fc6903d7e Fix issue #4585 2017-10-25 14:11:33 +02:00
Moritz Kobitzsch
23fd27422b normalise angles only if an improvement 2017-10-25 10:17:14 +02:00
Moritz Kobitzsch
e965cf12f8 add testcase illustrating changes to angle adjustments 2017-10-25 10:17:14 +02:00
Michael Krasnyk
523be8f7e5 Add unclassified roads to restricted_highway_whitelist, #4631 2017-10-24 09:59:07 +02:00
Patrick Niklaus
c2a605a70d Contract the exclude-flag sub-graphs as well 2017-10-24 09:46:44 +02:00
Moritz Kobitzsch
910ee0829f make circular detection covered again 2017-10-23 09:06:59 +02:00
Moritz Kobitzsch
704cf314d4 explicitly check for 90 degree turns / turning onto segregated roads 2017-10-23 09:06:59 +02:00
Moritz Kobitzsch
b8651bfac9 do not merge segregated highways in if there is actual turns involved 2017-10-23 09:06:59 +02:00
Moritz Kobitzsch
bf28e40ba6 add further tests for segregated roads 2017-10-23 09:06:59 +02:00
Patrick Niklaus
a8de007d98 Rename locations-cache -> location-cache 2017-10-20 15:55:23 +01:00
Patrick Niklaus
4684d2e35c Add changelog entry for changed behavior 2017-10-20 15:55:23 +01:00
Patrick Niklaus
27a9603b98 Change --use-location-cache=false to --disbale-location-cache 2017-10-20 15:55:23 +01:00
Patrick Niklaus
1610ea8dee Fix tests 2017-10-20 15:55:23 +01:00
Patrick Niklaus
171ff1191f Replace use of implicit_value since that broke with boost 1.65 2017-10-20 15:55:23 +01:00
karenzshea
b5f9ba63d5 add code of conduct 2017-10-20 15:55:05 +01:00
Daniel J. Hofmann
a3c0f6a4e2 Adds exception for barrier=lift_gate (bike, walk), resolves #4490 2017-10-19 15:27:35 +01:00
David Audrain
963c042b2a Run scripts/format.sh 2017-10-19 15:26:37 +01:00
David Audrain
1be7dedda7 Set missing OSM Node ID to zero instead of SPECIAL NODE ID 2017-10-19 15:26:37 +01:00
David Audrain
493a9a1cb2 Add 'to' and 'from' OSM Node Ids in the result of nearest webservice. #2548 2017-10-19 15:26:37 +01:00
Denis Koronchik
e1149bd4b7 Review fixes 2017-10-19 15:18:25 +01:00
Denis Koronchik
895f072425 Work on forward/backward ref's support 2017-10-19 15:18:25 +01:00
Moritz Kobitzsch
37774a331a fix collapsing into uturns, that aren't u-turns 2017-10-17 15:08:29 +01:00
Moritz Kobitzsch
8719821363 test-case illustrating changes to collapsing 2017-10-17 15:08:29 +01:00
Patrick Niklaus
0cc4c4380a Fix wrong corefactor warning, fixes #4615 2017-10-17 14:02:10 +00:00
Denis Koronchik
553310fb31 Fix gcc5 compilation error 2017-10-17 14:51:39 +01:00
Patrick Niklaus
404c275101 Add a specilization for contraction without exclude flags
This saves about 10% overhead and avoids contraction changes
to previous releases.
2017-10-17 12:09:00 +01:00
Michael Krasnyk
088d4edc6b Prevent merging of circular-shaped roads 2017-10-17 11:27:09 +02:00
Michael Krasnyk
bf03dcd1e6 Test case of merging roundabout-like intersections 2017-10-17 11:27:09 +02:00
Patrick Niklaus
456b198702 Remove unused number of threads option again 2017-10-16 23:08:32 +02:00
Patrick Niklaus
dc81c7b926 [skip ci] Changelog polish for release 2017-10-16 13:06:09 +00:00
Patrick Niklaus
90b3be8d10 Fix formating 2017-10-16 13:40:02 +01:00
Patrick Niklaus
ba2a2ff5e8 Remove RemoveIterator because its dangerous 2017-10-16 13:40:02 +01:00
Patrick Niklaus
9b87b8b7b1 Replace deallocation vector with std::vector and different merge algorithm 2017-10-16 13:40:02 +01:00
Patrick Niklaus
69db219423 Remove unused definition in contractor 2017-10-16 13:40:02 +01:00
Denis Koronchik
17ac731772 Review fixes 2017-10-16 12:15:12 +01:00
Denis Koronchik
b6db39e69c Update documentation 2017-10-16 12:15:12 +01:00
Denis Koronchik
d22b37961f Comment some tests of cardinal directions that not supported yet 2017-10-16 12:15:12 +01:00
Denis Koronchik
f9c7e1e55e Support route relation tests 2017-10-16 12:15:12 +01:00
Denis Koronchik
4b8daac104 Fix formatting 2017-10-16 12:15:12 +01:00
Denis Koronchik
4e5f74aebe Fix after merge 2017-10-16 12:15:12 +01:00
Daniel Patterson
6b357a7783 Test cases for route relation cardinal directions. 2017-10-16 12:15:12 +01:00
Denis Koronchik
fc9a89ea8b Support some cases for supperrelations in car.lua 2017-10-16 12:15:12 +01:00
Denis Koronchik
832cdbf566 Some fixes 2017-10-16 12:15:12 +01:00
Denis Koronchik
0dfec13c0a Fix some problems 2017-10-16 12:15:12 +01:00
Denis Koronchik
a2b8698bca Restore route relations support 2017-10-16 12:15:12 +01:00
Denis Koronchik
c42e247d87 Work on relation extract refactoring to support recursive relations (superrelations) 2017-10-16 12:15:12 +01:00
Daniel Patterson
7851de9af8 Update changelog. 2017-10-16 12:15:12 +01:00
Denis Koronchik
3fd961a551 Some improvements in code 2017-10-16 12:15:12 +01:00
Denis Koronchik
3634aa9a3c Add test for route relation process in car.lua. Some fixes 2017-10-16 12:15:12 +01:00
Denis Koronchik
a05e9c4932 Fix bug with simple refs support (not lists) 2017-10-16 12:15:12 +01:00
Denis Koronchik
5fd77aebb5 Add route relation support for multi ref's 2017-10-16 12:15:12 +01:00
Denis Koronchik
9a660e3c18 Implement route relation parse in car.lua 2017-10-16 12:15:12 +01:00
Michael Krasnyk
1d4c5b2e4d Remove prefix v in pkg-config version string 2017-10-16 10:25:17 +01:00
vng
c718f140fa Fixed c/p typo. 2017-10-14 15:05:26 +02:00
karenzshea
1b819bfcc3 add corech deprecation to changelog 2017-10-13 14:53:49 +01:00
karenzshea
e385f6352e restore libosrm interface for corech, fallback to ch 2017-10-13 14:53:49 +01:00
karenzshea
4f3414c4cc remove core factor opt from exclude graph 2017-10-13 14:53:49 +01:00
karenzshea
df79b5b4cc deprecation notices 2017-10-13 14:53:49 +01:00
karenzshea
2d1ea7a3de template specialization 2017-10-13 14:53:49 +01:00
karenzshea
2a13f9d10b fallback to CH, when coreCH used 2017-10-13 14:53:49 +01:00
karenzshea
7cf7c46939 remove level-cache flags 2017-10-13 14:53:49 +01:00
Denis Koronchik
031ce72db1 Fix issue #4214 2017-10-12 18:00:38 +01:00
Emil Tin
fe8a2251cd add missing semicolon 2017-10-12 17:22:00 +01:00
Emil Tin
59f8330db4 update cache mechanism to handle forced profile 2017-10-12 17:22:00 +01:00
Emil Tin
999211ed9c set OSRM_PROFILE to force profile when running cuke tests 2017-10-12 17:22:00 +01:00
Daniel J. Hofmann
dba825d829 Fixes readme contract mixup 2017-10-12 17:21:35 +01:00
Daniel J. Hofmann
ee6e7dab3b Removes stxxl from installation instruction in readme 2017-10-12 17:21:35 +01:00
Daniel J. Hofmann
2a51ce131b Removes duplicate pipeline explanation from readme 2017-10-12 17:21:35 +01:00
Daniel J. Hofmann
7ce3ffd3cc Explains the MLD pipeline in the readme 2017-10-12 17:21:35 +01:00
Michael Krasnyk
40d9aec71f Show MLD cell IDs via node ID text background color 2017-10-12 14:27:55 +01:00
Michael Krasnyk
d405331447 Increase coverage of MLD many-to-many code 2017-10-12 14:27:55 +01:00
Michael Krasnyk
e781e06a17 Use -O0 optimization level for coverage builds 2017-10-12 14:27:55 +01:00
Michael Krasnyk
33742532f6 Run lcov before uploading to codecov 2017-10-12 14:27:55 +01:00
Michael Krasnyk
f2fbe16979 Use for M*n (m*N) tables queries forward (backward) MLD search 2017-10-11 16:28:16 +01:00
Michael Krasnyk
5af05631c2 Suppress relaxation of edges on the top level during backward steps 2017-10-11 16:28:16 +01:00
Michael Krasnyk
8300a6c57e Prepare phantom nodes indices in ManyToManySearch search 2017-10-11 16:28:16 +01:00
Michael Krasnyk
29d4bca9ba Split algorithm-specific manyToMany implementations 2017-10-11 16:28:16 +01:00
Moritz Kobitzsch
fd52c80573 remove workaround, reduce memory consumption in lcs computation 2017-10-11 14:07:35 +02:00
Moritz Kobitzsch
74e1d1c27a fix pedantic warning about additional ; 2017-10-11 14:07:35 +02:00
Moritz Kobitzsch
884ce4025b fix detection of suffix/prefix changes for name-changes 2017-10-11 14:07:35 +02:00
Moritz Kobitzsch
2ddd98ee6d simplify passing annotation data through OSRM pipeline using the node-based datastore
- separates node-based graph creation and compression from edge-based graph creation
 - moves usage of edge-based node data-container to pre-processing as well, unifying access to node-based data
 - single struct instead of separate vectors for annotation data in engine (single place of modification)
2017-10-09 18:44:43 +02:00
Frédéric Rodrigo
9b044aaa42 Add literal maxspeed value for NO, PL and ZA on maxspeed_table in car profile 2017-10-09 15:48:14 +01:00
Frédéric Rodrigo
fe88d7fcd1 Sort maxspeed_table in car profile 2017-10-09 15:48:14 +01:00
karenzshea
7923fdcaef error when mld files or data are missing, compability -> compatibility 2017-10-09 16:36:38 +02:00
Michael Krasnyk
837dba2191 Don't use sliproad scenario if two name announcements are required 2017-10-09 15:35:26 +01:00
Michael Krasnyk
a7ea6e5327 Allow a single intersection in a cross-road of sliproads, #4348/3 2017-10-09 15:35:26 +01:00
Michael Krasnyk
38ab22ee7c Sliproad case with a single intersection in a cross-road 2017-10-09 15:35:26 +01:00
Michael Krasnyk
7f8e467523 Adjust lower bound for crossroad angle in sliproads handler, #4348/2 2017-10-09 15:35:26 +01:00
Michael Krasnyk
fbb2970044 Merge unused 3 bits of PhantomNode into bearing
to prevent memcheck  reports
==23434== Use of uninitialised value of size 8
==23434==    at 0x15CAFB5: boost::archive::iterators::detail::from_6_bit<char>::operator()(char) const (base64_from_binary.hpp:50)
==23434==    by 0x15CB6BE: boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>::dereference() const (transform_iterator.hpp:126)
==23434==    by 0x15CB6CE: boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>::reference boost::iterators::iterator_core_access::dereference<boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default> >(boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default> const&) (iterator_facade.hpp:550)
==23434==    by 0x15CB6E2: boost::iterators::detail::iterator_facade_base<boost::iterators::transform_iterator<boost::archive::iterators::detail::from_6_bit<char>, boost::archive::iterators::transform_width<char const*, 6, 8, char>, boost::iterators::use_default, boost::iterators::use_default>, char, boost::iterators::single_pass_traversal_tag, char, long, false, false>::operator*() const (iterator_facade.hpp:656)
==23434==    by 0x15CB7F4: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::input_iterator_tag) (basic_string.tcc:190)
==23434==    by 0x15CB89F: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct_aux<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::__false_type) (basic_string.h:196)
==23434==    by 0x15CB91B: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char> >(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>) (basic_string.h:215)
==23434==    by 0x15CB9AA: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, void>(boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<char const*, 6, 8, char>, char>, std::allocator<char> const&) (basic_string.h:552)
==23434==    by 0x15CBB0F: osrm::engine::encodeBase64[abi:cxx11](unsigned char const*, unsigned long) (base64.hpp:65)
==23434==    by 0x15CBC01: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > osrm::engine::encodeBase64Bytewise<osrm::engine::Hint>(osrm::engine::Hint const&) (base64.hpp:94)
==23434==    by 0x15CBC45: osrm::engine::Hint::ToBase64[abi:cxx11]() const (hint.cpp:30)
==23434==    by 0x16596DC: osrm::engine::api::json::makeWaypoint(osrm::util::Coordinate, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osrm::engine::Hint const&) (json_factory.cpp:359)
2017-10-09 15:31:59 +01:00
Patrick Niklaus
d23a5fcfc4 Update package-lock and yarn.lock 2017-10-05 17:14:17 +01:00
Patrick Niklaus
db83b186cf Bump version number post-release 2017-10-05 17:14:17 +01:00
Daniel Patterson
7d9b17fd41 Build against libstdc++-4.9 and supress one libstdc++ symbol so that we can run inside
old environments (CentOS, AWS Linux, AWS Lambda, etc)
2017-10-05 17:13:40 +01:00
Michael Krasnyk
a900f5229e Fix case for sliproads from link via link to primary, #4348/4 2017-10-04 23:23:55 +02:00
Michael Krasnyk
de72a8adb6 Test case for sliproads from link via link to primary, #4348/4 2017-10-04 23:23:55 +02:00
Michael Krasnyk
5010084fb0 [skip ci] Update CHANGELOG.md 2017-10-04 15:02:03 +02:00
Michael Krasnyk
11e7b6e911 Add last location memoization in Lua context 2017-10-04 10:03:42 +02:00
Michael Krasnyk
545097cf06 Don't use location cache if not needed 2017-10-04 10:03:42 +02:00
Michael Krasnyk
476bc347b4 Allow multiple GeoJSON files with locations data 2017-10-04 10:03:42 +02:00
Michael Krasnyk
095b345713 Change location data method to way:get_location_tags(key) 2017-10-04 10:03:42 +02:00
Michael Krasnyk
0f498d13f5 Access to location dependent data in Lua via way:get_location_tags() 2017-10-04 10:03:42 +02:00
Michael Krasnyk
2059f7234a Restructure ParseOSMData method 2017-10-04 10:03:42 +02:00
Michael Krasnyk
12b2242ad5 Add osmium locations cache 2017-10-04 10:03:42 +02:00
Michael Krasnyk
fec2b602a2 Bump api_version to 3 in car.lua 2017-10-04 10:03:42 +02:00
Michael Krasnyk
a7c1967ca0 Use correct bounding box
For some reason
envelop = make_inverse<box_t>();
boost::geometry::expand(envelop, next);
normalizes longitude to [-180,180]
2017-10-04 10:03:42 +02:00
Michael Krasnyk
20ff138f08 Remove polygon copying overhead 2017-10-04 10:03:42 +02:00
Michael Krasnyk
421115200b Port osmium point-in-polygon function 2017-10-04 10:03:42 +02:00
Michael Krasnyk
b15288e0ea Add location_dependent_data unit tests 2017-10-04 10:03:42 +02:00
Michael Krasnyk
4eac861eae Left-hand driving flag review updates 2017-10-04 10:03:42 +02:00
Michael Krasnyk
7ad9e13f1e Add MultiPolygon support 2017-10-04 10:03:42 +02:00
Michael Krasnyk
fc39e0ce1a Allow multiple GeoJSON files 2017-10-04 10:03:42 +02:00
Michael Krasnyk
fb02a4c674 Added bit packing for serialization of vector<bool> 2017-10-04 10:03:42 +02:00
Michael Krasnyk
6468f55627 Make class_names default initialized 2017-10-04 10:03:42 +02:00
Michael Krasnyk
f40b7975f2 Change from rtree.q{begin,end} to rtree.query (Boost 1.55 support) 2017-10-04 10:03:42 +02:00
Michael Krasnyk
55a38c9e01 Add tests to check local side-dependent turn bias 2017-10-04 10:03:42 +02:00
Michael Krasnyk
3c399e5c28 Propagate is_left_hand_driving from profile to data facade 2017-10-04 10:03:42 +02:00
Michael Krasnyk
fca00fa09e Added approaches tests for left-hand driving 2017-10-04 10:03:42 +02:00
Michael Krasnyk
de942155bf Add local left_hand_driving flag in API version 2 2017-10-04 10:03:42 +02:00
Michael Krasnyk
af3f0a4782 Use driving_side tag of location-dependent data and OSM ways 2017-10-04 10:03:42 +02:00
Michael Krasnyk
c9673741de Added location dependent data 2017-10-04 10:03:42 +02:00
Michael Krasnyk
9a482ff828 Show better error messages in options tests 2017-10-04 10:03:42 +02:00
Michael Krasnyk
020c17d19a Remove unused packed path weights in MLD alternatives 2017-10-03 13:09:46 +02:00
Michael Krasnyk
d0936dc7fd Don't force loops in MLD
Related commit 0972ec9115
2017-10-03 12:56:50 +02:00
Michael Krasnyk
708b47938d Enable MLD alternatives tests 2017-10-03 12:56:50 +02:00
Jack Danger
79d07ef45c Updating year on all 'Project OSRM' copyrights 2017-10-03 12:03:26 +02:00
Jack Danger
5d33a387e0 Update LICENSE to 2017 and fix typo in filename 2017-10-03 12:03:26 +02:00
Frédéric Rodrigo
b3b6e16940 Fix check_taginfo.py test for maxspeed tag in lower case 2017-09-30 22:16:51 +02:00
Frédéric Rodrigo
f9fb0b84a8 Fix case of maxspeed tag values into taginfo.json 2017-09-30 22:16:51 +02:00
Frédéric Rodrigo
83acb46390 Add missing maxspeed tags into taginfo.json 2017-09-30 22:16:51 +02:00
Frédéric Rodrigo
f36b3fb4bc Add to car profile missing BE:motorway maxspeed_table exceptions osm-fr/osmose-backend#232 2017-09-30 22:16:51 +02:00
Michael Krasnyk
e7be271c43 Optimize MLD one-to-many getNodeQueryLevel 2017-09-29 13:38:52 +02:00
Michael Krasnyk
790b574114 unordered_multimap compilation fixes 2017-09-29 13:38:52 +02:00
Michael Krasnyk
b3f59ab92c Move duplicated code into insert_node lambda 2017-09-29 13:38:52 +02:00
Michael Krasnyk
f2333eb31a Break tie for equal weights but different durations
There is no possibility until multiple-weights are implemented
to break tie in the contraction and the direct shortest path plugin
as duration is not computed during contraction.

This must be fixed after multiple-weights implementation
by using `std::tie(weight, duration)` pairs everywhere.
2017-09-29 13:38:52 +02:00
Michael Krasnyk
a862e5fb3a Implement one-to-many unidirectional MLD search 2017-09-29 13:38:52 +02:00
Michael Krasnyk
2715e5758b Split MLD many-to-many method 2017-09-29 13:38:52 +02:00
Michael Krasnyk
454487dd41 Refactor to reuse relaxOutgoingEdges in many-to-many plugin 2017-09-29 13:38:52 +02:00
Michael Krasnyk
2ed4f6eb0c Add suppression of libtbb memory leaks checking 2017-09-28 12:35:27 +02:00
Daniel J. Hofmann
d7bcafcb59 Uses parsed len(turn:lanes) to fixup number of lanes, resolves #4472 2017-09-28 00:24:14 +02:00
Marcel Radischat
c37a8ddd83 Update README.md with Docker+Node.js example 2017-09-26 09:16:59 +02:00
Michael Krasnyk
fc3f96abcb Use pkg-config to find lua in non-standard locations 2017-09-26 09:03:57 +02:00
Michael Krasnyk
c37ea441fc Bump osrm-deps package version 2017-09-25 12:26:47 +02:00
Michael Krasnyk
fa1a4e8bf6 Relax strict bearings ordering condition to non-strict one, #4331 2017-09-18 21:33:00 +02:00
Michael Krasnyk
2532d56b85 Turn angle calculation needs to respect initial road order, #4331 2017-09-18 21:33:00 +02:00
Michael Krasnyk
00fd869224 Test for turn angle calculation the initial road order breaking, #4331 2017-09-18 21:33:00 +02:00
Michael Krasnyk
5661726e2e Add feature tests for distance weights in foot and bicycle profiles 2017-09-18 16:40:51 +02:00
Michael Krasnyk
cfa5d7e172 Add support of distance in foot and bicycle profiles 2017-09-18 16:40:51 +02:00
Michael Krasnyk
fd7791a0e2 Fix gcc5 compilation
Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77786
2017-09-15 16:29:40 +02:00
Michael Krasnyk
e32b8bae00 Make unbuffered log verbosity aware 2017-09-15 15:01:17 +02:00
Michael Krasnyk
966139cde9 Adjust number of threads in osrm-routed 2017-09-15 10:55:13 +02:00
Michael Krasnyk
ee19383f4d Link TBB task_scheduler lifetime with Engine scope 2017-09-15 10:55:13 +02:00
Michael Krasnyk
172a8bdcdb Parallelize ManyToMany plugin 2017-09-15 10:55:13 +02:00
Michael Krasnyk
543048efcc Remove std::unordered_map<NodeID, std::vector<NodeBucket>> 2017-09-15 10:55:13 +02:00
Michael Krasnyk
67c85ffa4c Restructure manyToManySearch for parallelization 2017-09-15 10:55:13 +02:00
Michael Krasnyk
c065335882 [skip ci] Moved support relations entry in change log 2017-09-14 20:00:05 +02:00
Michael Krasnyk
f6313fcbfb Bump CMake version to 3.9.2 2017-09-14 20:00:05 +02:00
Michael Krasnyk
6a3ea876b5 Fix EOL value in libosmium opl script 2017-09-14 20:00:05 +02:00
Michael Krasnyk
64ad308e9d Small ProcessElements refactoring 2017-09-14 20:00:05 +02:00
Michael Krasnyk
94169a20de Remove RelationsContainerWrap 2017-09-14 20:00:05 +02:00
Michael Krasnyk
5ca38eee3a Remove RelationMemberWrap and avoid data copying 2017-09-14 20:00:05 +02:00
Michael Krasnyk
f4f65f62ee Remove Lua 5.1 support 2017-09-14 20:00:05 +02:00
Michael Krasnyk
f89ada7f61 Remove ExtractionRelationData wraper 2017-09-14 20:00:05 +02:00
Denis Koronchik
ff3b398e23 Review fixes 2017-09-14 20:00:05 +02:00
Denis Koronchik
84cb7865ab Fix different compilers support 2017-09-14 20:00:05 +02:00
Denis Koronchik
75bdf114be Review fixes 2017-09-14 20:00:05 +02:00
Denis Koronchik
c2fd64d3cc Apply clang format 2017-09-14 20:00:05 +02:00
Denis Koronchik
580c5e39ae Fix some tests and add new ones 2017-09-14 20:00:05 +02:00
Denis Koronchik
8da6281dcd Update LUA profiles documentation 2017-09-14 20:00:05 +02:00
Denis Koronchik
f79bcc6b8d Pass relation data to way and node functions 2017-09-14 20:00:05 +02:00
Denis Koronchik
f2b63ba0aa LUA binding for a relation processing 2017-09-14 20:00:05 +02:00
Denis Koronchik
a253111cbe Add ExtractionRelation class 2017-09-14 20:00:05 +02:00
Michael Krasnyk
a5776288f6 Add dk:rural to taginfo.json 2017-09-14 08:03:18 +02:00
Mateusz Loskot
dbcf4cab16 Replace GCC/clang option -std=C++1y with -std=C++14 2017-09-13 13:01:23 +02:00
Frédéric Rodrigo
4ea3f33376 Add to car profile missing DK:rural maxspeed_table exceptions osm-fr/osmose-backend#174 (#4488) 2017-09-08 11:36:06 -07:00
Daniel Patterson
e4cdfb50cd
Reset changelog for new release cycle. 2017-09-07 22:16:10 -07:00
Moritz Kobitzsch
c2dc7e9cd0 use enter + exit for roundabout instructions (#4358)
* Expose roundabout/rotary exit instructions as a new instruction type.
2017-09-05 12:30:34 -07:00
Daniel Patterson
0fc1aa2711 Adds turn instructions to the turns layer in debug tiles. (#4460)
Add turn types and modifiers to turn points in debug tiles.  Also refactor some of the tile code to reduce some repetition.
2017-09-01 15:08:22 -07:00
Patrick Niklaus
89cf6d9e74 Disable alternative loop test since it does not test consistent behavior 2017-09-01 21:26:00 +02:00
Patrick Niklaus
61c430c098 Implement exclude flags on CH using shared core
The core is fully contracted for each exclude flag
and stored in a merged graph data structure.
2017-09-01 21:26:00 +02:00
Patrick Niklaus
4b75cb8b0e Make DynamicGraph copyable 2017-09-01 21:26:00 +02:00
Patrick Niklaus
53f87c08b5 Rename GraphView -> BisectionGraphView to avoid name conflicts 2017-09-01 21:26:00 +02:00
Patrick Niklaus
e23dc8977f Refactor contract to be a stateless function 2017-09-01 21:26:00 +02:00
Patrick Niklaus
421dc5b6ec Don't return edge list in contractor but modify graph in-place 2017-09-01 21:26:00 +02:00
Patrick Niklaus
247f1c120f Make renumbering transparent to contraction 2017-09-01 21:26:00 +02:00
Patrick Niklaus
e011c60e12 Replace flush in contract with in-place renumbering 2017-09-01 21:26:00 +02:00
Patrick Niklaus
26c909b64b Refactor contractor to pass in graph directly 2017-09-01 21:26:00 +02:00
Daniel Patterson
acb7916996 Add test case with valid junk.
Use eps to explicitly match empty string and not consume input
2017-09-01 08:34:58 -07:00
Daniel Patterson
40b5045a0a Update CHANGELOG 2017-09-01 08:34:58 -07:00
Daniel Patterson
b17f40862c If traffic CSV has an empty 4th column, preserve the weight on an edge while updating the duration. 2017-09-01 08:34:58 -07:00
Lev Dragunov
7702ebde61 Test fixes 2017-08-31 11:11:05 +02:00
Lev Dragunov
6951eadc18 CI fix 2017-08-31 11:11:05 +02:00
Lev Dragunov
cf2573157f clang-format with older version 2017-08-31 11:11:05 +02:00
Lev Dragunov
80c55119d2 Add bearing for the phantom node 2017-08-31 11:11:05 +02:00
Mateusz Loskot
7323221e3b Add --verbosity,-l command line option
Allow to fine-control logging verbosity via command line
and LogPolicy setting (useful when OSRM used as library).

Closes #4299
2017-08-31 00:35:23 +02:00
Mateusz Loskot
fb5bd818d9 CanMergeRoad missed test of rhs instance of IntersectionShapeData
Avoids identical sub-expressions road_target(lhs) == intersection_node
2017-08-31 00:34:28 +02:00
Mateusz Loskot
43a4e8db12 Use user-provided osmium:🧵:Pool instance
Advantages:
* Allows to use Pool configured with user-preferred number of threads.
* If libosmium used in a shared library, this helps to prevent potential
  deadlock during Pool shutdown at (after) shared library unloading.

See https://github.com/osmcode/libosmium/pull/214

Requires libosmium 2.13.0
2017-08-31 00:34:09 +02:00
Mateusz Loskot
302390696e Remove repeated sub-expression for TurnType::Suppressed test 2017-08-31 00:33:00 +02:00
Michael Krasnyk
2508629d6c Minor fixes in Timezoner 2017-08-30 19:44:52 +02:00
Patrick Niklaus
90c390d7a6 Merge pull request #4455 from mloskot/ml/fix-short-options
Remove superfluous hyphen from short form of --version in tests
2017-08-30 18:30:45 +02:00
Patrick Niklaus
28178b12c7 Merge pull request #4456 from Project-OSRM/update/libosmium
Update libosmium to 2.13
2017-08-30 18:30:25 +02:00
Patrick Niklaus
6eb4f090f9 Squashed 'third_party/libosmium/' content from commit ce865381f
git-subtree-dir: third_party/libosmium
git-subtree-split: ce865381fb752323ff1e66181f5a49b7f500ffa3
2017-08-30 09:30:27 +00:00
Patrick Niklaus
95442d45aa Merge commit '6eb4f090f98f6b17a23c57768c16b7716b6c9cbd' as 'third_party/libosmium' 2017-08-30 09:30:27 +00:00
Patrick Niklaus
b4ad6588ed Remove old libosmium 2017-08-30 09:30:18 +00:00
Patrick Niklaus
56282b0e3f Bump libosmium version 2017-08-30 09:28:41 +00:00
Mateusz Loskot
2385602500 Switch to reliable non-existent handle for QueryHeap items.
Default-constructed objects of (boost::heap) handle_type are singular,
including the wrapped handle_type::iterator.
Apparently, MSVC iterator debug facilities strictly require that
one singular instance is compared to another singular instance.
It is not possible to get check-comparabe iterators of non-singular
and singular instances as owning container will always mismatch.
2017-08-30 10:59:43 +02:00
Mateusz Loskot
628a154d7f Remove superfluous hyphen from short form of --version in tests 2017-08-30 10:09:12 +02:00
Daniel J. Hofmann
efaed59b9b Whitelists scripts/node_install.sh for from-source compilation, resolves #4431 2017-08-28 19:08:36 -04:00
Daniel Patterson
bdee13dea8 We should be using the module-relative @loader_path. @executable_path is relative to the main node process binary 2017-08-25 15:30:49 -07:00
Daniel Patterson
c615910874 Don't use Travis' node environment, we create our own. 2017-08-25 13:46:29 -07:00
Daniel Patterson
9e1398c68a Enable OSX binary publishing for both NodeJS 4 and NodeJS 6 2017-08-25 13:46:29 -07:00
Denis Koronchik
af10692d2d Fix misprint in documentation 2017-08-23 17:05:24 +02:00
Denis Koronchik
e7abe37b10 Prevent linkage errors when load/write extracted graph from external app 2017-08-22 15:46:06 +02:00
Patrick Niklaus
bc8617a9f4 Fix remaining PR comments 2017-08-21 13:00:12 +02:00
Patrick Niklaus
00e243b23b Refactor CustomizeCell::RelaxNode to move level check inside function 2017-08-21 13:00:12 +02:00
Patrick Niklaus
27324d0270 Add more tests for exclude validation 2017-08-21 13:00:12 +02:00
Patrick Niklaus
0c838fb60c Fix turnbot profile 2017-08-21 13:00:12 +02:00
Patrick Niklaus
0713ef5862 Add test cases for exclude and table/match service 2017-08-21 13:00:12 +02:00
Patrick Niklaus
bee1ba8854 Fix profile docs 2017-08-21 13:00:12 +02:00
Patrick Niklaus
da252c7597 Add node binding integration 2017-08-21 13:00:12 +02:00
Patrick Niklaus
a4460abc83 Fix another manifestation of the off-by-one 2017-08-21 13:00:12 +02:00
Patrick Niklaus
261636febb Add HTTP docs 2017-08-21 13:00:12 +02:00
Patrick Niklaus
21f15f0a29 Add docs for lua profiles 2017-08-21 13:00:12 +02:00
Patrick Niklaus
bd068ff2a6 Add changelog entries for exclude flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus
d09f5c0e3a Avoid -> Exclude 2017-08-21 13:00:12 +02:00
Patrick Niklaus
45140ca9f7 Fix off-by-one in avoid search 2017-08-21 13:00:12 +02:00
Patrick Niklaus
c6be2e768a Throw an error for invalid classes 2017-08-21 13:00:12 +02:00
Patrick Niklaus
6339395cba Fix clang format 2017-08-21 13:00:12 +02:00
Patrick Niklaus
bd6492bb38 Fix compilation after rebase 2017-08-21 13:00:12 +02:00
Patrick Niklaus
f93b331817 Add error handling for avoid not implemented 2017-08-21 13:00:12 +02:00
Patrick Niklaus
20e4096c4b Fix stupid vector size bug 2017-08-21 13:00:12 +02:00
Patrick Niklaus
97952a9289 Don't snap to avoided streets 2017-08-21 13:00:12 +02:00
Patrick Niklaus
960a595268 Add test for avoid flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus
a3c94ef632 Avoid nodes that are disabled by an avoid flag 2017-08-21 13:00:12 +02:00
Patrick Niklaus
84fd38ac9c Add tests for avoid flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus
303a8fae32 Refactor cell weights and durations to own file and allow for multiple metrics 2017-08-21 13:00:12 +02:00
Patrick Niklaus
21686ee8a9 Add datafacade factory to select avoid flags 2017-08-21 13:00:12 +02:00
Patrick Niklaus
c8b142a676 Add placeholders for up to 8 weights 2017-08-21 13:00:12 +02:00
Patrick Niklaus
58061a68c4 Add avoid parameter to the API 2017-08-21 13:00:12 +02:00
Patrick Niklaus
9c11197768 Extract avoidable combinations from profiles into ProfileProperties 2017-08-21 13:00:12 +02:00
Moritz Kobitzsch
f347efb006 detect turning onto oneways at the end of the road as non obvious 2017-08-18 16:33:11 +02:00
Moritz Kobitzsch
af8ddac2af add test-case illustrating changes to obvious turn discovery 2017-08-18 16:33:11 +02:00
Michael Krasnyk
b1358de9bb Use TBB parallel sort of CSV entries, #4418 2017-08-18 14:37:42 +02:00
Daniel Patterson
f4dc93ae66
[skip ci] Reset master versions for next release 2017-08-17 15:06:48 -07:00
Frédéric Rodrigo
20a77f6d51 Car Profile. Remove the non common use barrier=checkpoint as the right tag is military=checkpoint and does not need to be whitelisted. #4405 2017-08-17 14:27:04 +02:00
Daniel Patterson
c1ad275e71 Empty CSV entries (nodeA,nodeA) can be treated as non-fatal as long as we don't try to update any matching artificial segments. 2017-08-16 12:03:23 -07:00
Daniel J. Hofmann
6bae070091 Fixes changelog wrt. conditional via-way restrictions 2017-08-16 11:15:35 +02:00
Moritz Kobitzsch
3687b6cb4b respect difference between continue/turn on changing end-of-road 2017-08-16 09:19:15 +02:00
Moritz Kobitzsch
196ed9eb46 do not change fork directions when combining turns 2017-08-16 09:17:01 +02:00
Daniel Patterson
37c941dff3
Bump version for 5.11.0-rc.2 2017-08-15 12:14:13 -07:00
Daniel Patterson
40a428d49f
Fix changelog - binaries weren't published for 5.10 2017-08-15 12:13:20 -07:00
Daniel Patterson
48eeef2d30 Revert "Publicly expose binaries to Node.js bindings, resolves #4377"
This reverts commit 4686272f87.

Unfortunately, this doesn't work alongside `node-pre-gyp` - in fresh installs, the binary
files are not yet downloaded when npm tries to create symlinks, leading to an error.
2017-08-15 11:55:09 -07:00
Moritz Kobitzsch
c34520f3a4 add feature to test naming conventions on divided highways 2017-08-15 09:47:13 +02:00
Daniel Patterson
36db965c39
Update npm version for RC.1 2017-08-14 17:16:45 -07:00
Daniel Patterson
4e81764ce2
Update CHANGELOG for changes since 5.10 2017-08-14 17:16:05 -07:00
Michael Krasnyk
1e9f983289 Add mocked offline datafacade to engine tests 2017-08-14 16:18:36 +02:00
Michael Krasnyk
2e404c60f4 Remove references to external sources 2017-08-14 16:18:36 +02:00
vng
40857aae61 Inject offline compressed data facade with OSRM_EXTERNAL_MEMORY option. 2017-08-14 16:18:36 +02:00
vng
a64145b712 Fixed mld algorithm to use template data facade. 2017-08-14 16:18:36 +02:00
vng
945f6da85e Removed useless include. 2017-08-14 16:18:36 +02:00
vng
76d5d054cb Compilation fix. 2017-08-14 16:18:36 +02:00
Michael Krasnyk
20cfa159ec Fix boost::optional construction error 2017-08-11 17:32:35 +02:00
Daniel J. Hofmann
3ff1a4263d Adds releasing docs about bumping to latest, see #4386 2017-08-11 15:53:14 +02:00
Patrick Niklaus
3141eb5dce [skip ci] Update CONTRIBUTING.md to include correct pre-commit hook 2017-08-11 10:06:07 +00:00
Daniel J. Hofmann
75d6f59026 Publicly expose binaries to Node.js bindings, resolves #4377 2017-08-11 12:04:53 +02:00
Daniel J. Hofmann
ae42ce7017 [skip ci] Updates lockfile for latest master version 2017-08-11 12:04:53 +02:00
Moritz Kobitzsch
e9c9c87bbc adjust geojson logger to changes in extractor 2017-08-11 12:03:40 +02:00
Michael Krasnyk
8a6dba46b1 Change windows time zones in West Africa to WAT zone 2017-08-11 11:53:25 +02:00
Moritz Kobitzsch
93299d6651 handle conditional via-way restrictions
- refactor conditional restriction handling to not use external data (first OSM nodes on ways)
 - BREAKING: changes internal file format of osrm.restrictions
 - add support for general conditional penalties based on edge-based nodes (requires unique edges between nodes)
2017-08-11 11:53:25 +02:00
vng
f34320a89b Fixed getting entry bearing for maneuver. 2017-08-11 11:40:58 +02:00
Moritz Kobitzsch
a17b07bc4c fix bug in conflict resolution 2017-08-11 11:01:54 +02:00
Moritz Kobitzsch
3a01ba52ef remove a few tests that are simply testing same code paths as others 2017-08-10 12:28:31 +02:00
Mateusz Loskot
d796c66990 Prefer implicit expansion of CMake variables
Unify CMAKE_CXX_COMPILER_ID tests without quoting/bracketing
the variable to use implicit expansion.
Replace STREQUAL with MATCHES to avoid policy warning about
attempt to expand "MSVC" variable, where it literal is intended.
2017-08-10 12:26:48 +02:00
Mateusz Loskot
80b705e997 Add workaround for Visual C++ issue with std::array in debug
If Visual C++ _ITERATOR_DEBUG_LEVEL > 0, then
accessing std::array<char[N], M> elements via reference to const
causes compilation error:

...\msvc\14.10.25017\include\array(181): error C2440: 'return': cannot convert from 'const char *' to 'const char (&)[256]'

Alternative workaround is to remove const qualifier from the GetClassName method.
2017-08-10 12:21:42 +02:00
Moritz Kobitzsch
7069af3e20 explicitly use local eslint version for linting 2017-08-09 14:14:44 +02:00
Daniel J. Hofmann
209a926b45 Re-adds .npmignore, resolves #4193 2017-08-08 16:16:35 +02:00
Mateusz Loskot
71e0c7a3cf Add define WIN32_LEAN_AND_MEAN for Visual C++
Helps to avoid compiler C2011 errors due to WinSock types redefinition
from dual #include of winsock.h and winsock2.h
2017-08-08 15:50:47 +02:00
Daniel J. Hofmann
b88d96f07d [skip ci] Updates lockfiles 2017-08-08 11:37:20 +02:00
Daniel J. Hofmann
46f75c3d92 [skip ci] Bumps version to 5.11 2017-08-08 11:37:20 +02:00
Mateusz Loskot
3b8e5cec88 Ignore build directories starting with _build
Convenient to manage multiple builds with basic
naming convention (eg. _build.gcc7, _build.vs2017).

[ci skip]
2017-08-08 11:14:39 +02:00
FILLAU Jean-Maxime
a420169109 Reintroduce location for NodeRef in luabinding 2017-08-08 10:59:25 +02:00
Michael Krasnyk
a8db269fd5 Adjust lower bound for crossroad angle in sliproads handler, #4348/2 2017-08-04 14:37:13 +02:00
Michael Krasnyk
a5efcfdede Sliproads test case with acute angle at the main intersection 2017-08-04 14:37:13 +02:00
Michael Krasnyk
1ecc913fc2 Fix sliproad scenario with 4 roads in a target intersection, #4348/1 2017-08-04 14:07:35 +02:00
Michael Krasnyk
08eb3b11bc Test case for sliproad handling with 4 roads at target intersection 2017-08-04 14:07:35 +02:00
Moritz Kobitzsch
b59d9a2f27 update test-case for changed turn angles 2017-08-04 12:57:55 +02:00
Moritz Kobitzsch
e9a5e32330 fix prevention of copy elision 2017-08-04 12:57:55 +02:00
Moritz Kobitzsch
be9bdfa47e adjust constants for changed turn angle 2017-08-04 11:20:31 +02:00
Moritz Kobitzsch
153e934ed4 shift circle angle a bit 2017-08-04 11:20:31 +02:00
Michael Krasnyk
4757c96d9a Add a check for non-empty segments in CSV speed files 2017-08-04 11:19:32 +02:00
Michael Krasnyk
1efc527281 Test with a traffic update on an edge with traffic signal 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch
468b59c53d add changelog entry for compression of traffic signals 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch
15426975b6 deduplicate geometry 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch
bbcf343e40 compress traffic signals
- handle penalties within edges (not phantom nodes)
 - changes model from providing penalties on turns to using additional segments
2017-08-04 11:19:32 +02:00
Moritz Kobitzsch
f0d3cf4e43 removing duplicated test 2017-08-04 11:19:32 +02:00
Moritz Kobitzsch
4c965b9f44 Add regression test for interaction between via-way and via-node 2017-08-03 14:37:05 +02:00
Moritz Kobitzsch
e5143247c2 move babel to dev dependencies, update releasing docs to reflect scripts in package.json 2017-08-03 14:31:41 +02:00
Daniel J. Hofmann
3a676183b2 Updates our node osrm docs and re-runs docs generation, resolves #4043 2017-08-03 14:31:41 +02:00
Daniel J. Hofmann
64265926a4 Adds babel transformation needed for node osrm docs 2017-08-03 14:31:41 +02:00
Michael Krasnyk
df2d4daad3 Fix gcc5 internal compilation error 2017-08-02 10:25:38 +02:00
Michael Krasnyk
fd0d79e17b Update pre-installed TBB version to 2017_U7 2017-08-02 10:25:38 +02:00
Moritz Kobitzsch
84ce97a31e Bump version to v5.10.0-rc.2 2017-08-01 12:30:31 +02:00
Moritz Kobitzsch
7e0c9f7340 remove accidental addition of debug code 2017-08-01 12:29:56 +02:00
Moritz Kobitzsch
917a36eaee fix pedantic warnings 2017-08-01 12:27:29 +02:00
Moritz Kobitzsch
7620d419c6 fix serialisation of conditional turn restrictions 2017-08-01 12:27:29 +02:00
Moritz Kobitzsch
50c90b29d2 parse conditional turn restriction with via way 2017-08-01 12:27:29 +02:00
Daniel Patterson
0e77cf53f6
Update CHANGELOG with bugfix notes. 2017-07-31 08:33:19 -07:00
Moritz Kobitzsch
9dfbae69cc [skip-ci] Bump version to v5.10.0-rc.1 2017-07-31 16:18:56 +02:00
Michael Krasnyk
c1ad4f6b45 Fix a single weekday grammar callback 2017-07-31 14:56:08 +02:00
Moritz Kobitzsch
8135f08958 restructure for review remarks 2017-07-31 09:36:25 +02:00
Moritz Kobitzsch
645b1ffd75 add testcases to highlight limitation of via-way handling 2017-07-31 09:36:25 +02:00
Moritz Kobitzsch
8d0202d240 Add data structure to allow identification of via-way turns during creation of edge-based-graph
initial version of handling via-way turn restrictions (this is dirty)

 - requires update of data structures
 - requires clean-up
 - requires optimisation
2017-07-31 09:36:25 +02:00
Moritz Kobitzsch
b1809d1667 pre-filter turn restrictions for validity 2017-07-31 09:36:25 +02:00
Moritz Kobitzsch
2e9a7d9c1a refactor restriction parsing / extraction to actual types
Makes turn restrictions into dedicated structures and diferentiates between them via a variant.
Ensures that we do not accidentally mess up ID types within our application.
In addition this improves the restriction performance by only parsing all edges
once at the cost of (at the time of writing) 22MB in terms of main memory usage.
2017-07-31 09:36:25 +02:00
Moritz Kobitzsch
1f7aa6f812 adding tests to highlight via-way-restriciton development 2017-07-31 09:36:25 +02:00
Patrick Niklaus
032a189440 Merge pull request #4352 from Project-OSRM/fix_reverse_datasources
Save both forward and reverse datasources.
2017-07-28 07:53:17 +00:00
Daniel Patterson
be5fc50136
Save both forward and reverse datasources. 2017-07-27 14:45:28 -07:00
Moritz Kobitzsch
0affec8f17 handle throughabouts -- do not announce going through 2017-07-26 10:37:20 +02:00
Daniel Patterson
8c9ae4d3b4 Update CHANGELOG. 2017-07-25 15:14:45 -06:00
Daniel Patterson
dac6bb27aa Don't include turn costs when calculation weight/duration/speed annotations. 2017-07-25 15:14:45 -06:00
Daniel J. Hofmann
6c0ab24100 Updates npm and yarn lockfiles 2017-07-24 13:15:15 +02:00
Michael Krasnyk
95c7832c3e Don't use STXXL library by default 2017-07-24 13:05:22 +02:00
Daniel J. Hofmann
c2e8d6160f Documents system-wide limit constructor parameters in node bindings, resolves #4317 2017-07-24 13:02:56 +02:00
Emil Tin
f609905267 fix profile debugging related to way classes 2017-07-24 13:01:32 +02:00
Daniel J. Hofmann
f7c8bac3fd Handles distinction of no-route vs invalid-route in mld alternatives
The viaroute plugin always expects a route to be there potentially
with invalid edge weight to represent no-route-found. By switching
to the many-route-result for the mld alternatives algorithm we might
return an empty many-route-result invalidating the post-condition.
2017-07-22 12:50:54 +02:00
Patrick Niklaus
58811d8f5c Merge pull request #4320 from Project-OSRM/oak-franklin-scenario
Adds lane anticipation Oak St -> Franklin St -> Fell St scenario
2017-07-22 08:08:56 +00:00
Daniel J. Hofmann
54960f9b5d Adds lane anticipation Oak St -> Franklin St -> Fell St scenario 2017-07-21 19:04:55 +02:00
Patrick Niklaus
cd45ddda13 Merge pull request #4304 from Project-OSRM/third_party/update_dependencies
Update third party dependencies
2017-07-21 00:00:44 +00:00
Patrick Niklaus
04acd2141b Use sol 2.17.5 instead 2017-07-20 22:01:54 +00:00
Michael Krasnyk
336ec4741c Update TBB mason version to 2017_U7 2017-07-20 13:49:18 +00:00
Pepijn Schoen
8da40419ee Maintain storage_config exposed API 2017-07-20 12:01:05 +02:00
Pepijn Schoen
0b5c7a97a7 Addressed comments 2017-07-20 12:01:05 +02:00
Pepijn Schoen
d9e8caf369 Use GetPath with file names over accessing member variables 2017-07-20 12:01:05 +02:00
Pepijn Schoen
e208485c17 expose mandatory / optional / output files in io_config; config files to use new io_config constructor 2017-07-20 12:01:05 +02:00
Pepijn Schoen
5a6dee80ac Fix rebase problems 2017-07-20 12:01:05 +02:00
Pepijn Schoen
67fae1d1f0 rename osrm_input_path to osrm_path, clang-format 2017-07-20 12:01:05 +02:00
Pepijn Schoen
1b31099f73 superclass extractor_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen
897518a297 superclass customizer_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen
a9b6686725 superclass partition_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen
2c7cb5baba superclass contractor_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen
29160eec9c superclass updater_config with io_config 2017-07-20 12:01:05 +02:00
Pepijn Schoen
fe00a8a0ca superclass storage_config with io_config 2017-07-20 12:01:05 +02:00
Patrick Niklaus
64574c779f [skip ci] Backport 5.9 changelog 2017-07-19 17:02:29 +00:00
Daniel J. Hofmann
64e4b7eaa0 Introduces a construction whitelist in profiles 2017-07-19 16:24:45 +00:00
Daniel J. Hofmann
48824c4c8a Normalizes spaces in profiles 2017-07-19 16:24:45 +00:00
Daniel J. Hofmann
ababeb3a69 Makes construction=minor ways routable again, see #4258 2017-07-19 16:24:45 +00:00
Mateusz Loskot
cfa2a63323 Set OSRM_BUILD_DIR based on CMake build dir
For typical local workflow, CMake can auto-configure most
of the environment, for convenience.
2017-07-19 12:57:04 +00:00
Patrick Niklaus
9418f5613a Update sol2 to v2.17.5 2017-07-18 21:11:03 +00:00
Patrick Niklaus
22a3e06e1c Merge commit 'b91c2f0299722e64a6945808d64c3397c35811d0' into third_party/update_dependencies 2017-07-18 21:08:32 +00:00
Patrick Niklaus
b91c2f0299 Squashed 'third_party/libosmium/' changes from c1f34c455..9fd2348c6
9fd2348c6 Release v2.11.3
ed708286e Fix namespace.
835df8a7f Fix multipolygon assembler.
0979ab529 Fix areas assembler algorithm.
801f84c62 Bugfix: Invalid use of iterators.
f85653820 Read OPL file correctly even if trailing newline in file missing.
a31571c0f Release v2.11.2
a3903b368 Use minimum size of 64 bytes for buffers.
b86bafefe Release v2.11.1
32ebf736c Updated change log.
632ea5198 Bugfix: Call get_creator_function() in main thread.
ddc79eee7 Add test for not correctly handled unsupported_file_format_error.
86197a14f Bugfix: Terminate called on full buffer.
4340be8ad Fix the Filter::count() method.

git-subtree-dir: third_party/libosmium
git-subtree-split: 9fd2348c6956b6e1b930b50850e99eb31207ed50
2017-07-18 21:08:32 +00:00
Patrick Niklaus
07416c7a46 Bump versions to latest releases 2017-07-18 21:08:05 +00:00
Patrick Niklaus
440dccb81b Move classes to intersection object and don't emit notifications 2017-07-18 16:48:22 +00:00
Emil Tin
e413b25cd9 profiles api v2 2017-07-18 10:09:22 +00:00
Daniel J. Hofmann
5ece65cade Trigger lane anticipation based on distance, see discussion in #4260 2017-07-18 11:23:46 +02:00
Moritz Kobitzsch
c0c9ec1c7b changelog, consistent deprecated documentation 2017-07-18 11:23:46 +02:00
Moritz Kobitzsch
f2f00b99e0 remove usage of use-lane completely 2017-07-18 11:23:46 +02:00
Moritz Kobitzsch
7b755d6f8b deprecate use-lane -- the information can be found in the intersections array 2017-07-18 11:23:46 +02:00
Daniel J. Hofmann
7d63301039 Only enables -fopenmp in case the user wants stxxl 2017-07-17 19:19:10 +02:00
Patrick Niklaus
49f0b1eb59 Add abstraction to change the data facade at compile time 2017-07-17 11:40:55 +00:00
Michael Krasnyk
b2ed46efb5 Check activation index of EntryClass and warn if activation failed 2017-07-13 22:14:41 +00:00
Daniel J. Hofmann
58b61c68a3 Exposes EngineConfig system-wide limits in Node.js bindings, resolves #4226 2017-07-13 21:48:48 +00:00
Moritz Kobitzsch
30b8225812 only consider allowed entries when continuing on motorways 2017-07-13 08:59:01 +00:00
Moritz Kobitzsch
54530a14e9 add test indicating missdetection of continuing on motorways 2017-07-13 08:59:01 +00:00
Daniel Patterson
ee8ffcf57b Include osrm-customize when doing 'make install' 2017-07-12 22:11:42 +00:00
Daniel J. Hofmann
5e9397fcca Canonicalizes all OSM string list handling in the profiles 2017-07-12 22:09:01 +00:00
Patrick Niklaus
8508834e50 Bump version to 5.10 2017-07-11 08:25:57 +00:00
Michael Krasnyk
924a8a7e38 Remove STXXL from OSM parsing and enable in CMake by default 2017-07-11 08:23:26 +00:00
Michael Krasnyk
960e9178ba Updated ChangeLog 2017-07-11 08:23:26 +00:00
Michael Krasnyk
a3257ff651 Added STXXL configuration 2017-07-11 08:23:26 +00:00
Michael Krasnyk
960f9ba29a Don't use stxxl vector in contractor 2017-07-11 08:23:26 +00:00
Michael Krasnyk
3940cc1641 Switch from stxxl::vector to std::vector in extractor 2017-07-11 08:23:26 +00:00
Michael Krasnyk
a498ba6537 Removed external_to_internal_node_id_map container 2017-07-11 08:23:26 +00:00
Daniel J. Hofmann
5b5a907023 Makes tile size checks strict, resolves #4177 2017-07-10 12:19:53 +02:00
Daniel J. Hofmann
c1cb3ebff7 Fixes Node.js bindings always enabling alternatives when using boolean overload 2017-07-10 10:44:15 +02:00
Daniel J. Hofmann
6a555a477b Discards construction and proposed ways, resolves #4230 2017-07-10 10:34:20 +02:00
Daniel J. Hofmann
175d27691d Fixes line endings, related to #4235 2017-07-10 07:26:17 +00:00
Emil Tin
5ede5577d1 avoid fuzzy ferry test 2017-07-07 16:16:13 +00:00
Emil Tin
0bfbe5ad16 handle startpoint in bicycle profile, add tests 2017-07-07 16:16:13 +00:00
Daniel J. Hofmann
54ceb05420 Implements Alternatives for MLD 2017-07-07 16:12:46 +00:00
Patrick Niklaus
fef0344be0 Don't use bool flags on ExternalMemoryNode because they blow up the struct 2017-07-07 13:24:34 +00:00
Lev Dragunov
b12fee5c0a Load graph before creating a server 2017-07-06 21:18:24 +00:00
Daniel J. Hofmann
1ef75c7a61 Bundles nan, node-cmake and node-pre-gyp for bootstrapping node-osrm, resolves #4216
Building `node-osrm` from source requires nan, node-cmake and
node-pre-gyp npm packages already \*. In order to bootstrap we
bundle these dev packages in the bundle we publish to npm.

\* See `src/nodejs/CMakeLists.txt`

Check `npm pack` - we now expect to see a `node_modules` directory
with nan, node-cmake, and node-pre-gyp already there.
2017-07-06 14:40:43 +00:00
Daniel J. Hofmann
8c5ac84f0c Lets approaches cuke test run under testbot profile, resolves #4181
🥒 🚗-> 🤖
2017-07-06 14:40:21 +00:00
Patrick Niklaus
44739f2dc3 Allow users to specify a class for each way
This adds the ability to mark ways with a user-defined
class in the profile. This class information will be included
in the response as property of the RouteStep object.
2017-07-06 09:17:49 +00:00
Patrick Niklaus
d52d530cbe Fix indentation and dead-code from c&p in cucumber to silence eslint 2017-07-05 07:57:46 +00:00
Patrick Niklaus
5fb00ff7bf [skip ci] Revert back gitattributes, was unrelated to OSX 2017-07-04 22:49:30 +00:00
Moritz Kobitzsch
4c7aa8f1c0 only consider narrow turns onto through streets straight 2017-07-04 22:03:04 +00:00
Moritz Kobitzsch
2522f70f86 add test case illustrating 4205 2017-07-04 22:03:04 +00:00
Mateusz Loskot
e47e8ed335 Add .gitattributes
Add the good default options as recommended by GitHub.
Helps to work around issues when using hybrid environments like
the Bash On Windows (see #4228).
2017-07-04 20:59:35 +00:00
Daniel J. Hofmann
2927b491c3 Updates Changelog with Exit Numbers 2017-07-04 20:58:19 +00:00
Daniel J. Hofmann
ba2a0b3566 Adds more exits cucumber scenarios 2017-07-04 20:58:19 +00:00
Moritz Kobitzsch
98caa0bcd9 adjust name-table checks for increased name table size 2017-07-04 20:58:19 +00:00
Moritz Kobitzsch
4a2a100569 add exits to unit-test initialisation 2017-07-04 20:58:19 +00:00
Moritz Kobitzsch
3073f4c0d1 don't announce something if we loose exit numbers while on the ramp 2017-07-04 20:58:19 +00:00
Daniel J. Hofmann
7d900e3b5a Implements Exit Numbers + Names (junction:ref way tag for now) 2017-07-04 20:58:19 +00:00
Patrick Niklaus
6d78c11fd2 [skip ci] Bump OSRM version to 5.9 2017-07-03 22:44:56 +00:00
Michael Krasnyk
1bee82e288 Make safety penalties graduation for primary, secondary and tertiary 2017-07-03 21:58:32 +00:00
Michael Krasnyk
a41caf0efb Adjustment of bicycle profile to review comments 2017-07-03 21:58:32 +00:00
Michael Krasnyk
a3e0eb03db Implement bicycle safety penalty 2017-07-03 21:58:32 +00:00
Patrick Niklaus
34f62b4894 Add test case for safety features on cycleways 2017-07-03 21:58:32 +00:00
Michael Krasnyk
b28077a437 Use rate rounding up to tenth in routability tests 2017-07-03 21:58:32 +00:00
Michael Krasnyk
359ab2b56e Use highest different level with source but not parent node 2017-07-03 14:57:52 +00:00
Michael Krasnyk
e42c23686b Edge case for MLD matrix plugin 2017-07-03 14:57:52 +00:00
Michael Krasnyk
d98f1a2632 Update "Multi level routing" test 2017-07-03 14:57:52 +00:00
Michael Krasnyk
aa736dbe3a Generalize directShortestPathSearch interface 2017-07-03 14:57:52 +00:00
Michael Krasnyk
3534203083 Generalize manyToManySearch and remove duplications 2017-07-03 14:57:52 +00:00
Michael Krasnyk
517cb5f094 Matrix plugin with MLD overlay 2017-07-03 14:57:52 +00:00
Michael Krasnyk
b910ab9bcb Add duration values to overlay graph 2017-07-03 14:57:52 +00:00
Michael Krasnyk
5a29e29535 Add matrix tests that checks MLD overlay 2017-07-03 14:57:52 +00:00
Michael Krasnyk
0fd71260d3 Enable ManyToManySearch in MLD 2017-07-03 14:57:52 +00:00
Michael Krasnyk
54367bfa98 Reduce memory consumption during partition 2017-07-03 14:57:52 +00:00
Michael Krasnyk
1e9806f872 Some osrm-runner fixes 2017-07-03 14:57:52 +00:00
Mateusz Loskot
1e704aa7f2 Ignore Visual Studio/Visual Studio Code related files 2017-07-03 14:42:51 +00:00
Michael Krasnyk
8a404ea850 Use correctly traffic light penalty for no_turn turns 2017-07-03 13:43:13 +02:00
Harry Wood
e2e279bc85 example curl command needs quotes
We need to add quotes around the URL in the curl command (at least in the shell
I'm using). Otherwise it truncates the URL at ';'
2017-06-30 14:04:46 +00:00
Michael Krasnyk
c914afdbf1 Fix missing-field-initializers warnings in PackedVector 2017-06-30 14:27:43 +02:00
Daniel J. Hofmann
49a057ebc0 Adds a link to Mapbox's mapping for navigation guide 2017-06-30 12:19:14 +02:00
Moritz Kobitzsch
d660c1609c don't collapse u-turns into combined turns 2017-06-30 09:25:03 +00:00
Michael Krasnyk
74bc8966a8 Test case with incorrect u-turn collapsing
http://map.project-osrm.org/?z=18&center=52.169237%2C10.032722&loc=52.168628%2C10.030759&loc=52.168707%2C10.030952&loc=52.168457%2C10.030432&hl=en&alt=0
2017-06-30 09:25:03 +00:00
Michael Krasnyk
9d8a3e3c97 Propagate lane data across traffic lights 2017-06-29 15:10:37 +00:00
Michael Krasnyk
a308b86056 Test case for #4189 2017-06-29 15:10:37 +00:00
Michael Krasnyk
1b540fe0ba Correct condition for is_going_straight_and_turns_continue 2017-06-29 15:10:37 +00:00
Michael Krasnyk
929e5a4de6 Review adjustments for driveway handler, #4151 2017-06-29 15:07:32 +00:00
Michael Krasnyk
df4f0d043a Added driveway handler 2017-06-29 15:07:32 +00:00
Michael Krasnyk
09df8d47a5 Re-enable edge-weight-updates-over-factor test 2017-06-27 13:02:53 +02:00
Michael Krasnyk
c8b75c9046 Use thread-safe lock-free assignment in PackedVector::set_value
PR uses TBB internal atomic's for atomic CAS on non-atomic data

Corresponding PR https://github.com/Project-OSRM/osrm-backend/pull/4199

Other options:

* use sequential update

* use an internal packed vector lock -> makes packed vector non-movable

* use boost.interprocess atomics implementation -> outdated and only 32 bit version

* use glib atomic's -> requires new dependency

*  wait for https://isocpp.org/blog/2014/05/n4013 as_atomic

*  use c11 _Atomic and atomic_compare_exchange_weak -> not possible to mix c++11 and c11

* use builtin functions gcc __sync_bool_compare_and_swap and msvc _InterlockedCompareExchange64 -> possible, but requires proper testing

boolean CompareAndSwapPointer(volatile * void * ptr,
                              void * new_value,
                              void * old_value) {
if defined(_MSC_VER)
   if (InterlockedCompareExchange(ptr, new_value, old_value) == old_value) return false;
   else return true;
elif (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
   return __sync_bool_compare_and_swap(ptr, old_value, new_value);
else
  error No implementation
endif
}

* use Boost.Atomic -> requires new dependency

        WordT local_lower_word = lower_word, new_lower_word;
        do
        {
            new_lower_word = set_lower_value<WordT, T>(local_lower_word,
                                                       lower_mask[internal_index.element],
                                                       lower_offset[internal_index.element],
                                                       value);
        } while (!boost::atomics::detail::operations<sizeof(WordT), false>::compare_exchange_weak(
            lower_word,
            local_lower_word,
            new_lower_word,
            boost::memory_order_release,
            boost::memory_order_relaxed));
2017-06-27 13:02:53 +02:00
Patrick Niklaus
dd8f5ac01d Make EMPTY_ENTRY_CLASS constexpr 2017-06-27 09:58:19 +00:00
Patrick Niklaus
22479ff5d8 Avoid dead-lock if other = this 2017-06-27 09:58:19 +00:00
Patrick Niklaus
688b1f8bef Remove serialization test 2017-06-27 09:58:19 +00:00
Patrick Niklaus
e5464526c8 Port isc file 2017-06-27 09:58:19 +00:00
Patrick Niklaus
37b8d3acd4 Refactor turn lane passing 2017-06-27 09:58:19 +00:00
Patrick Niklaus
4f13208ce8 Fix the propfile properties reading/writing 2017-06-27 09:58:19 +00:00
Michael Krasnyk
383640caaf Cleanup temporary test files 2017-06-26 11:03:32 +02:00
Michael Krasnyk
42f3401dd7 Add gdb svg printer for facade 2017-06-23 12:28:50 +02:00
Patrick Niklaus
7fb57c924f Explicitly implement move constructor for DeallocationVector 2017-06-23 09:22:30 +00:00
Patrick Niklaus
97592e5bc3 Refactor file writing in OSRM contract 2017-06-23 09:22:30 +00:00
Emil Tin
9922c0f4f7 adjust tests, cycleway allows cycling on footway 2017-06-22 14:20:42 +00:00
Emil Tin
f27434f2fb fixes #4060, incorrect cycling against oneways 2017-06-22 14:20:42 +00:00
Daniel J. Hofmann
32d39b7b49 Adds Node.js docs to readme 2017-06-22 14:02:49 +02:00
Daniel J. Hofmann
5c20c7b295 Explains what a roundtrip is in the api docs 2017-06-22 14:01:45 +02:00
Daniel J. Hofmann
df000debe9 Adapts obvious turn classification: no longer take entry_allowed into account, resolves #3987 2017-06-21 18:09:32 +02:00
Daniel J. Hofmann
31511416ed Adds a failing test case for obvious turn at the end of the road, see #3987 2017-06-21 18:09:32 +02:00
Patrick Niklaus
99b02cedfb Refactor tile tests 2017-06-19 15:59:38 +00:00
Daniel Patterson
4136bf2808 Add layer to debug tiles to expose all OSM nodes in that area. 2017-06-19 15:59:38 +00:00
Lev Dragunov
93d6fd05a9 No timestamps SIGSEV fix 2017-06-17 17:33:33 +00:00
Lev Dragunov
73c4bc1411 clang-format 2017-06-17 17:33:33 +00:00
Lev Dragunov
dc9b4bcfec Time information for maximum distance in matching 2017-06-17 17:33:33 +00:00
Daniel Patterson
e3276324b9 Include 'rate' property (reciprocal of weight) on debug tile edges. (#4162)
Include 'rate' property (reciprocal of weight) on debug tile edges and add turn weight data to debug tiles.
2017-06-15 17:50:57 +02:00
Moritz Kobitzsch
f80e5db346 add support for visualising turn penalties in MLD Debug tiles (#4157)
- template function for tile functionality with edge finder operator
 - refactors unit tests into single function (reduce code duplication)
 - adds unit tests for core-ch
2017-06-15 13:59:44 +02:00
Daniel Patterson
35550d8c0a Parallelize generation of the edge-expanded-edges. 2017-06-15 09:05:45 +00:00
Daniel J. Hofmann
b68d79407e Takes fn by forwarding ref. in for_each_pair, resolves #4148 2017-06-14 15:17:26 +00:00
Patrick Niklaus
27ed69b08f Parallize scripting on osmium::Buffer granularity
Fixes #3447 and reduces parsing time by about 15%.
2017-06-13 21:47:54 +00:00
Daniel Patterson
cd8fb82215 Add flag to allow skipping calling node function for nodes with no tags. 2017-06-13 12:23:00 +00:00
Daniel Patterson
5c8e2b6f78 Don't copy the node/way/segment/turn function objects for every call. 12-13% speedup for lua processing right there. 2017-06-13 12:23:00 +00:00
Stepan Kuzmin
9d30817294 add tests for the gaps and tidy map matching flags #4145 2017-06-12 11:32:06 +00:00
Stepan Kuzmin
5ee3c4de9f Expose Map Matching gaps and tidy parameters in Node.js bindings #4021 2017-06-12 11:32:06 +00:00
Michael Krasnyk
afbcb3d38c Don't filter out MLD tests 2017-06-10 11:05:57 +00:00
Daniel J. Hofmann
de1d5f199f Uses correct coefficients for local optimality in CH alternatives
The alpha constant is for the local optimality T-Test threshold.

Before we used epsilon for the T-Test threshold, but the epsilon
constant is meant to be used for the stretch test(s) only.

This changeset fixes the local optimality T-Test and uses the
epsilon constant for the two stretch tests:
- We test the stretch for the total route against epsilon and
- We test the detour against the epsilon now, too

We can discuss if the second stretch test should actually use
epsilon, too, or a adapted value of it - but definitly not alpha.
2017-06-09 13:20:41 +02:00
Michael Krasnyk
9158f69ea0 Failing test for alternative path 2017-06-09 13:20:41 +02:00
Daniel J. Hofmann
2cfd9c8d01 Adds npm5 lockfile 2017-06-08 21:58:09 +00:00
Daniel Patterson
5026741652 Make initialization fail with a specific exception if the dataset isn't compatible with the algorithm being used, rather than crashing when a query occurs. 2017-06-08 18:31:51 +00:00
Daniel Patterson
3d77714c36 Make most command-line tools return useful error codes on well-known exceptions. 2017-06-08 15:03:24 +00:00
Michael Krasnyk
03e83ec6a0 Fix invalid roundabout instructions for different driving modes, #4129 2017-06-08 15:01:27 +00:00
Michael Krasnyk
9315dc1c73 Test for a roundabout with footway exits, #4129 2017-06-08 15:01:27 +00:00
Patrick Niklaus
b8bb12b2e2 Merge pull request #4134 from gojuno/polyline_input
Polyline6 support for the http REST API
2017-06-08 12:05:49 +00:00
Lev Dragunov
bd1532847c Changelog entry 2017-06-07 21:46:19 +03:00
Lev Dragunov
3602b58517 Review fixes 2017-06-07 21:43:49 +03:00
Lev Dragunov
d7035291ea clang-format 2017-06-07 15:39:08 +03:00
Lev Dragunov
6b0bcb5171 Docs and tests 2017-06-07 15:24:00 +03:00
Lev Dragunov
6b8f3c7fef Polyline6 support in the REST input 2017-06-06 19:51:00 +03:00
Patrick Niklaus
0d12d2fd28 Merge pull request #4094 from Project-OSRM/refactor/rapidash
Replace timezone shapefile parsing with geojson parsing
2017-06-02 20:01:04 +00:00
Patrick Niklaus
10460fc2fb Fix PR comments 2017-06-02 18:46:21 +00:00
Patrick Niklaus
6c7f0edf50 Don't use manual extract commands in weight tests 2017-06-02 18:12:13 +00:00
Patrick Niklaus
51bf9c4ff2 Small fixes for osrm-runner 2017-06-02 18:12:13 +00:00
Patrick Niklaus
0266c9d969 Renumber nodes after running osrm-partition
The new numbering uses the partition information
to sort border nodes first to compactify storages
that need access indexed by border node ID.

We also get an optimized cache performance for free
sincr we can also recursively sort the nodes by cell ID.

This implements issue #3779.
2017-06-02 18:12:13 +00:00
Michael Krasnyk
879de346ea
Add timezone names customization in tests 2017-06-02 17:35:18 +02:00
Michael Krasnyk
50d9c4b34a
Add local time support for windows 2017-06-02 17:35:18 +02:00
Patrick Niklaus
a195d7dfd3 Remove compiler errors and use 32bit for segment_index 2017-06-02 12:15:06 +00:00
Daniel Patterson
1c3cb897c1 Refactor RTree so that .fileIndex only contains EdgeDataT, and all r-tree structure is in the .ramIndex file.
Also tunes the BRANCHING_FACTOR a bit to speed up access with this new layout.
2017-06-02 12:15:06 +00:00
karenzshea
0e39320a77 do not run conditional cuke tests by default 2017-06-02 11:15:34 +02:00
karenzshea
1b162c1962 remove rapidjson gtest dep 2017-06-02 10:26:39 +02:00
karenzshea
f497201322 add check that restrictions are off when not found in timezone polygons 2017-06-02 10:00:07 +02:00
karenzshea
65746edd2d deps and lint 2017-06-02 10:00:07 +02:00
karenzshea
91e1ac83d9 add london geojson fixture 2017-06-02 10:00:07 +02:00
karenzshea
63ea75612b by default restrictions are off if timezone is not found 2017-06-02 10:00:07 +02:00
Michael Krasnyk
f9a650792a Fix updating conditional turn restrictions 2017-06-02 10:00:07 +02:00
karenzshea
564a29141e add testing geojson files 2017-06-02 10:00:07 +02:00
karenzshea
c937d20e48 unit tests for geojson validation 2017-06-02 10:00:07 +02:00
karenzshea
ca353eb7db refactor timezoner a bit for unit tests, add initial unit tests 2017-06-02 10:00:07 +02:00
karenzshea
f268163ea0 remove shapefile dependency from build 2017-06-02 10:00:07 +02:00
karenzshea
6f41e3faf1 fixes to get compiling 2017-06-02 10:00:07 +02:00
karenzshea
aed2c0124a rapidjson steppin in 2017-06-02 10:00:07 +02:00
Michael Krasnyk
f5564c9275 Merge commit '632ce270fa23d00e969877e983da6bc7cbaf1458' as 'third_party/rapidjson' 2017-06-02 09:35:53 +02:00
Michael Krasnyk
632ce270fa Squashed 'third_party/rapidjson/' content from commit f54b0e47a
git-subtree-dir: third_party/rapidjson
git-subtree-split: f54b0e47a08782a6131cc3d60f94d038fa6e0a51
2017-06-02 09:35:53 +02:00
karenzshea
93dac6b246
vendoring rapidjson, header only library 2017-06-02 09:35:30 +02:00
Moritz Kobitzsch
a92674022a make all u-turns continue 2017-06-01 12:39:10 +02:00
Moritz Kobitzsch
ceaf065d0e don't collapse highway ramps into uturns (#4074) 2017-06-01 12:39:10 +02:00
Michael Krasnyk
a58139dfb5 Terminate earlier if mason fails to install clang++ on travis 2017-06-01 10:26:11 +00:00
Moritz Kobitzsch
9bd2b0deaa fix invalid turn angle in forks 2017-06-01 11:43:18 +02:00
Michael Krasnyk
d262c4dfaa [skip ci] Add comments about order of post-processing calls 2017-06-01 11:13:31 +02:00
Michael Krasnyk
dd009322de Remove roundabout skip as no leavesRoundabout steps after postProcess 2017-06-01 11:13:31 +02:00
Michael Krasnyk
858ec2e655 Fix steps collapsing after non-closed roundabouts, #4100 2017-06-01 11:13:31 +02:00
Michael Krasnyk
5d4ab4100a Test for collapsing sliproads after crossing a roundabout, #4100 2017-06-01 11:13:31 +02:00
FILLAU Jean-Maxime
43ddc63d67 Adds documentations on 'approaches' parameter.
Adds changelog
Adds doc/http.md doc
Adds doc/nodejs/api.md doc

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-31 15:02:55 +00:00
Daniel J. Hofmann
b5d1565dec Let's Travis check that for yarn lockfile and package.json sync
See https://yarnpkg.com/lang/en/docs/cli/check/
2017-05-31 14:40:31 +02:00
Daniel J. Hofmann
6658bb7d51 Runs yarn upgrade to sync yarn lockfile 2017-05-31 14:40:31 +02:00
Daniel J. Hofmann
eb2db4994f Updates NAN for Node.js bindings 2017-05-31 14:40:31 +02:00
Daniel J. Hofmann
d88e5ddf20 Uses node-cmake's CMake module directly, resolves #3912
No need for vendoring.
2017-05-31 14:40:31 +02:00
Daniel J. Hofmann
f3558260b6 Splits turn penalty tests into bicycle and testbot domain, resolves #4067 2017-05-31 10:47:43 +02:00
Daniel J. Hofmann
0317bbb35d Splits via tests into car and testbot domain, resolves #4061 2017-05-30 16:38:51 +02:00
Daniel J. Hofmann
a4a6ed7e38 Puts approach test into car domain 2017-05-30 16:37:05 +02:00
FILLAU Jean-Maxime
15a1e10487 Add nodejs binding test
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
98ad9d8b61 Refactoring enum Approach in enum class.
Suppress "engine::"

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
c573cdb0ae Use formating script.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
82a149eb87 Propagating approach parameter to every phantom nodes search function.
Propagating approach parameter for plugins :
 - tabler
 - nearest
 - trip

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
089c98a107 Adding support for left left hand driving.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
17a73e3979 Add NodeJS API for Approaches param.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
f65299d665 Rename side API
Side -> Approach
 - DEFAULT -> CURB
 - BOTH -> UNRESTRICTED
 - remove OPPOSITE param

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
f782dfbfd9 Add uturn test case in cucumber for sides param.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
ec7934ea33 Change qi::lit for qi::symbols for the sides parameter parser.
Refactor code :
 - Suppress StartSide Enum
 - Change Side Structure for Enum

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
2de17f3fd0 Adding url unit test for "sides" parameters
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
ba2bf4f78e Adding cucumber file test "side_param_feature" for the side parameter.
- test on normal segment
 - test on oneway segment

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
8a54e6a0ec Adding "sides" params for the sides option tests into java script
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
FILLAU Jean-Maxime
8e70c87e64 New "sides" setting in base parameters for phantom nodes.
- Adding sides parameter into base parameters, it can take the values SIDE, OPPOSITE or DEFAULT.
 - Adding url parser for "sides" parameter, url values are "s" for SIDE, "o" for OPPOSITE and "d" for DEFAULT, example : "sides=s;s".
 - Checking parameters, if "sides" parameter is used, the number of parameter is the same as number of location.
 - Create a phantom to start at side driving or Opposite side driving.

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-05-30 10:19:41 +00:00
Patrick Niklaus
579a1ed42e Don't copy the object on WriteOne 2017-05-29 15:09:36 +00:00
Patrick Niklaus
a544935e7d Fix unit-test 2017-05-29 15:09:36 +00:00
Daniel Patterson
7eab227ab1 Use FileWriter for better error handling when writing name data. 2017-05-29 15:09:36 +00:00
Daniel Patterson
382a5cebab Use FileWriter for writing LeafNode data to improve error handling. 2017-05-29 15:09:36 +00:00
Johan Uhle
6d2353c302 Allow docker image with assertions (#4016) 2017-05-29 12:08:44 +02:00
Lev Dragunov
45ee096260 Ignore split breakage fix. 2017-05-26 10:55:03 +00:00
Daniel Patterson
c21a476b00 Overridden virtual function should be marked as override final. 2017-05-26 09:15:34 +00:00
Daniel Patterson
25c870dc57 Unused padding doesn't need to be named, removing name silences compiler warnings. 2017-05-26 09:15:34 +00:00
Daniel Patterson
4605c35101 Mark NodeJS headers as system includes to suppress compiler warnings. 2017-05-26 09:15:34 +00:00
Daniel Patterson
8655c61ec2 Remove variable name for unused parameters to silence compiler warnings. 2017-05-26 09:15:34 +00:00
Michael Krasnyk
314cf3f31a Add a comment line about counting 2017-05-23 18:27:47 +00:00
Michael Krasnyk
1d26deb0be Allow counting of service exits on service roundabouts, see #4075 2017-05-23 18:27:47 +00:00
Michael Krasnyk
ac35757616 [skip ci] Adjust CHANGELOG and the test description 2017-05-23 14:35:23 +02:00
Michael Krasnyk
47f2f17987 Change order of guidance post-processing, fix #4030 2017-05-23 14:35:23 +02:00
Michael Krasnyk
a63b43c259 Place reverse entering_via_edge in the front of intersection_view 2017-05-22 09:33:59 +00:00
Michael Krasnyk
14582fea5f Added example for roundabout overlapping 2017-05-22 09:33:59 +00:00
Daniel J. Hofmann
862ec14e06 Asserts Valid Iterators in Roundabout Exit Invalidation, see #4024 2017-05-22 09:33:59 +00:00
Daniel Patterson
570d81c6dd Bypass boost::numeric_cast checks for coordinate values that have already been validated (#4059)
(i.e. stuff that's stored in our datafiles).  Keep those checks for user-supplied values
(i.e. coordinates coming from files during preprocessing, or coordinates supplied by users
 during requests)
2017-05-19 10:52:44 -07:00
Michael Krasnyk
4964d0dcbd Adjust expectation and remove non-valid assertions 2017-05-19 09:47:47 +00:00
Patrick Niklaus
5c00fc9769 Disable weight update factor test, see issue #4065 2017-05-19 08:25:03 +00:00
Patrick Niklaus
3599d1db8e Switch code to use packed vector for segment weights/durations 2017-05-19 08:25:03 +00:00
Michael Krasnyk
5c61f00ffa
Add testbot profile to zero-speed-updates.feature 2017-05-19 09:00:23 +02:00
Daniel Patterson
aef3ff3e7b Use correct node-loading code in rtree benchmark. (#4064) 2017-05-18 13:29:50 -07:00
Daniel J. Hofmann
a971c2ef37 Applies max turn weight for turns onto restricted weights: no need for custom penalty 2017-05-18 16:33:50 +00:00
Daniel J. Hofmann
c757f70b97 Prevents possible overflow in applying a turn penalty onto restricted roads 2017-05-18 16:33:50 +00:00
Daniel J. Hofmann
403db7cc84 Lets MakeResponse(Route) explicitly call MakeResponse(ManyRoutes) in Route API
https://github.com/Project-OSRM/osrm-backend/pull/4035#discussion_r116890340
2017-05-18 10:54:32 +02:00
Michael Krasnyk
7a4c5a64fa Simplify angleBetween to avoid cancellation losses 2017-05-17 15:52:11 +00:00
Michael Krasnyk
c535e74a65 Added test to check bearing::angleBetween precision 2017-05-17 15:52:11 +00:00
Michael Krasnyk
e605917083 Changed some assert to OSRM_ASSERT 2017-05-17 15:52:11 +00:00
Michael Krasnyk
14db5f8d1f Fix OSRM_ASSERT_MSG compilation fail in Release mode 2017-05-17 15:52:11 +00:00
Michael Krasnyk
3546abc30e Added ChangeLog entry 2017-05-17 15:21:51 +00:00
Michael Krasnyk
e4b58c1258 Reverted connection of forward and backward nodes in one SCC 2017-05-17 15:21:51 +00:00
Michael Krasnyk
5e2e1d4c96 Renamed EdgeBasedNode to EdgeBasedNodeSegment 2017-05-17 15:21:51 +00:00
Michael Krasnyk
1a7cd785f2 Rename .nodes -> .nbg_nodes and .nodes_data -> .ebg_nodes 2017-05-17 15:21:51 +00:00
Michael Krasnyk
65de940882 Change EdgeBasedNodeDataExternalContainer to EdgeBasedNodeDataContainer 2017-05-17 15:21:51 +00:00
Michael Krasnyk
26702920b4 Move ComponentID to EdgeBasedNodeDataContainer 2017-05-17 15:21:51 +00:00
Michael Krasnyk
373087d74f Initialize unused bits in PhantomNode 2017-05-17 15:21:51 +00:00
Michael Krasnyk
ca6b1b39b7 Remove data duplicates in .node file 2017-05-17 15:21:51 +00:00
Michael Krasnyk
8934167e76 Merge part of .nodes fields into .nodes_data 2017-05-17 15:21:51 +00:00
Daniel J. Hofmann
9972b5f1f9 Removes unused PUBLISH_NODE_BINDINGS var from .travis.yml 2017-05-16 16:23:24 +00:00
Patrick Niklaus
d8877abf26 Fix weight value for alley 2017-05-16 16:19:17 +00:00
Patrick Niklaus
bce3b68281 Add regression test 2017-05-16 16:19:17 +00:00
Patrick Niklaus
7d42e18479 Fix bicycle turn penalties 2017-05-16 16:19:17 +00:00
Mateusz Loskot
4294295242 Mark way_function properties as mandatory
Format values and function names as code (refines #4040)
2017-05-16 15:17:57 +00:00
Frederik Ramm
16f492026a remove penalty_table from car.lua
remove penalty_table as it is apparently not used anywhere.
2017-05-16 10:40:21 +00:00
Mateusz Loskot
7d58f0ec53 Document default values of global properties set in profile 2017-05-16 10:39:51 +00:00
Patrick Niklaus
6bd724fe24 Rewrite packed vector to also allow random access
This fixes issues #3952. The new approach pre-computes masks for fast
access. Since elements can potentially span multiple words we need masks
and offsets for each upper and lower word.

Due to a bug in the C++14 standart the mask computation is not
recognized as constexpr, but would work on C++17.
2017-05-16 10:25:29 +00:00
Patrick Niklaus
26a208529e [skip ci] Fix alternatives_count documentation 2017-05-15 17:02:41 +00:00
Patrick Niklaus
3fbdb19956 Bump cucumber timeout of gcc-6 with coverage 2017-05-15 12:23:07 +00:00
Patrick Niklaus
ea9d5eca0f Update yarn.lock 2017-05-15 12:23:07 +00:00
Patrick Niklaus
0f66278532 Disbale doc builds again 2017-05-15 12:23:07 +00:00
Patrick Niklaus
b9206ef017 Upgrade docbox 2017-05-15 12:23:07 +00:00
Patrick Niklaus
9d8f1d9dbf Try documentation 4.0.0 JS RC1 2017-05-15 12:23:07 +00:00
Daniel J. Hofmann
e064a9334b Lifts restriction to only provide zero or one alternative routes 2017-05-12 13:54:22 +02:00
Daniel J. Hofmann
e12c7756d9 Weight-ifies alternatives related code-paths 2017-05-12 13:54:22 +02:00
Moritz Kobitzsch
f8002480c2 fix continue_straight interaction with bearing specification 2017-05-12 13:38:04 +02:00
Karen Shea
799a677e7a Conditional turn restriction support (#3841)
* optionally include condition and via node coords in InputRestrictionContainer

* only write conditionals to disk, custom serialization for restrictions

* conditional turn lookup, reuse timezone validation from
extract-conditionals

* adapt updater to use coordinates/osm ids, remove internal to external map

* add utc time now parameter to contraction

* only compile timezone code where libshp is found, adapt test running

* slight refactor, more tests

* catch invalid via nodes in restriction parsing, set default cucumber
origin to guinée

* add another run to test mld routed paths

* cosmetic review changes

* Simplify Timezoner for windows build

* Split declaration and parsing parts for opening hours

* adjust conditional tests to run without shapefiles

* always include parse conditionals option

* Adjust travis timeout

* Added dummy TZ shapefile with test timezone polygons

* [skip ci] update changelog
2017-05-11 12:13:52 +02:00
Michael Krasnyk
12f47708cd Adjust method and function names 2017-05-11 09:13:42 +00:00
Michael Krasnyk
9358aa1128 Disable nodes with invalid segments 2017-05-11 09:13:42 +00:00
Michael Krasnyk
a44b63fbb9 Add response codes of trip and routability queries 2017-05-11 09:13:42 +00:00
Mateusz Łoskot
e2b7e8a4da Refactor osrm-extract and osrm-contract to use osrm lib interface
Simplifies implementation of the tools slightly.
Ensures osrm::extract and osrm::contract keep working.

Follows up PR #3787
2017-05-10 21:35:42 +00:00
Michael Krasnyk
a5bfcd876f Add response code to test result values 2017-05-09 16:58:23 +00:00
Patrick Niklaus
2f02384d22 Disbale boost::interprocess condition variables on Linux to fix issue #3911 2017-05-08 09:15:01 +00:00
Michael Krasnyk
3de8613843 Added test with an empty CSV file 2017-05-05 22:15:05 +00:00
Michael Krasnyk
ccb8a07dc7 Hide qi namespace alias 2017-05-05 22:15:05 +00:00
Michael Krasnyk
6484fed190 Remove generate-edge-lookup argument in feature tests 2017-05-05 22:15:05 +00:00
Michael Krasnyk
6b103c6d0b Add zero file size check 2017-05-05 22:15:05 +00:00
Michael Krasnyk
669ac058b8 Print diagnostic information to avoid boost cryptic errors 2017-05-05 22:15:05 +00:00
Michael Krasnyk
e92967167f Use mapped_file_source for CSV files 2017-05-05 22:15:05 +00:00
Patrick Niklaus
f3de2c9b94 For the cyclability profile add alley penalties 2017-05-05 17:06:50 +00:00
Patrick Niklaus
21cd1a44e8 Add failing test case for alleys 2017-05-05 17:06:50 +00:00
Johan Uhle
6ca46795aa Fix gitsha output in dockerfile (#4014) 2017-05-05 15:55:48 +02:00
Patrick Niklaus
35d7b7ceaf Regenerate docs 2017-05-05 08:51:36 +00:00
Patrick Niklaus
faa2094488 Fix docs for radius 2017-05-05 08:51:36 +00:00
Patrick Niklaus
e6d776699f Fix overloaded parameter docs 2017-05-05 08:51:36 +00:00
Patrick Niklaus
200e90ad43 Disable TOC 2017-05-05 08:51:36 +00:00
Michael Krasnyk
c66f67ac07 Updated assertions to catch negative duration values for weights > 0
but still clamping negative duration values at 0 without checking weights
2017-05-04 21:03:45 +00:00
Michael Krasnyk
334a7b50cd Use rectified linear unit to prevent negative duration values 2017-05-04 21:03:45 +00:00
Michael Krasnyk
a9d3e61884 Fix minor review comments 2017-05-03 21:59:38 +00:00
Michael Krasnyk
88082c48cf Remove GetEdgeBasedNodeID from TurnDataContainer 2017-05-03 21:59:38 +00:00
Michael Krasnyk
40d0297885 Added unpacked_nodes vector to annotatePath interface 2017-05-03 21:59:38 +00:00
Michael Krasnyk
be1acae20c Use edge_id as index in ebg_node_data_container 2017-05-03 21:59:38 +00:00
Michael Krasnyk
f1e4349c82 Move geometry ids, name_ids and travel_modes to EdgeBasedNodeData 2017-05-03 21:59:38 +00:00
Michael Krasnyk
1f701341db Move reserve call before pushing weights 2017-05-03 21:59:38 +00:00
Patrick Niklaus
2a24468267 Regenerate API docs 2017-05-03 15:23:03 +00:00
Patrick Niklaus
f531a956f5 Update nodejs docs to document the constructor better 2017-05-03 15:23:03 +00:00
Patrick Niklaus
1aea10010b Run the docs in CI again 2017-05-02 16:57:23 +00:00
Patrick Niklaus
2cf6010665 Split travis jobs 2017-05-02 16:57:23 +00:00
Michael Krasnyk
2402d60429 Adjusted to PR comments 2017-05-02 16:55:03 +00:00
Michael Krasnyk
19494984eb Fix incorrect exit turn invalidation 2017-05-02 16:55:03 +00:00
Michael Krasnyk
07c7cb3c6c Rename BinaryHeap to QueryHeap 2017-05-02 15:54:25 +00:00
Michael Krasnyk
358aebec4d Decrease memory footprint of HeapHandle from 32 to 24 bytes 2017-05-02 15:54:25 +00:00
Michael Krasnyk
05826150f6 Use boost::heap::d_ary_heap 2017-05-02 15:54:25 +00:00
Michael Krasnyk
5827358a1e node.js script to run random osrm queries 2017-05-02 15:54:25 +00:00
Daniel J. Hofmann
9334cc463d Fixes Table not checking for valid phantom nodes
We failed to check if we could actually find phantom nodes for all
coordinates in the table plugin, leading to corrupt internal state.

```
curl 'http://localhost:5000/table/v1/car/7.4151,43.7305;7.4222,43.7368?radiuses=0;'
```

```
[assert][140505627227904] /tmp/osrm-backend/include/engine/routing_algorithms/routing_base.hpp:68
in: void osrm::engine::routing_algorithms::insertNodesInHeap(osrm::engine::SearchEngineData<osrm::engine::routing_algorithms::ch::Algorithm>::ManyToManyQueryHeap&, const osrm::engine::PhantomNode&) [with bool DIRECTION = false; osrm::engine::SearchEngineData<osrm::engine::routing_algorithms::ch::Algorithm>::ManyToManyQueryHeap = osrm::util::BinaryHeap<unsigned int, unsigned int, int, osrm::engine::ManyToManyHeapData, osrm::util::UnorderedMapStorage<unsigned int, int> >]: phantom_node.IsValid()
terminate called without an active exception
```
2017-05-02 13:41:33 +02:00
Daniel J. Hofmann
5532ee627f Fixes util.format calls in Cucumber support code 2017-05-02 12:52:10 +02:00
Freenerd
2021c30805 Save gitsha for later use in docker container 2017-05-02 09:36:09 +00:00
Patrick Niklaus
0e39aa9488 Address PR comments 2017-04-24 16:04:41 +00:00
Patrick Niklaus
8ec0745883 Add benchmark 2017-04-24 16:04:41 +00:00
Patrick Niklaus
c446b017ef Switch from macro based StrongTypedef to template version 2017-04-24 16:04:41 +00:00
Patrick Niklaus
a68435d856 Move clip functions to lambda 2017-04-20 14:58:26 +00:00
Patrick Niklaus
814324146b signed -> unsigned 2017-04-20 14:58:26 +00:00
Patrick Niklaus
11d8b2ba5a Add clipping for 20 bits to SegmentWeight/SegmentDuration 2017-04-20 14:58:26 +00:00
Patrick Niklaus
d6c6a262d8 Use 16bit for SegmentWeight and SegmentDuration 2017-04-20 14:58:26 +00:00
Patrick Niklaus
5c4f96e4bc Fix checking columns if route is not specified 2017-04-20 13:52:13 +00:00
Patrick Niklaus
9974b8b1da Apply traffic light penalty also for non-turns 2017-04-20 13:52:13 +00:00
Michael Krasnyk
c81baae1b9 Fix incorrect weight fallback for distance-based weights 2017-04-19 08:28:38 +02:00
Patrick Niklaus
e96545be2e Disable is_integral check because it fails for strong-type-def 2017-04-18 17:24:46 +00:00
Patrick Niklaus
609801ae99 Fix PR comments 2017-04-18 17:24:46 +00:00
Patrick Niklaus
a66918a303 Make PackedVector generic 2017-04-18 17:24:46 +00:00
Pepijn Schoen
e85c4f87e9 Skip fingerprinting .turn_penalties_index, to be done in a separate iteration because of Appveyor issues. 2017-04-18 12:01:06 +00:00
Pepijn Schoen
8ff5a22799 clang-format 2017-04-18 12:01:06 +00:00
Pepijn Schoen
4929d1297e Address PR comments 2017-04-18 12:01:06 +00:00
Pepijn Schoen
b830a8f942 Replace Count32 with Count64 2017-04-18 12:01:06 +00:00
Pepijn Schoen
0c388a5264 Fingerprint .turn_penalties_index 2017-04-18 12:01:06 +00:00
Pepijn Schoen
e4eb18cf4e Fingerprint .properties 2017-04-18 12:01:06 +00:00
Pepijn Schoen
5b4f432cba Fingerprint .tld 2017-04-18 12:01:06 +00:00
Pepijn Schoen
15f7257645 Fingerprint .turn_duration_penalties and .turn_weight_penalties 2017-04-18 12:01:06 +00:00
Pepijn Schoen
12c11f1d48 Fingerprint .names 2017-04-18 12:01:06 +00:00
Pepijn Schoen
a196d5ced3 Fingerprint .timestamp, normalize use of Size / GetSize and make that function Fingerprint-aware 2017-04-18 12:01:06 +00:00
Pepijn Schoen
802af08179 Fingerprint .core 2017-04-18 12:01:06 +00:00
Pepijn Schoen
85ec50552d fingerprint .ramIndex / tree nodes 2017-04-18 12:01:06 +00:00
Pepijn Schoen
8da96f8d94 fingerprint .tld 2017-04-18 12:01:06 +00:00
Pepijn Schoen
5b9d858f57 Fingerprint .edges 2017-04-18 12:01:06 +00:00
Pepijn Schoen
023242ec03 Fingerprint geometries 2017-04-18 12:01:06 +00:00
Pepijn Schoen
683e53e950 Fingerprint .osrm.datasource_names 2017-04-18 12:01:06 +00:00
Pepijn Schoen
df0ee955e8 Fingerprint and move .levels 2017-04-18 12:01:06 +00:00
Daniel Patterson
771834793f Only log components in Debug mode, it's very wordy and not really useful (#3948)
for Release builds.

Log component counts at the end of the SCC run.
2017-04-17 16:49:26 -07:00
Michael Krasnyk
3915c1286b Don't remove the last original coordinate during tiding 2017-04-13 21:27:00 +00:00
Patrick Niklaus
b422b636d3 Remove boost::make_unique to fix travis node builds 2017-04-13 21:19:09 +00:00
Patrick Niklaus
5bbc675c6b Bump osrm version to 5.8 2017-04-13 21:19:09 +00:00
Patrick Niklaus
addf4d90e9 Use .gitignore default instead of .npmignore 2017-04-13 21:19:09 +00:00
Patrick Niklaus
721e5e7947 Restructure travis build 2017-04-13 21:19:09 +00:00
Michael Krasnyk
dea3144c4d Use total angle for turn instruction if entry step has large distance 2017-04-12 23:22:44 +00:00
Patrick Niklaus
1080d25fcf Install node version as well 2017-04-12 20:27:32 +00:00
Patrick Niklaus
afb553a31e Only use three jobs for node builds 2017-04-12 20:27:32 +00:00
Patrick Niklaus
e2c231234d Use nvm instead of travis node_js key
This fixes issues on container builds that would always use
node 6 even when 4 was specified.
2017-04-12 20:27:32 +00:00
Patrick Niklaus
103f7117ed Update changelog 2017-04-12 14:59:26 +00:00
Michael Krasnyk
59b70c4d11 Make CoreCH SearchEngineData inherited from CH one
this allows to keep a single Algorithm template parameter in internal
interfaces as

template <typename Algorithm>
search(SearchEngineData<Algorithm> &,
       const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &, ...)
2017-04-12 10:54:09 +00:00
Michael Krasnyk
f96bae40ac Remove unused {forward,reverse}_heap_2 in MLD engine data 2017-04-12 10:54:09 +00:00
Michael Krasnyk
ba974c73bf Remove CoreCH heaps 2017-04-12 10:54:09 +00:00
Michael Krasnyk
e498ad3ee7 Make explicit fallback to CH heaps in CoreCH algorithms 2017-04-12 10:54:09 +00:00
Michael Krasnyk
1de031ed06 Remove {forward,reverse}_core_heap arguments from search interface 2017-04-12 10:54:09 +00:00
Patrick Niklaus
d6ac924b94 Use Date.now() 2017-04-11 22:33:38 +00:00
Patrick Niklaus
ee24473cbb Always print node version 2017-04-11 22:33:38 +00:00
Patrick Niklaus
c19a3cec1c Fix build syntax 2017-04-11 22:33:38 +00:00
Patrick Niklaus
f3694be1a0 Override install and after_sucess 2017-04-11 22:33:38 +00:00
Patrick Niklaus
306d86ce58 Add missing semi-colon 2017-04-11 22:33:38 +00:00
Patrick Niklaus
2c001b63a5 Port timer script to JS 2017-04-11 22:33:38 +00:00
Patrick Niklaus
e162dda836 Don't use bc 2017-04-11 22:33:38 +00:00
Patrick Niklaus
10c532bd4c Revert "Skip cucumber tests for publish builds"
This reverts commit 3f8160c156.
2017-04-11 22:33:38 +00:00
Patrick Niklaus
c8a7bc1d6a Revert "Don't build unit tests for publishing job"
This reverts commit eb0bd378ae.
2017-04-11 22:33:38 +00:00
Patrick Niklaus
9ca3c69b49 Don't build unit tests for publishing job 2017-04-11 22:33:38 +00:00
Patrick Niklaus
d1cf8c1fd5 Skip cucumber tests for publish builds 2017-04-11 22:33:38 +00:00
Patrick Niklaus
018742f50f Constrain the number of jobs on container builds 2017-04-11 22:33:38 +00:00
Patrick Niklaus
b82d21f856 Install yarn when not there 2017-04-11 22:33:38 +00:00
Patrick Niklaus
cfaadf198f Attempt sudo:false build matrix for node 2017-04-11 22:33:38 +00:00
Michael Krasnyk
6698b5e07e Use fallbacks counter to print a single warning message 2017-04-11 14:55:56 +00:00
Michael Krasnyk
37794a5e8a Change traffic CSV field value from weight to rate
and make the value required.

If the weight name is 'duration' than the rate value
can be computed as speed / 3.6

Issue: https://github.com/Project-OSRM/osrm-backend/issues/3823
2017-04-11 14:55:56 +00:00
Patrick Niklaus
a88fef2937 Implement distance pruning for MLD as well 2017-04-10 17:25:55 +00:00
Patrick Niklaus
da474a16a9 Fix formating 2017-04-10 17:25:02 +00:00
Patrick Niklaus
59bbfeb67f Buffer turn data on disk to save memory 2017-04-10 17:25:02 +00:00
Patrick Niklaus
4e9e2ed5bd Emit a notification when turning on a ferry and don't merge step 2017-04-07 15:29:53 +00:00
Moritz Kobitzsch
e0593c7ca2 add failing test for 3762 2017-04-07 15:29:53 +00:00
Daniel J. Hofmann
1f69df0d89 We need bash for the install script 2017-04-07 14:48:57 +02:00
Patrick Niklaus
05706879a0 Less is more: Don't force any specific build configuration 2017-04-07 14:48:57 +02:00
Patrick Niklaus
7e49b36198 Add script to fall back to source build 2017-04-07 14:48:57 +02:00
Patrick Niklaus
56bcb491d3 Bump package version to latest.6 2017-04-07 10:08:36 +00:00
Patrick Niklaus
f4e2bd848d Fixed breaking publishing due to node-cmake upgrade 2017-04-07 08:54:52 +00:00
Daniel J. Hofmann
0cf96314a3 Documents frontend quick start in Readme 2017-04-07 06:56:01 +00:00
Patrick Niklaus
91e24cab9e Bump package version to latest.5 2017-04-06 20:54:24 +00:00
Patrick Niklaus
288155ead0 Fix formating 2017-04-06 15:42:38 +00:00
Patrick Niklaus
85454857d3 Use default move function 2017-04-06 15:42:38 +00:00
Patrick Niklaus
fe50f6590a Fix formating 2017-04-06 15:42:38 +00:00
Patrick Niklaus
2da5da3f16 Don't leak ownership in partition/files 2017-04-06 15:42:38 +00:00
Patrick Niklaus
446c865415 Dont leak ownership in extractor::files 2017-04-06 15:42:38 +00:00
Patrick Niklaus
0072bf0c59 Move to forward declare header 2017-04-06 15:42:38 +00:00
Patrick Niklaus
4ec7ca29f1 Fix formating 2017-04-06 15:42:38 +00:00
Patrick Niklaus
d94017dfae No shared_memory_wrapper, (De)SerializeVector 2017-04-06 15:42:38 +00:00
Patrick Niklaus
dce0ce0e17 Fix readGraph to not use UseSharedMemory 2017-04-06 15:42:38 +00:00
Patrick Niklaus
d61102e255 Fix compilation of rtree benchmark 2017-04-06 15:42:38 +00:00
Patrick Niklaus
7f6e0c478b Split QueryNode into coordinates and osm id 2017-04-06 15:42:38 +00:00
Patrick Niklaus
786a3d8919 Read multi level graph to view 2017-04-06 15:42:38 +00:00
Patrick Niklaus
ef3fcdc6e6 Refactor graph writing code in contractor 2017-04-06 15:42:38 +00:00
Patrick Niklaus
90c194fc81 Refactor turn description into own file 2017-04-06 15:42:38 +00:00
Patrick Niklaus
5ed686a17b Add generic graph serialization 2017-04-06 15:42:38 +00:00
Patrick Niklaus
4e3009260c Load data directly into CellStorageView 2017-04-06 15:42:38 +00:00
Patrick Niklaus
c87ce2dede Load data directly into MLPView 2017-04-06 15:42:38 +00:00
Patrick Niklaus
99a87b4c83 Change serialisation of .geometries file. 2017-04-06 15:42:38 +00:00
Patrick Niklaus
3f5fc1e897 Read segment data directly into shm 2017-04-06 15:42:38 +00:00
Patrick Niklaus
97d1de1beb Pull turn data up into server 2017-04-06 15:42:38 +00:00
Patrick Niklaus
d7e1c9c09c Refactor turn data into own class 2017-04-06 15:42:38 +00:00
Patrick Niklaus
865111bca9 Split partition serialization logic 2017-04-06 15:42:38 +00:00
Patrick Niklaus
08d62cd5e3 Separate serialization and files in extractor 2017-04-06 15:42:38 +00:00
Daniel J. Hofmann
603e2ee7de Adapts bindings to node-cmake v2, resolves #3879 2017-04-06 15:26:54 +02:00
Michael Krasnyk
98948989d0 implement MLD map matching 2017-04-06 11:17:23 +00:00
Michael Krasnyk
1aa8cc3b65 make getPathDistance algorithm-independent 2017-04-06 11:17:23 +00:00
Michael Krasnyk
c487d1307e enable map matching in MLD 2017-04-06 11:17:23 +00:00
Michael Krasnyk
604f4957f7 correctly fail on unimplemented map matching feature 2017-04-06 11:17:23 +00:00
Michael Krasnyk
7726576bb7 use ADL and explicit instantiation for map matching 2017-04-06 11:17:23 +00:00
Michael Krasnyk
cf17a3a4c3 PR review adjustments 2017-04-06 10:36:40 +02:00
Michael Krasnyk
0972ec9115 remove CH-related part of loops forcing 2017-04-06 10:36:40 +02:00
Michael Krasnyk
f660ae30dc use explicit instantiation of shortestPathSearch 2017-04-06 10:36:40 +02:00
Michael Krasnyk
2766c24b42 prefer smaller legs for equal weights in shortest path plugin 2017-04-06 10:36:40 +02:00
Michael Krasnyk
cab83555e1 add loops forcing to MLD search 2017-04-06 10:36:40 +02:00
Michael Krasnyk
48a098a9c7 implement MLD shortest path plugin 2017-04-06 10:36:40 +02:00
Michael Krasnyk
a1fa1c610c enable "via" MLD tests 2017-04-06 10:36:40 +02:00
Michael Krasnyk
905ca69301 add Algorithm parameter to SearchEngineData 2017-04-06 10:36:40 +02:00
Michael Krasnyk
d66cc125aa make first heaps algorithm-aware 2017-04-06 10:36:40 +02:00
Michael Krasnyk
3fc0fc65f9 don't disable algorithms explicitly 2017-04-06 10:36:40 +02:00
Michael Krasnyk
8c64b01d67 itroduce ADL via algorithm specific ch, corech and mld namespaces 2017-04-06 10:36:40 +02:00
Michael Krasnyk
2566f64c34 fix unused variable warning 2017-04-06 10:36:40 +02:00
Patrick Niklaus
8cd40b9e90 Bump backed version to latest.4 2017-04-05 11:38:49 +00:00
Patrick Niklaus
45df8568b6 Fix formating 2017-04-05 11:22:39 +00:00
Patrick Niklaus
0da041477b Adjust generation counted array for PR comments 2017-04-05 11:22:39 +00:00
Patrick Niklaus
272ea9b92e Fix test compilation 2017-04-05 11:22:39 +00:00
Patrick Niklaus
571681d019 Use array heap 2017-04-05 11:22:39 +00:00
Patrick Niklaus
9b614c6057 Add generation counted storage 2017-04-05 11:22:39 +00:00
Patrick Niklaus
721f319909 Don't scan back clique arcs 2017-04-05 11:22:39 +00:00
Patrick Niklaus
a3621f3655 [skip ci] Bump package version to latest.3 2017-04-04 23:03:04 +00:00
Pepijn Schoen
789311abd6 Remove osrm namespace indication where possible, wrap out shared_memory_ownership 2017-04-04 17:00:36 +00:00
Pepijn Schoen
091a495632 clang-format 2017-04-04 17:00:36 +00:00
Pepijn Schoen
16665aeb00 Renaming of MemorySetting > Ownership 2017-04-04 17:00:36 +00:00
Pepijn Schoen
d6e56c38d5 Rename SharedMemoryWrapper to vector_view 2017-04-04 17:00:36 +00:00
Pepijn Schoen
87874006c7 rename to vector_view, replace some missing ShM occurences 2017-04-04 17:00:36 +00:00
Pepijn Schoen
703588b684 clang-format 2017-04-04 17:00:36 +00:00
Pepijn Schoen
b21ee1b63b Fixed regression 2017-04-04 17:00:36 +00:00
Pepijn Schoen
427437d49b Use a one-time defined generic signature for SharedMemoryVectors 2017-04-04 17:00:36 +00:00
Pepijn Schoen
01deefc3bc First pass at adjustment for comments 2017-04-04 17:00:36 +00:00
Pepijn Schoen
157ca9161f clang-format 2017-04-04 17:00:36 +00:00
Pepijn Schoen
266e65e6d2 Replace bool for using shared memory with MemorySetting enum 2017-04-04 17:00:36 +00:00
Daniel J. Hofmann
70b3962c35 NodeJS Binding Tests
Does not run the nodejs tests in sanitized builds. We'd have to

    export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libasan.so.2'

the asan lib. But it seems like our Clang from mason does not like the
system's libasan. Also we'd need a suppression file for v8 and node.
2017-04-04 16:57:44 +00:00
Patrick Niklaus
e568b600f0 Tag a new latest version for publishing 2017-04-03 12:50:45 +00:00
Patrick Niklaus
273fd689ce Always check local variables 2017-03-30 20:12:07 +00:00
Patrick Niklaus
0363d64722 Update releasing docs 2017-03-30 20:12:07 +00:00
Patrick Niklaus
d200507424 Fix travis.yml 2017-03-30 20:12:07 +00:00
Patrick Niklaus
fc84f605af Switch from commit message publishing to tag-based publishing 2017-03-30 20:12:07 +00:00
Patrick Niklaus
927dea37bb Fix publishing node binaries 2017-03-30 20:12:07 +00:00
Patrick Niklaus
de98ae57b7 Switch to yarn 2017-03-30 20:12:07 +00:00
Patrick Niklaus
614398ed6c Integrate MLD in node bindings 2017-03-30 20:12:07 +00:00
Michael Krasnyk
2cd4ba9a0a move split_edges to global properties 2017-03-30 11:20:13 +02:00
Michael Krasnyk
57d3f71bf9 added change log entry and documentation 2017-03-30 11:20:13 +02:00
Michael Krasnyk
8f8df969a2 use signed slope to distinguish uphills and downhills 2017-03-30 11:20:13 +02:00
Michael Krasnyk
e39dc3c464 adjust rasterbot test to check split_edges flag 2017-03-30 11:20:13 +02:00
Michael Krasnyk
dbc6535221 add split_edge flag in extracted ways 2017-03-30 11:20:13 +02:00
Michael Krasnyk
e262cac3e8 Flip source and target coordinates for segments in only backward direction 2017-03-29 22:05:37 +00:00
Michael Krasnyk
4ab3165ae3 Fix unnecessary duplication of backward segments for non-split edges
for edges with the split flag false and in_backward_direction true
if in_forward_direction is also true backward segments can be incorrectly duplicated
2017-03-29 22:05:37 +00:00
Michael Krasnyk
7a1a209168 use std::regex_token_iterator instead of boost tokenized 2017-03-29 10:23:42 +00:00
Michael Krasnyk
ac6f07a744 make adaptors::tokenized compatible with boost 1.54 2017-03-29 10:23:42 +00:00
Michael Krasnyk
dac929f8df Make max-cell-sizes parameter a comma-separated list 2017-03-29 10:23:42 +00:00
MichalPP
ebd938a8fc add kerb to foot.profile barrier whitelist 2017-03-29 10:25:28 +02:00
Michael Krasnyk
5ba54a62d6 Fix clang format for 3dcc713 2017-03-28 13:39:22 +00:00
Michael Krasnyk
827a595b6c Enable coverage reports for unit_tests 2017-03-28 10:40:13 +00:00
Michael Krasnyk
c03f74d8b0 Remove unused id parameter 2017-03-28 10:40:13 +00:00
Michael Krasnyk
f5393f44f7 Add minimal representative example for #3866 2017-03-28 10:40:13 +00:00
Patrick Niklaus
ad6e834992 Add regression test 2017-03-28 10:40:13 +00:00
Patrick Niklaus
3439b21177 Fix internal edges for nodes not in the boundary 2017-03-28 10:40:13 +00:00
Pepijn Schoen
730c809395 Fix Win tests by copying data explicitly to test/data 2017-03-28 12:08:49 +02:00
Emil Tin
5a2da798c8 fixes speed on cycleway+oneway #3853 2017-03-28 12:07:38 +02:00
Daniel J. Hofmann
c0e7f6e9f4 Documents the user having to be in the docker group for running our images 2017-03-28 12:05:09 +02:00
Richard Fairhurst
ed83d3ed13 More turn parameters as per @daniel-j-h's comment 2017-03-28 11:58:42 +02:00
Richard Fairhurst
aa1dff3fc4 Update _rate as per @TheMarex's comment 2017-03-28 11:58:42 +02:00
Richard Fairhurst
c1901e9689 Add new property from #3840 2017-03-28 11:58:42 +02:00
Richard Fairhurst
c6e6d9fa94 Explain parameters as per @daniel-j-h's suggestion 2017-03-28 11:58:42 +02:00
Richard Fairhurst
88eabb98b9 Document all options available to Lua profiles
Recent improvements to OSRM have led to a lot of changes to the Lua scripting interface, and refactoring of the default profiles makes them slightly more abstract and difficult to grok for those writing profiles from scratch.

This is therefore an attempt to fully document the attributes that can be read and set from Lua profiles. I've done it from my own understanding and from reading the source, but I may well have missed things or mistaken them!
2017-03-28 11:58:42 +02:00
Michael Krasnyk
3dcc7132b6
Add max-cell-sizes option to partitioner 2017-03-28 11:53:14 +02:00
Daniel Patterson
379380abd8 These don't need to be warning messages, debug is sufficient. 2017-03-22 10:41:10 +00:00
Lev Dragunov
497709da13 Review fixes 2017-03-22 10:39:36 +00:00
Lev Dragunov
b95a58591d Tidying matching without ts case 2017-03-22 10:39:36 +00:00
Lev Dragunov
5727b1387e Test fixes 2017-03-22 10:39:36 +00:00
Lev Dragunov
221cd00b1a Remove redundant bitsetting 2017-03-22 10:39:36 +00:00
Lev Dragunov
cce4f6344c TODO fixes 2017-03-22 10:39:36 +00:00
Lev Dragunov
a49c6f433b Cucumber tests 2017-03-22 10:39:36 +00:00
Lev Dragunov
ef308ac53a Compilation fix. 2017-03-22 10:39:36 +00:00
Lev Dragunov
2fab696bb3 New tidying and gaps parameters. 2017-03-22 10:39:36 +00:00
Lev Dragunov
836a5066c2 CHANGELOG entry 2017-03-22 10:39:36 +00:00
Lev Dragunov
69422cc4e7 Clang formatting. 2017-03-22 10:39:36 +00:00
Lev Dragunov
e9c0987e8a Integration #3149 and #3815 2017-03-22 10:39:36 +00:00
Daniel J. Hofmann
bd9eb76a2d Transparently Tidy Traces in Map Matching, resolves #2840.
The Map Matching plugin currently has issues with:
- high frequency traces and (performance)
- blobs, think noise at traffic signals (correctness)

This changeset implements trace-tidying transparently for the user.

We hopefully will see both performance gains as well as better matches!
2017-03-22 10:39:36 +00:00
Lev Dragunov
441eae9df2 Tidying prarameter for the map matching plugin. 2017-03-22 10:39:36 +00:00
Michael Krasnyk
bfc272f3e8 fix appveyor fail 2017-03-21 20:10:39 +00:00
Daniel J. Hofmann
215489286d Back to Monaco for examples and benchmarks 2017-03-21 20:10:39 +00:00
Daniel J. Hofmann
c772210cc0 Back to Monaco for unit tests 2017-03-21 20:10:39 +00:00
Patrick Niklaus
934f87bcdd Try disabling sanitizer fo GCC6 for now 2017-03-21 20:10:39 +00:00
Patrick Niklaus
ff872b4009 Fix example 2017-03-21 20:10:39 +00:00
Patrick Niklaus
7278f88aa9 Only extract berlin.osm.pbf once and fix windows builds 2017-03-21 20:10:39 +00:00
Daniel J. Hofmann
16621f00c1 Use float literals to silcen Windows warnings 2017-03-21 20:10:39 +00:00
Patrick Niklaus
0c9eb8e16c No osrm-contract run for the MLD dataset 2017-03-21 20:10:39 +00:00
Patrick Niklaus
78cd460395 Use core size 0.2 on berlin for preparing test data 2017-03-21 20:10:39 +00:00
Daniel J. Hofmann
2351b5a084 Merges node-osrm into repository
Build with

    cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On
2017-03-21 20:10:39 +00:00
Daniel Patterson
ff238c2724 Configure Dockerfile for integration with Docker Cloud/Dockerhub for (#3850)
automated image creation.
2017-03-21 12:53:12 -07:00
Patrick Niklaus
810e3c6a66 Add comment to explain branch 2017-03-21 16:23:10 +00:00
Patrick Niklaus
98529ee071 Apply clang format 2017-03-21 16:23:10 +00:00
Patrick Niklaus
e902ab4693 Fix all customization tests 2017-03-21 16:23:10 +00:00
Patrick Niklaus
b085add973 Integrate internal cell scan into customizer 2017-03-21 16:23:10 +00:00
Patrick Niklaus
2b397942fe Fix bug and add test coverage for GetInternalEdgeRange 2017-03-21 16:23:10 +00:00
Patrick Niklaus
655ca803d8 Adds a special graph for MLD with effcient boundary scan
This graph enables efficient boundary edge scans at each level.
Currenly this needs about |V|*|L| bytes of storage.
We can optimize this when the highest boundary nodes ID is << |V|.
2017-03-21 16:23:10 +00:00
Patrick Niklaus
58681fa7ea Refactor StaticGraph generation 2017-03-21 16:23:10 +00:00
Michael Krasnyk
78a199e2fb Add read-only max_turn_weight in ProfileProperties 2017-03-20 20:06:51 +01:00
Michael Krasnyk
851fcf0758 Use _TBB_DEFAULT_INSTALL_DIR as a single-value variable 2017-03-20 13:52:23 +00:00
Michael Krasnyk
7379be90f9 Configure custom TBB builds via TBB_INSTALL_DIR 2017-03-20 13:52:23 +00:00
Michael Krasnyk
af65ccd054 Merge pull request #3788 from Project-OSRM/mld/routing
MLD shortest direct path search
2017-03-17 15:45:38 +01:00
Michael Krasnyk
79ef204e1f
Change edge_id to from_clique_arc in MultiLayerDijkstraHeapData 2017-03-17 13:20:34 +01:00
Michael Krasnyk
f1b88adebe
Avoid dynamic binding in getNodeQureyLevel 2017-03-17 13:20:34 +01:00
Michael Krasnyk
0c6ce6ce08
Implement MLD routingStep with cell restriction and without 2017-03-17 13:20:33 +01:00
Michael Krasnyk
5e40b12450
Add data names to benchmark output 2017-03-17 13:20:33 +01:00
Michael Krasnyk
a75fd560d7
Use correct upper bound condition for MLD routing 2017-03-17 13:20:33 +01:00
Michael Krasnyk
152f77b665
Remove level field from heap node data 2017-03-17 13:20:33 +01:00
Michael Krasnyk
c39690195e
Added traffic tests to MLD testing 2017-03-17 13:20:33 +01:00
Michael Krasnyk
20c6b4682f
MLD regression tests 2017-03-17 13:20:32 +01:00
Michael Krasnyk
97c442482d
Prepare test data for both CH and MLD algorithms
Leaving log files opened was intentional to avoid missing output
that can appear `child.on('exit',...)`.
With this approach cucumber tests hit locally maximum number
of opened files, because node.js keeps all log files opened.
2017-03-17 13:20:32 +01:00
Michael Krasnyk
6586737835
Fix weights and annotations for phantom points on one segment 2017-03-17 12:27:48 +01:00
Michael Krasnyk
fe5d1a6e74
Add MLD testing to cucumber tests 2017-03-17 12:27:47 +01:00
Michael Krasnyk
81771a3bfd
Fix cell storage for tiny maps 2017-03-17 12:27:47 +01:00
Michael Krasnyk
c648711f30
MLD direct shortest path plugin 2017-03-17 12:27:47 +01:00
Michael Krasnyk
6829f46c31
Split routing_base into CH and non-CH parts 2017-03-17 12:27:47 +01:00
Michael Krasnyk
43a7e8e08a
Rename {id|edge_id} to turn_id 2017-03-17 12:27:47 +01:00
Michael Krasnyk
c370ddd89a
Add routing algorithm option 2017-03-17 12:27:47 +01:00
Patrick Niklaus
57c6c6e51c Remove all boundary nodes and use simple u-v-stragtegy to pick id
This commit removes all occurences of unconnected boundary nodes
and switches to the simple heuristic of picking U for the forward
and V for the backward node. This performs better than several
fancy heuristics.
2017-03-17 11:23:48 +00:00
Patrick Niklaus
bf6698f4cc Address @daniel-j-h PR commtents 2017-03-17 11:19:58 +00:00
Patrick Niklaus
44757729b7 Ignore --generate-edge-lookup and not list it anymore 2017-03-17 11:19:58 +00:00
Patrick Niklaus
eb2e4d0aaf Load edge based graph to memory in one block and then update 2017-03-17 11:19:58 +00:00
Patrick Niklaus
4684a498c4 Precompute accumulated segment data 2017-03-17 11:19:58 +00:00
Patrick Niklaus
864543b023 Fix invalid warning 2017-03-17 11:19:58 +00:00
Patrick Niklaus
ed143b503d Consolidate data loading 2017-03-17 11:19:58 +00:00
Patrick Niklaus
809d8a7d03 Remove duration fallback for turn penalties to simplify logic 2017-03-17 11:19:58 +00:00
Patrick Niklaus
5ab882759d First step of moving turn penalty update to own function 2017-03-17 11:19:58 +00:00
Patrick Niklaus
acbaecf45d Remove .osrm.edge_segment_update not needed anymore 2017-03-17 11:19:58 +00:00
Patrick Niklaus
1f238fedd8 Only recompute weights for segments that needs to be updated 2017-03-17 11:19:58 +00:00
Patrick Niklaus
5828f4400d Return sorted list of updated segments and segment_data 2017-03-17 11:19:58 +00:00
Patrick Niklaus
4e2b157db3 Refactor update factor warning 2017-03-17 11:19:58 +00:00
Patrick Niklaus
8f9b4fcdbb Don't copy query nodes 2017-03-17 11:19:58 +00:00
Patrick Niklaus
23c74af2b5 Fix crash in support code when there are no annotations 2017-03-17 11:19:58 +00:00
Patrick Niklaus
2cc22ce098 Update consistency checker 2017-03-17 11:19:58 +00:00
Patrick Niklaus
2df02aa301 Make segment data update work without rtree 2017-03-17 11:19:58 +00:00
Patrick Niklaus
cec1f223e9 Split segment data update and edge update into sub-functions 2017-03-17 11:19:58 +00:00
Patrick Niklaus
17f8339aa6 Split out segment data update function 2017-03-17 11:19:58 +00:00
Daniel J. Hofmann
35c4c2a256 Fixes use-after-move, closes #3820 2017-03-16 14:42:48 +01:00
Bhargav Chippada
3c81baa26e Nearest Service #coordinates >=1 2017-03-15 22:42:08 +00:00
Daniel J. Hofmann
0a917a77f5 Updates Travis builds to Clang 4.0 2017-03-15 13:01:30 +01:00
Daniel J. Hofmann
583699c84d Enables LTO for Travis Release Builds 2017-03-15 13:01:30 +01:00
Daniel J. Hofmann
0f7218c0c4 Adds Dockerfile building the current source tree 2017-03-15 12:44:41 +01:00
Daniel J. Hofmann
2d66fec174 Removes unused Docker scripts 2017-03-15 10:40:00 +01:00
Daniel J. Hofmann
3cae315a76 Silences Clang warnings about unused arguments 2017-03-14 00:44:51 +00:00
Patrick Niklaus
d661f3f31e Move customizer tests to own unit 2017-03-13 23:04:45 +00:00
Patrick Niklaus
907f933a54 Add update functionality to osrm-customize
All speed file flags are compatible with osrm-contract.
2017-03-13 23:04:45 +00:00
Michael Krasnyk
c6e9cc8024 Add heuristic approach to assign edge-based partition IDs
that minimize number of faked source/destination nodes in
the edge case: a single backward edge will be placed
in other than node u partion
2017-03-13 22:00:38 +00:00
Daniel J. Hofmann
40094ceeab Documents roundtrip param, closes #3741 2017-03-13 16:30:48 +00:00
wieringen
24c70e3c8e Added bus_trap and sump_buster to barrier whitelist for bicycle profile 2017-03-10 23:09:27 +00:00
Patrick Niklaus
a636e8cc13 Include datasources in .geometries file and refactor .datasource_names 2017-03-10 20:40:59 +00:00
Patrick Niklaus
ffd6311e7d Address PR comment by @oxidase 2017-03-10 14:43:02 +00:00
Patrick Niklaus
260a84b94b Simplify write/read code 2017-03-10 14:43:02 +00:00
Patrick Niklaus
fb552fd751 Apply clang-format 2017-03-10 14:43:02 +00:00
Patrick Niklaus
94e2a8598d Address PR comments 2017-03-10 14:43:02 +00:00
Patrick Niklaus
4986f5ea2d Consolidate read/write code in updater for compressed geometries 2017-03-10 14:43:02 +00:00
Patrick Niklaus
1b5ab37dfd Refactor compressed geometry in own abstraction with read/write 2017-03-10 14:43:02 +00:00
Patrick Niklaus
83820bf82c Split CSV parsing into nicer interface 2017-03-10 14:43:02 +00:00
Patrick Niklaus
20e028c47b Split updater code from contract into own module 2017-03-10 14:43:02 +00:00
Daniel J. Hofmann
89c62bf67f Removed components flag in travis config; we build it per default 2017-03-10 11:09:59 +01:00
Michael Krasnyk
bc43229055 Make ColumnIterator a random_access_iterator, fixes #3792 2017-03-09 19:06:09 +00:00
Daniel J. Hofmann
e43a8ca528 Changes version to 5.7.0 for master already 2017-03-09 16:11:43 +00:00
Pepijn Schoen
c7fc36a61b Normalize file writes 2017-03-09 14:16:41 +00:00
Mateusz Łoskot
e705ff16e3 Ensure Extractor scheduler is requested with non-Zero number of threads.
By default, ExtractorConfig::requested_num_threads is Zero,
which is an invalid value for tbb task scheduler.
If user does not specify value greater than Zero, then
use tbb::task_scheduler_init::automatic.
2017-03-09 12:28:19 +01:00
Michael Krasnyk
0a13390ab0 Compute correct speed values in tile plugin 2017-03-09 11:18:53 +00:00
Daniel J. Hofmann
bf6b571455 Documents null in Table response if no route can be found 2017-03-09 11:17:22 +00:00
Mateusz Łoskot
e13ba8ba11 Add basic facades for Extractor and Contractor run methods.
Based on idea suggested in comments to #3776, simplifies
use of extractor and contractor as libraries.
2017-03-08 22:48:03 +00:00
Michael Krasnyk
5aba239fc1 removed code duplication in unit tests 2017-03-08 16:08:00 +00:00
Michael Krasnyk
dff8c48842 added reading cell storage in customizer 2017-03-08 16:08:00 +00:00
Michael Krasnyk
ec3cda32fa moved basic type definitions to osrm namespace 2017-03-08 16:08:00 +00:00
Michael Krasnyk
faaf82c837 Added CellStorage statistics 2017-03-08 16:08:00 +00:00
Michael Krasnyk
3f6ae245f6 Added osrm-customizer tool 2017-03-08 16:08:00 +00:00
Michael Krasnyk
bc2e06502e Added cells customizer 2017-03-08 16:08:00 +00:00
Mateusz Łoskot
aa1c4eb262 Allow build with Osmium from external location.
If OSMIUM_INCLUDE_DIR is specified in CMake command line,
use Osmium from that location, instead of /third_party.
2017-03-08 10:27:09 +00:00
Michael Krasnyk
264cec12e9 Fix reading MLD data into shared memory block 2017-03-08 00:56:50 +00:00
Michael Krasnyk
e423aa5511 added TODO for #3783 2017-03-08 00:56:50 +00:00
Patrick Niklaus
9b5458840a Adapt build script for test data for AppVeyor 2017-03-08 00:56:50 +00:00
Patrick Niklaus
fae1c737a3 Disable building test data on windows 2017-03-08 00:56:50 +00:00
Michael Krasnyk
6f9aea4e56 fix clang format style 2017-03-08 00:56:50 +00:00
Michael Krasnyk
d575561d39 adjust free functions naming style 2017-03-08 00:56:50 +00:00
Michael Krasnyk
f42136637d Add edge-based graph loading in MLD facade 2017-03-08 00:56:50 +00:00
Michael Krasnyk
53b0417e36 fix boost::optional warning 2017-03-08 00:56:50 +00:00
Michael Krasnyk
5bb933dd84 allows msb computation only for unsigned types 2017-03-08 00:56:50 +00:00
Patrick Niklaus
821351f56e Simplify bisection->cellid code by counting bits not depth 2017-03-08 00:56:50 +00:00
Patrick Niklaus
a92fa257af Fix off-by-one in fallback MSB function 2017-03-08 00:56:50 +00:00
Patrick Niklaus
c29391636a Change from in-memory to on-disk stxxl for test/data 2017-03-08 00:56:50 +00:00
Patrick Niklaus
c8bd01caae Use unsigned long long for 32bit 2017-03-08 00:56:50 +00:00
Patrick Niklaus
1f39d936c5 Add special .stxxl file for tests to keep it in-memory 2017-03-08 00:56:50 +00:00
Patrick Niklaus
36ab848aba Fix travis 2017-03-08 00:56:50 +00:00
Patrick Niklaus
6cb401b1ff Run clang-format 2017-03-08 00:56:50 +00:00
Patrick Niklaus
fc9b5938e6 Hardcode path to test data dir for library-tests
This was needed because we now need multiple datasets for testing.
CMake will automatically prepare these over the makefile in test/data.
2017-03-08 00:56:50 +00:00
Patrick Niklaus
8ad9a0aa9a parameterize cell size 2017-03-08 00:56:50 +00:00
Patrick Niklaus
8f9e980945 Add class to translate from bisection ids to cell ids 2017-03-08 00:56:50 +00:00
Patrick Niklaus
b2f3b901e0 Fix cell storage tests 2017-03-08 00:56:50 +00:00
Patrick Niklaus
517b27bfc3 Instead of hard fail, just print the number of unconneced nodes 2017-03-08 00:56:50 +00:00
Patrick Niklaus
00d01946cd Moved MultiLevelPartition and CellStorage to partition namespace 2017-03-08 00:56:50 +00:00
Patrick Niklaus
694bf9d8b1 Integrate CellStorage into datafacade 2017-03-08 00:56:50 +00:00
Patrick Niklaus
ef71cc0d12 Clang format 2017-03-08 00:56:50 +00:00
Patrick Niklaus
5f73ac1eda Add unit tests selectiong algorithm 2017-03-08 00:56:50 +00:00
Patrick Niklaus
108fce896b Pull everthing in the facades 2017-03-08 00:56:50 +00:00
Michael Krasnyk
ff0a98196f Initial interation on writing out MLD partition/cell data 2017-03-08 00:56:50 +00:00
Patrick Niklaus
757e7ca936 First step towards mld integration 2017-03-08 00:56:50 +00:00
Michael Krasnyk
74b382d881 Merge pull request #3784 from mloskot/ml/msvc-bigobj
Add MSVC flag /bigobj to CMAKE_CXX_FLAGS
2017-03-07 21:51:16 +01:00
Mateusz Łoskot
a725fb4655 Add MSVC flag /bigobj to CMAKE_CXX_FLAGS
Fix fatal error C1128: number of sections exceeded object file format limit
while compiling src/extractor/scripting_environment_lua.cpp
2017-03-07 19:28:53 +01:00
Emil Tin
ee076e6156 cucumber: enable checking mode in routability tables (#3748)
* cucumber: enable checking mode in routability tables

* show actual mode when expected was none

* minor fixes
2017-03-07 09:56:19 +01:00
Michael Krasnyk
65669f23a1 Allow arguments list in add_dependency_includes 2017-03-06 16:16:17 +00:00
Michael Krasnyk
172b1ff9d1 Enable building osrm-extract-conditionals on travis 2017-03-06 16:16:17 +00:00
Patrick Niklaus
596890a0f4 Fix spelling of access=customer_s_ and add to the restricted list way whitelisted highways 2017-03-06 16:14:26 +00:00
Patrick Niklaus
0770d8b8cf Fix tile datasize check 2017-03-03 16:03:41 +00:00
Patrick Niklaus
cc3a4899a2 Only allow restricted access for road of certain highway type 2017-03-03 16:03:41 +00:00
Patrick Niklaus
93cdd8bb46 Remove unneccessar branch in CoreCH code 2017-03-03 16:02:12 +00:00
Patrick Niklaus
c2a5cc034a Fix formating 2017-03-03 16:02:12 +00:00
Patrick Niklaus
e737700c7b Fix tile encoding 2017-03-03 16:02:12 +00:00
Patrick Niklaus
a32f8a6a59 Fix two typos in tile code 2017-03-03 16:02:12 +00:00
Patrick Niklaus
ed00965d18 Add algorithm selection 2017-03-03 16:02:12 +00:00
Patrick Niklaus
3f485ac09b Addressed PR comments by @daniel-j-h and @oxidase 2017-03-03 16:02:12 +00:00
Patrick Niklaus
a901bda41e Fix algorithm compability check logic 2017-03-03 16:02:12 +00:00
Patrick Niklaus
0ac1f99f9c Fix bug in refactor 2017-03-03 16:02:12 +00:00
Patrick Niklaus
30ff0fa977 Refactor routeStep 2017-03-03 16:02:12 +00:00
Patrick Niklaus
7da86b5984 Implement CoreCH algorithm 2017-03-03 16:02:12 +00:00
Patrick Niklaus
922e155763 Add type traits to disable plugins for specific algorithms 2017-03-03 16:02:12 +00:00
Patrick Niklaus
436b34ffea Refactor routing_algorithms to only contain free functions 2017-03-03 16:02:12 +00:00
Patrick Niklaus
2fa8d0f534 Port OSRM, Engine and Datafacades to be algorithm aware 2017-03-03 16:02:12 +00:00
Michael Krasnyk
71e95c92b6 Fix incorrect forward datasources getter in facade 2017-03-03 10:52:34 +00:00
Patrick Niklaus
fbf7521769 Other flakey test 2017-03-02 15:24:51 +00:00
Patrick Niklaus
7c911b3891 Mark test as flaky and track in own issue. 2017-03-02 14:55:52 +00:00
Patrick Niklaus
9f61f72ee8 Print 0 rate 2017-03-02 14:55:52 +00:00
karenzshea
d32ebd57e6 simplify test, add intersection turn test 2017-03-02 14:55:52 +00:00
karenzshea
8e43c8cbce add restricted penalty on NoTurn turns 2017-03-02 14:55:52 +00:00
Daniel J. Hofmann
7632c20ddf Adds Docker Instructions to Readme 2017-03-01 20:21:26 +00:00
Daniel J. Hofmann
4fa3a5c362 Disables LTO for mason+gcc
See https://github.com/Project-OSRM/node-osrm/pull/301
2017-03-01 16:47:46 +00:00
Patrick Niklaus
886421b43a Fix help texts and .nbg_to_ebg -> .cnbg_to_ebg 2017-03-01 16:09:29 +00:00
Patrick Niklaus
e20cbf673f Make InertialFlow a function 2017-03-01 16:09:29 +00:00
Michael Krasnyk
54c35710f6 return vector with correct edges 2017-03-01 16:09:29 +00:00
Michael Krasnyk
748ade5fea fixed warnings 2017-03-01 16:09:29 +00:00
Michael Krasnyk
f5e9c7df07 adjust extractor scc to new StaticGraph 2017-03-01 16:09:29 +00:00
Michael Krasnyk
1541d32a42 adjust cell_storage tests to new StaticGraph interface 2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
ed7438b9ba don't check for files not actually read 2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
e8cca36369 fix tbb leaks 2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
d473acb56d fix edge duration truncation in partition, pending global fix
fix windows compilation
no multi line warnings
sanitze on mason with newer TBB
2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
b5d63e5ed5 Re-use the extractor edge based edge for loading the ebg in osrm-partition 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
c712fafae3 Sigh. Just randomly pick a side for border nodes for now.. 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
e589ab814d Store flag for artificial bounary edges and walk border nodes in ebg 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
5015e12d59 First try at artificial nodes 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
3e409bea26 Loads the edge based graph edges and constructs a dynamic graph from it 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
e0665856b0 Split Partitioner I/O off into separate headers 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
f71d742b5e Implements Mapping for NodeBasedGraph -> EdgeBasedgraph Translation 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
299d071e9d Fixes asan's detected tbb leak in osrm-partition
Here's all I could get out of a instrumented `osrm-partition`; debug build,
with all the bells and whistles I could think of to make it more verbose:

```
==17928==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1560 byte(s) in 3 object(s) allocated from:
    #0 0x7f4244185b30 in operator new[](unsigned long) ../../../../libsanitizer/asan/asan_new_delete.cc:62
    #1 0x7f4242a788b3  (/usr/lib/libtbb.so.2+0x208b3)

SUMMARY: AddressSanitizer: 1560 byte(s) leaked in 3 allocation(s).<Paste>
``

Symbolizing the address results in

```
echo "/usr/lib/libtbb.so 0x7f4242a788b3" | llvm-symbolizer
_fini
```

Looks like a crt finalizer => static global dtor "leaking" from tbb.

Which turned out to be a missing `tbb::task_scheduler_init` on our end:

> Using task_scheduler_init is optional in Intel® Threading Building
> Blocks (Intel® TBB) 2.2. By default, Intel TBB 2.2 automatically creates
> a task scheduler the first time that a thread uses task scheduling
> services and destroys it when the last such thread exits.

https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm?index.htm#reference/task_scheduler/task_scheduler_init_cls.html

Without an explicit instanz the first call to a tbb algorithm seem to initialize
a global scheduler singleton which then "leaks" until the program exits.

Phew.
2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
075f69acc2 Installs osrm-partition tool and library 2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
be41e8b321 generate stats in annotation 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
739ad73ae9 Be -fpermissive with gcc49: required for tbb::parallel_do_feeder compilation bug 2017-03-01 16:09:29 +00:00
Daniel Patterson
b62b09e5f6 Dump memory usage stats after partitioning. 2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
b789da45bd add unit tests for the different components of the parttion tool 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
e316dad1cb No longer requires edges to have a .data member in static graph
some fixes to make branch compilable
Removes unneeded edge data from components search
2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
c3cc79f798 always emit a small component view
Unit Tests for Reodering by Predicate
2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
b9ed20bb9b Implements Compressed Node Based Graph (De-)Serialization Skeleton
Implements parallel recursion for the partitioner
Fixes osrm-extract's -dump-partition-graph: accept no further tokens

References:
- http://www.boost.org/doc/libs/1_55_0/doc/html/boost/program_options/bool_switch.html

Pulls parameters through to make them configurable from the outside

Defaults are equivalent to:

    ./osrm-partition \
      berlin-latest.osrm \
      --max-cell-size 4096 \
      --balance 1.2 \
      --boundary 0.25 \
      --optimizing-cuts 10

Fixes parallel_do call for Intel TBB 4.2 (Trusty): no range-based overload
2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
786be6f570 Optimise Flow Algorithm/Datastructures in use 2017-03-01 16:09:29 +00:00
Daniel J. Hofmann
dd60ae31ae Implement Parallel Spatial-Ordering/Cut Selection
Extends explanation for recursive bisection ids
Cleans up Bisection State
Removes license boilerplate from partitioner config
Sorts Spatially and picks Sources and Sinks
Uses sets for sources and sinks for now; see how large they will get
Runs n cuts in parallel changing the slope and uses the best
Clarifies balance <-> ratio naming
2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
db7adfa77b Implement Dinic Algorithm for MaximumFlow/MinimumCut 2017-03-01 16:09:29 +00:00
Daniel J. H
dd3f351874 Partitioner Improvements and Utils on top of #3603 (#3611)
* Implements Random Access Iterator Facade for EdgeIDIterator

* Makes StaticGraph Node and Edge requirements explicit

* Cleans up Bisection Graph, Node and Edge

* Cleans up GraphView
2017-03-01 16:09:29 +00:00
Moritz Kobitzsch
d56db500d3 Initial Skeleton for Recursive Bisection via Inertial Flow 2017-03-01 16:09:29 +00:00
Lev Dragunov
07221f5a48 Do not take the current route into account in alternatives_count parameter. 2017-03-01 01:29:00 +00:00
Lev Dragunov
421d336b0f Cucumber test support for alternatives count parameter 2017-03-01 01:29:00 +00:00
Lev Dragunov
5be6f8959a Describe alternatives_count in documentation 2017-03-01 01:29:00 +00:00
Lev Dragunov
f7b8e06c3a Matching alternatives count output. #3508 2017-03-01 01:29:00 +00:00
Moritz Kobitzsch
18a50d357f remove suppressed new names from new tests 2017-02-25 12:17:22 +00:00
Moritz Kobitzsch
6c3390f14d refactor of post-processing
- moves collapse into a dedicated set of functions / files
 - make collapse scenarios distinct (slight performance cost)
 - reduce verbosity for short name segments (now actually working, was supposed to do so before)
2017-02-25 12:17:22 +00:00
Moritz Kobitzsch
8d83c3adbb add locations to turn scenarios
start assigning turn locations to test / further locations
add locations/make roads not overlapping - staggered
larger grid size for utf tests (new name)
2017-02-25 12:17:22 +00:00
Michael Krasnyk
cd1a73dde6 revert 'directly' method on win32 2017-02-24 16:01:56 +00:00
Michael Krasnyk
4161181a6c revert watchdog singleton 2017-02-24 16:01:56 +00:00
Michael Krasnyk
82acd59a8e shared monitor implementation with a conditional variable
or a ring buffer with semaphores
2017-02-24 16:01:56 +00:00
Patrick Niklaus
438aa66b4c Add packed storage of partition information
Right now we need a 64bit integer for every node in the graph.
Depending on the number of cells we will see, we might get away with
32bit eventually.
2017-02-24 15:58:47 +00:00
yuryleb
5739c27ef4 Corrected car's bridge feature tests 2017-02-23 22:35:15 +00:00
yuryleb
b59295e55e Restored pre-fetching bridge tags
Restored bridge tags but as optional way data; highway or route tags
must be always
2017-02-23 22:35:15 +00:00
yuryleb
49862d1bcd Restored foot and bike profiles 2017-02-23 22:35:15 +00:00
yuryleb
544e54894f Excluded 'bridge=*' from all profiles
This commit fixes issue #3588 "OSRM uses man_made=bridge lines to
route?" with exclusion of 'brigde' tag analisys from all profiles to
disable routing on bridges countours (with no highway tags)
2017-02-23 22:35:15 +00:00
karenzshea
046d3128c4 clamp speed value to js max 2017-02-22 16:12:58 +00:00
Moritz Kobitzsch
1ad1ff5fc1 remove unsigned >= 0 checks, unused constnat 2017-02-21 13:55:59 +01:00
Patrick Niklaus
e06ffabf21 Add storage for cell weights used in the MLD algorithm 2017-02-20 16:31:36 +00:00
Daniel J. Hofmann
b2b5e2bb4d Updates TBB to latest stable version for 5.6 release 2017-02-20 13:55:04 +00:00
karenzshea
c2727f2029 expose data about turning onto restricted roads to turn function 2017-02-20 12:40:51 +00:00
Lev Dragunov
a0e7bab598 Add oneway:conditional profile code comment. 2017-02-20 10:34:06 +00:00
Lev Dragunov
67ae86882a Conditional oneway restrictions 2017-02-20 10:34:06 +00:00
Daniel J. Hofmann
e52a8e060b Updates sol2 to v2.15.8, resolves #3733 2017-02-20 10:11:18 +00:00
Daniel J. Hofmann
1bc8dbf139 Updates sol2 to v2.15.8 in dependency script 2017-02-20 10:11:18 +00:00
Patrick Niklaus
73b1a46d15 Change stxxl version to package with mason.ini 2017-02-16 16:08:07 +00:00
Patrick Niklaus
7ecf3410bf Bundle mason.cmake and mason.sh 2017-02-16 16:08:07 +00:00
Moritz Kobitzsch
03bb6dc161 reduce verbosity of use-lane in combination with lane-anticipation 2017-02-15 21:57:48 +00:00
Kajari Ghosh
a45b9e07fc Update http.md
Clarify where optional rotary properties will be added
2017-02-15 21:55:22 +00:00
Moritz Kobitzsch
6567e79ec5 explicitly cast to strings for table diffs 2017-02-15 21:54:37 +00:00
Patrick Niklaus
224848fc11 Merge pull request #3713 from Project-OSRM/mason07
Update mason to 0.7 for Intel TBB library
2017-02-15 14:04:04 +00:00
Daniel J. Hofmann
6468a1ba79 Merge commit 'ce1141982b4f7acf581d62a379f8fb49ac63f6b8' into mason07 2017-02-15 11:48:43 +01:00
Daniel J. Hofmann
ce1141982b Squashed 'third_party/mason/' changes from 6b4c359..c7a9670
git-subtree-dir: third_party/mason
git-subtree-split: c7a967003a7113a17faafe3b41082ad1ae3f1c2f
2017-02-15 11:48:43 +01:00
Daniel J. Hofmann
6e18af2267 Update deps script to mason 0.7 2017-02-15 11:48:26 +01:00
Daniel Patterson
73ce44028f Allow routing on toll roads by default (#3712) 2017-02-14 15:20:10 -08:00
Kajari Ghosh
335362315c Correct a typo in the docs (#3706)
Fix the typo of `summary` parameter table that was mislabeled `steps`.
2017-02-13 13:45:24 -08:00
karenzshea
e75278f9c2 add unit test for annotations=true returning all annotations 2017-02-13 18:00:39 +00:00
karenzshea
a31f401995 parse parameters.annotations into AnnotationsType::All 2017-02-13 18:00:39 +00:00
Karen Shea
6446257a93 add error logging for missing osrm file to library tests (#3704) 2017-02-13 17:57:39 +01:00
karenzshea
1bace1288d use qi - parser to work with 0 speed file lines 2017-02-13 16:09:25 +00:00
karenzshea
23b07c9197 clang format 2017-02-13 15:49:30 +00:00
karenzshea
a61b1a3623 round speed to 1 decimal place 2017-02-13 15:49:30 +00:00
karenzshea
7f39c9fcb0 add unit test to check that speeds are equal to distance/duration 2017-02-13 15:49:30 +00:00
karenzshea
921ff43acf return speed annotations 2017-02-13 15:49:30 +00:00
Quinn Chrzan
1ed1bae249 Unit testing docs (#3698)
* Updating library-tests and associated documentation to be more informative

* Fixing heading markup for updated unit testing docs
2017-02-13 15:58:46 +01:00
Karen Shea
38a1edfe3c Update http.md 2017-02-13 14:59:54 +01:00
Moritz Kobitzsch
dc1d491c15 comments 2017-02-13 10:55:40 +00:00
Moritz Kobitzsch
e4d500f451 fix handling none-tags in presence of multiple turns within 2017-02-13 10:55:40 +00:00
Moritz Kobitzsch
d52ea86cb9 add failing test 2017-02-13 10:55:40 +00:00
Patrick Niklaus
b906f2a628 Fix side road penalties and add test 2017-02-13 09:28:35 +00:00
Michael Krasnyk
2b00d92463 make annotations={true|false|(values)+} grammar 2017-02-10 16:11:24 +00:00
Patrick Niklaus
d28713b845 Make rate support code a little bit more obvious 2017-02-10 14:27:28 +00:00
Patrick Niklaus
2e6428e917 Fix HOV lane support with penalties 2017-02-10 14:27:28 +00:00
karenzshea
1f3a8d4538 remove units from rate columns in routability testing 2017-02-10 14:27:28 +00:00
karenzshea
140f1ad923 convert speed to meters per second when used to set rate 2017-02-10 14:27:28 +00:00
karenzshea
1c25070572 provide rate and weight headers for checking in routability tests 2017-02-10 14:27:28 +00:00
karenzshea
24fe881d03 hov_penalty, use min penalty rather than aggregate 2017-02-10 14:27:28 +00:00
karenzshea
25ab51f4f0 remove calls to handlers now in handle_penalties 2017-02-10 14:27:28 +00:00
karenzshea
46f96af360 fix merge conflicts 2017-02-10 14:27:28 +00:00
Michael Krasnyk
ce685da92c use weight_multiplier to convert fallback durations to weights 2017-02-10 13:24:01 +00:00
Kajari Ghosh
2218658969 Trip with Fixed Start and End points (TFSE) (#3408)
* fixed start and end trip feature to trip service
2017-02-10 05:13:20 -05:00
Michael Krasnyk
3e2db47cc8 cleanup in facade GetUncompressed members 2017-02-10 09:22:24 +00:00
Michael Krasnyk
28a8154cee check weights consistency after updates 2017-02-10 09:22:24 +00:00
Jonathon Rossi
005124fe1c Fix JSON syntax error in HTTP API docs (#3679) 2017-02-09 20:24:21 +01:00
Patrick Niklaus
1e4c8eeeb6 Only use trains when they are marked for bringing bikes 2017-02-08 14:29:28 +00:00
Patrick Niklaus
72455a2733 Don't check access tags of bike against railway 2017-02-08 14:29:28 +00:00
Michael Krasnyk
112cf55aae use white list as a set complement of blacklist for bicycle profile
http://www.openstreetmap.org/way/4788559
2017-02-08 14:29:28 +00:00
Patrick Niklaus
aa3f208032 Add access=permissive check for all profiles 2017-02-08 14:27:55 +00:00
Daniel J. Hofmann
919386bdaf Adds access=permissive routability scenarios, see #3435. 2017-02-08 14:27:55 +00:00
Patrick Niklaus
ae835cc04f Blacklist steps from the car profile 2017-02-08 14:27:55 +00:00
Emil Tin
ef4d32a492 improve diff table output 2017-02-08 11:32:33 +00:00
Daniel J. Hofmann
2a5ebf84bc Installs profiles to /usr/local/share/osrm/profiles by default, resolves #3670 2017-02-08 12:02:20 +01:00
Patrick Niklaus
768dc8d817 Merge pull request #3669 from Project-OSRM/seemoritz-minor_fixes
Port Seemoritz minor fixes to master
2017-02-08 09:34:36 +00:00
Patrick Niklaus
0c04c6cafb Address PR comments 2017-02-07 18:12:49 +00:00
Patrick Niklaus
bf690df97a Merge branch 'minor_fixes' of https://github.com/seemoritz/osrm-backend into seemoritz-minor_fixes 2017-02-07 12:48:29 +00:00
Daniel J. Hofmann
880b982eeb Removes exit field for intersection counting; only used for roundabouts
- f3ebba7a79/src/engine/api/json_factory.cpp (L197-L198)
- f3ebba7a79/src/engine/guidance/post_processing.cpp (L153)
2017-02-07 11:42:57 +00:00
Daniel J. Hofmann
53011755a2 Removes distance field from Waypoint docs
Waypoint objects have
- name
- location
- hint

fields. The only API adding `distance` to waypoints is the Nearest
plugin. And it documents this behavior independently.

The docs are wrong here from what I can tell. See:
- https://github.com/Project-OSRM/osrm-backend/blob/5.5/src/engine/api/json_factory.cpp#L290-L297
- https://github.com/Project-OSRM/osrm-backend/blob/5.5/include/engine/api/nearest_api.hpp#L37-L44
2017-02-07 11:42:57 +00:00
Emil Tin
ddb60c34e6 align cucumber diff tables 2017-02-07 11:42:20 +00:00
Moritz Kobitzsch
543f0e5e44 fix order of parameter initialisation for route parameters 2017-02-07 11:34:29 +01:00
karenzshea
1e9e420d91 clang format 2017-02-07 09:15:16 +00:00
karenzshea
c885d03830 use lambda instead of bindy 2017-02-07 09:15:16 +00:00
karenzshea
ab91a05680 update cucumber suport code to return separate annotations headers 2017-02-07 09:15:16 +00:00
karenzshea
84261fd214 GetAnnotations function 2017-02-07 09:15:16 +00:00
karenzshea
734df348cb a few more parameter tests 2017-02-07 09:15:16 +00:00
karenzshea
41064e2d7b revert 2017-02-07 09:15:16 +00:00
karenzshea
8d7aae8687 fix cucumber outputs 2017-02-07 09:15:16 +00:00
karenzshea
7256b6d0d4 update support code to handle variable annotations fields 2017-02-07 09:15:16 +00:00
karenzshea
3106b5dd9e set RouteParameters annotations member, when constructor only specifies annotations_type, add unit_tests 2017-02-07 09:15:16 +00:00
karenzshea
f1427a834d fix bitwise operators, selectively add annotations to response obj 2017-02-07 09:15:16 +00:00
karenzshea
04954de9c6 implement bitwise and operator 2017-02-07 09:15:16 +00:00
karenzshea
a6cd0863bc store/accept individual annotations parameters in addition to bool 2017-02-07 09:15:16 +00:00
Michael Krasnyk
9f28873cb1 add empty {tracktype,smoothness}_speeds in bicycle profile 2017-02-07 09:06:04 +00:00
Emil Tin
10c5d76909 use data.highway 2017-02-07 09:06:04 +00:00
Emil Tin
d81ef3f4db first round of handlers 2017-02-07 09:06:04 +00:00
Emil Tin
3abab16bf3 move settings to profile table 2017-02-07 09:06:04 +00:00
Michael Krasnyk
6e1c4bfecd Added indexed array data type with variable and fixed group blocks 2017-02-07 07:41:12 +00:00
Daniel J. Hofmann
cedeb15ade Adds surface=sett to bicycle profile, resolves #3649
References:
- http://taginfo.openstreetmap.org/keys/surface#values
- http://wiki.openstreetmap.org/wiki/Key:surface
2017-02-06 10:54:56 +01:00
Michael Krasnyk
f2663acfc6 remove 4 bytes packing of NodeBasedEdgeWithOSM due to alignment fails 2017-02-05 12:54:26 +01:00
Michael Krasnyk
c48fc58eb2 reduce size of InternalExtractorEdge by using single-precision values 2017-02-03 21:52:39 +00:00
Michael Krasnyk
5f1c7efd41 assertion for correct weight data 2017-02-03 18:59:00 +00:00
Michael Krasnyk
9e5d45d86a Added 'distance' weight to car profile 2017-02-03 18:59:00 +00:00
Michael Krasnyk
5fd6355829 add empty speed tables to foot.lua 2017-02-03 12:41:26 +00:00
Michael Krasnyk
6da4d918d0 Allow bicycle routing without access tag for railways with highway tag
http://www.openstreetmap.org/way/24455356
2017-02-03 12:41:26 +00:00
Michael Krasnyk
1628ebb871 Fix assertions in car profile, resolves #3629
restrict direction if access tag is missing and can not be derived
from highway tag

http://www.openstreetmap.org/way/4282676
http://www.openstreetmap.org/way/4621857
http://www.openstreetmap.org/way/4898368
2017-02-03 12:41:26 +00:00
Patrick Niklaus
eaed5c7a8e Split if in ProcessWay to comform to old behavior 2017-02-03 12:41:26 +00:00
Pepijn Schoen
9d2628b74f Don't use bool return values on successful write, instead rely on exception throwing 2017-02-02 10:31:32 +01:00
Emil Tin
11ee632cfe car: add tests oneway:<mode> tags 2017-02-01 16:50:18 +01:00
Emil Tin
97c0a74c04 factor out common lua code to helper files 2017-02-01 16:50:18 +01:00
Michael Krasnyk
b3ef27d104 Make watchdog a singleton instance
References:
https://github.com/Project-OSRM/osrm-backend/issues/3619
https://github.com/Project-OSRM/osrm-backend/pull/3627#issuecomment-276288138
2017-01-31 13:25:59 +01:00
Michael Krasnyk
c22ce3ae1f Use shared memory region mapping at fixed address for OSX 2017-01-31 13:25:59 +01:00
Daniel Patterson
36c944ef53 No need to log the exception stack when it's just a test table difference - this should be a clean error. 2017-01-31 12:05:19 +01:00
Kajari Ghosh
5b24758742 Make docs more consistent.
Change the word `field` to `property` for accuracy.
2017-01-27 16:41:34 -08:00
Patrick Niklaus
a572719484 Smaller grammar and formating fixes for the changelog 2017-01-27 11:19:37 +01:00
Michael Krasnyk
ad594cb2e4 Update review findings 2017-01-27 11:19:37 +01:00
Michael Krasnyk
6b143c5e1d Use duration in SegmentBlock for duration updates 2017-01-27 11:19:37 +01:00
Michael Krasnyk
25baf51a2c Add duration to edges and use it in table plugin 2017-01-27 11:19:37 +01:00
Michael Krasnyk
c059d15cb9 Added weight multipliers for speed and turn updates 2017-01-27 11:19:37 +01:00
Patrick Niklaus
279f8aabfb Allow specifing a weight for routing that is independent of duration 2017-01-27 11:19:37 +01:00
Michael Krasnyk
e463733138 Limit test names to 64 chars to avoid hitting windows MAX_PATH limit
also in the change this.child is reset to null in case of error.
2017-01-27 11:19:37 +01:00
Michael Krasnyk
7deff5837c Throw IO error if the number of read bytes does not match count
and the stream is in failed state
2017-01-27 11:19:37 +01:00
Emil Tin
46ac9d05d9 foot profile: fix missing tracktype/smothness settings 2017-01-27 09:45:02 +01:00
Moritz Kobitzsch
c7640903c3 don't emit invalid turns when having u-turns on ferries 2017-01-26 13:08:00 +01:00
Emil Tin
445225bf6d clean up lua debugging 2017-01-25 16:37:41 +01:00
Emil Tin
47b1a56b12 refactor foot profile (as was done for car) 2017-01-25 11:23:49 +01:00
Moritz Kobitzsch
b5e289adc3 3605 - fix error in treating end-of-road as choiceless (#3607) 2017-01-24 11:23:54 -08:00
Michael Krasnyk
e0a1a43449 Added maxspeed:conditional checker 2017-01-24 10:31:59 +01:00
Michael Krasnyk
337ecefa45 Added osrm-extract-conditionals tool 2017-01-24 10:31:59 +01:00
Michael Krasnyk
7961fa8863 Added conditional restrictions grammar 2017-01-24 10:31:59 +01:00
Michael Krasnyk
88eb9e5499 Added opening_hours grammar 2017-01-24 10:31:59 +01:00
Patrick Niklaus
df449d3b5c Merge pull request #3604 from Project-OSRM/update-boost-1.63
Updates Boost to 1.63 for Mason Build
2017-01-24 10:26:16 +01:00
Daniel Patterson
6f27aae022 Squashed 'third_party/mason/' changes from ed32b1d72..6b4c359bc
git-subtree-dir: third_party/mason
git-subtree-split: 6b4c359bca48b576c4a4732b4117130eaafbf6ad
2017-01-23 17:24:22 -08:00
Daniel Patterson
d8c54fb815 Merge commit '6f27aae022fd10bf7f709dae3233134cedc6d550' into update-boost-1.63 2017-01-23 17:24:22 -08:00
Daniel J. Hofmann
5c93609142 Updates Boost to 1.63 for Mason Build 2017-01-23 17:59:29 +01:00
Daniel J. Hofmann
c277b95f03 Implements Zero-Copy String Views onto Contiguous Memory, resolves #3265.
- http://www.boost.org/doc/libs/1_61_0/libs/utility/doc/html/string_ref.html
- http://en.cppreference.com/w/cpp/string/basic_string_view
2017-01-23 15:22:39 +01:00
Michael Krasnyk
b1f1c26703 Remove decltype(Value::source), fixes xcode 7.3 compilation 2017-01-23 15:17:08 +01:00
Daniel J. Hofmann
a5d0707dd0 Removes the -DBUILD_COMPONENTS option; on by default now.
Quick follow up for https://github.com/Project-OSRM/osrm-backend/pull/3570:
there is no reason not to build the `osrm-components` tool by defualt.

Backwards compatible. Users still specifying the option will see:

> Manually-specified variables were not used by the project:
>   BUILD_COMPONENTS
2017-01-23 12:15:03 +01:00
Moritz Kobitzsch
d129b0ef24 remove templates from routing algorithms 2017-01-21 23:59:15 +01:00
Daniel J. Hofmann
f2c3b9859e Rewrites the osrm-components tool to dump GeoJSON, resolves #2176 #1738 #1602
http://bl.ocks.org/d/9d6265b064c0f29a71503e0f6527769d
2017-01-20 17:50:06 +01:00
Michael Krasnyk
bb1f4a025a Merge pull request #3592 from Project-OSRM/merge/libosmium-2.11.0
Merge libosmium 2.11.0
2017-01-20 16:27:38 +01:00
Moritz Kobitzsch
8c36012653 remove CRTP leftovers in search algorithms 2017-01-20 14:11:16 +01:00
Michael Krasnyk
0c6dee4bef Squashed 'third_party/libosmium/' changes from d5ecf4d..c1f34c4
c1f34c4 Release v2.11.0
d3b72e0 Updated change log.
2982b8d Update embedded Protozero to version 1.5.1.
cc1ab2a Add non-const WayNodeList::operator[].
3da372e Add missing example to examples/README.md.
30604ba Add OSMIUM_USE_SLOW_MERCATOR_PROJECTION define.
47a92e0 Clearer CheckOrder handler doc.
f11106d Formatting fixes.
a870737 Use faster implementation of web mercator projection.
041bb42 Test cleanups.
8933bc5 Cleanup *Map::get() functions.
6b989ca Document that (Multipolygon)Collectors only work with unique Ids.
8fb5bd2 Updated included Protozero to version 1.5.0.
76e153d Removed Makefile.
35d7ec9 Update copyright date.
a7f8126 Rename guard define to common scheme.
a923c69 Cleanup I/O tests.
d353993 Add Map::get_noexcept() method for all index maps.
94fa5ac Add const overload for mmap_vector_base::operator[].
3cf9184 Add default constructed "invalid" Coordinates.
358f170 Add Tile constructor from web mercator coordinates.
006aa4c Add index::RelationsMap(Stash|Index) classes.
9cc842e Updated catch to v1.5.9.
bd8c3b6 Use initializer_list trick instead of recursive template.
2c82a6f Merge pull request #183 from daniel-j-h/rvalue-apply
0bf5404 Implements rvalue handler support for apply, resolves #180.
ccaab08 Merge pull request #182 from AMDmi3/freebsd-endianess
bffe626 Handle endianess on FreeBSD properly
7250222 Code formatting and test cleanup.
6652436 Merge pull request #179 from oxidase/add_match_key_std_regex
afadf5b Rename centroid variables and function in example.
8355284 Add envelope() functions to NodeRefList, Way, and Area.
fc83d2e Remove unnecessary include.
9ddd00e Add match_key<std::regex> tag
9c54a53 Update README. Moved some infos to manual.
89a90a6 Update readme and developer docs.
c3446ec Simplify subitem iteration code and made it more flexible.
542b07c Add some static_asserts.
f0fd690 Memory reporting on M68k doesn't work properly.
e8957c6 Compare doubles in test using Approx().
58ae4a6 Add amenity_list example.
53783f8 Fix doxygen config for reproducible builds.
de4e52d Release v2.10.3
0cc42a2 ObjectPointerCollection constructor can't be noexcept.
4472dfb Round out ObjectPointerCollection implementation and test it.
28cb35d Build with XCode 8 and GCC 6 on travis.
03e3e66 Upgrade to new protozero version 1.4.5.
2102c2f Add assertion in queue handling code.

git-subtree-dir: third_party/libosmium
git-subtree-split: c1f34c45507e233a2b9028663906679c610fe179
2017-01-20 14:05:21 +01:00
Michael Krasnyk
66cb75f4a3
Merge commit '0c6dee4befebf823d839d1092bcae79afbf4f12e' into merge/libosmium-2.11.0 2017-01-20 14:05:21 +01:00
Michael Krasnyk
49d3467ec7
Update Libosmium Dependency to 2.11.0 2017-01-20 14:02:12 +01:00
Michael Krasnyk
a48cf58468 Move IPC tools functionality into osrm-datastore 2017-01-20 12:40:37 +01:00
Michael Krasnyk
fbc7189cf8 Added speed round-off error test 2017-01-20 12:31:45 +01:00
Michael Krasnyk
e8167b2e4e Use round for float to fixed coordinate transformations 2017-01-20 12:31:45 +01:00
Michael Krasnyk
c03aa8a273 Regression test for #3516 2017-01-20 12:31:45 +01:00
Huyen Chau Nguyen
a40abacfca Refactors the Turn Handler's Fork Abstraction, resolves #3457. 2017-01-19 19:49:40 +01:00
Moritz Kobitzsch
b8beac2d00 unite process/shared_memory datafacades into a single type using an allocator scheme 2017-01-19 17:18:35 +01:00
Michael Krasnyk
75e0b5a5c4 Fix Lua static library linking 2017-01-19 17:06:00 +01:00
Michael Krasnyk
c03b230e84 Refactor ShMemIterator, resolves #3458 2017-01-19 15:30:18 +01:00
Moritz Kobitzsch
6b06c5bd32 fix emitting invalid turn types, now surfacing due to changes in obvious detection 2017-01-18 15:56:48 +01:00
Moritz Kobitzsch
226ee62981 refactor graph contractor for readability
move to a dedicated dijkstra, separate code and header
reduce heap size, we don't use more than 2000 nodes, so why allocate 170k?
2017-01-18 15:03:15 +01:00
Daniel J. Hofmann
fce3bb180c Provides OSRM_ASSERT_WITH_LOC macros for asserting with location, resolves #3533 2017-01-18 00:43:03 +01:00
Michael Krasnyk
1ae69fe40d Added missing backward_speed for cycleways 2017-01-17 12:51:38 +01:00
Daniel J. Hofmann
e4dc2aa45c Removes Base64 Unit Test Dead Code.
- https://github.com/Project-OSRM/osrm-backend/pull/2139
- 6c9ddde682
2017-01-17 12:50:53 +01:00
Michael Krasnyk
d0f1347ff1 Adjusted number of nodes in annotation, resolves #3515 2017-01-16 23:54:00 +01:00
Patrick Niklaus
70e899378d Replace shmctl with waiting on all on-Linux platforms 2017-01-14 01:14:29 +01:00
Patrick Niklaus
dbd70d4884 Throw exception with more helpful error message when shmctl fails 2017-01-14 01:14:29 +01:00
Michael Krasnyk
71044e88f3 try to fix npm tests on windows by direct data loading 2017-01-14 01:14:29 +01:00
Michael Krasnyk
b8f631f6f6 fake waiting by sleep on windows 2017-01-14 01:14:29 +01:00
Michael Krasnyk
3837f9d015 fix windows build 2017-01-14 01:14:29 +01:00
Patrick Niklaus
763ad0d047 Print warning on Windows that we can't wait for clients 2017-01-14 01:14:29 +01:00
Michael Krasnyk
b6f9ec2a33 make facades const to be consistent with const shmem block 2017-01-14 01:14:29 +01:00
Michael Krasnyk
5d3a348b76 removed stale code 2017-01-14 01:14:29 +01:00
Patrick Niklaus
104e23abf3 Restore --max-wait and file_lock for osrm-datastore 2017-01-14 01:14:29 +01:00
Patrick Niklaus
a7bb26f2d6 Remove unnecessary includes and rename in Engine 2017-01-14 01:14:29 +01:00
Michael Krasnyk
710ba20acc Add 1ms delay as a workaround for "faster" requests than facade update
in osrm-routed
2017-01-14 01:14:29 +01:00
Michael Krasnyk
fce8d72895 Change to condvar signaling if data region swapped 2017-01-14 01:14:29 +01:00
Michael Krasnyk
774b8688ca read_only if shmem size is 0, read_write otherwise 2017-01-14 01:14:29 +01:00
Michael Krasnyk
fe2beb6f68 Respect data constness in Write methods 2017-01-13 22:37:46 +01:00
Michael Krasnyk
71e7d6d6b8 Refactor R-Tree updates and edges loading 2017-01-13 22:37:46 +01:00
Michael Krasnyk
29f736f1c8 Make CSV parsing function generalized 2017-01-13 22:37:46 +01:00
Michael Krasnyk
bb4f13a47c Use internal logger instead of std stream 2017-01-13 19:55:25 +01:00
Moritz Seemann
bb0b03bbce fix: do not check datasource_indexes_path twice
In storage_config.cpp the file paths are validated, but
datasource_indexes_path got validated twice and datasource_names_path
not at all.
2017-01-13 11:12:02 +01:00
Moritz Seemann
59ad7dddb2 make osm_elements a loop variable, not a local variable
The vector osm_elements was created and destroyed in each loop
iteration. It can be kept and cleared instead.
2017-01-13 11:12:02 +01:00
Moritz Seemann
f12fdeb23e some comments for dynamic_graph.hpp 2017-01-13 11:12:02 +01:00
Moritz Seemann
f896aaf881 fix for DeallocatingVector::back
This method actually returned a reference to the one-past-the-last
element instead of the last element.
2017-01-13 11:12:02 +01:00
Moritz Seemann
a2a2cf84d1 fix: do not add duplicate edges
Previously duplicate edges were added if their weight was worse.
2017-01-13 11:12:02 +01:00
Moritz Seemann
4e897aad50 constexpr implies const, no need to state it twice 2017-01-13 11:12:02 +01:00
Moritz Seemann
5e8bdbfa0c fix to prevent (very unlikely) overflow of originalEdges
If originalEdges gets initialized with 1 << 28, it will overflow and
thereby be set to 0.
Which defeats the point of checking for overflows in the first place.
2017-01-13 11:12:02 +01:00
Daniel J. Hofmann
fd57c5b48b Supports destination:street, resolves #3541 2017-01-13 11:07:01 +05:30
Michael Krasnyk
1d4d3b80b5 Fix possible division by zero by clamping latitude to 85.05°
Resolves #3530
2017-01-12 16:44:58 +01:00
Daniel J. Hofmann
f82740ed93 Logs the current thread's id in assertions and for requests, resolves #3534 2017-01-12 16:43:03 +01:00
Moritz Kobitzsch
c1f833c80f fix forks exiting a ferry 2017-01-12 09:58:51 +01:00
Daniel J. Hofmann
813e16b9b4 Fixes default profile symlink not being available
Adaption for b8e13d9b - people are running into this.
2017-01-12 09:34:38 +05:30
Moritz Kobitzsch
06ef3053de fix coordinate assertion for walking profile with steps 2017-01-11 22:44:23 +01:00
Mathias Gug
9fa7e6c74f Add BUILD_PACKAGE option. 2017-01-11 03:09:04 +01:00
Mathias Gug
a7d63283ab Update Package Contact information. 2017-01-11 03:09:04 +01:00
Mathias Gug
78a443bfb2 Add changelog entry. 2017-01-11 03:09:04 +01:00
Mathias Gug
84b8d3cfb9 Support rpm packages. 2017-01-11 03:09:04 +01:00
Daniel J. Hofmann
b3483f95a7 Fixes Sliproads onto a roundabout to be classified as sliproads, resolves #3540 2017-01-09 17:46:05 +01:00
Moritz Kobitzsch
32f63e5e0c add tests for dedicated turn roads 2017-01-09 17:46:05 +01:00
Daniel J. Hofmann
185e9dc7f3 Removes mlock for osrm-routed, closes #3484 2017-01-09 16:25:28 +01:00
Patrick Niklaus
6794f52cb2 Merge pull request #3526 from Project-OSRM/llvm-391
Upgrades LLVM 3.8.1 -> LLVM 3.9.1 on Travis
2017-01-09 16:23:10 +01:00
Daniel J. Hofmann
06e6b9ea6f Squashed 'third_party/mason/' changes from cf3561b..6b4c359
git-subtree-dir: third_party/mason
git-subtree-split: 6b4c359bca48b576c4a4732b4117130eaafbf6ad
2017-01-09 14:26:44 +05:30
Daniel J. Hofmann
93d89ad686 Updates vendored mason to v0.4 for LLVM 3.9.1 2017-01-09 14:26:44 +05:30
Daniel J. Hofmann
7c8176b077 Updates mason to v0.4 in dependency script 2017-01-09 14:26:26 +05:30
Daniel J. Hofmann
7ef95e9918 Upgrades LLVM 3.8.1 -> LLVM 3.9.1 on Travis
LLVM 3.9.1 is now packaged in mason: https://github.com/mapbox/mason/issues/308
Upgrade our Clang compiler to the latest stable release.

Keeps clang-format at 3.8.1 for consistency.
2017-01-09 14:25:34 +05:30
Huyen Chau Nguyen
f313cb9913 Refactor fork handling in guidance (#3264)
refactor fork handler
2017-01-07 14:13:32 +01:00
Moritz Kobitzsch
15c8fd326f Remove assertions that could be triggered by bad data. (#3469)
When two consecutive nodes have identical coordinates, there is no valid
bearing.  For now, make equal nodes have bearing 0.

Full fix still needs to be done via https://github.com/Project-OSRM/osrm-backend/issues/3470.
2017-01-06 17:10:02 -08:00
Daniel Patterson
f7e8581a1b Replace fingerprint with semver-based scheme. (#3467) 2017-01-06 13:45:08 -08:00
Daniel J. Hofmann
c01ea2ea3e Disables link-time optimization unless -DENABLE_LTO=ON is passed.
This disables the `-flto` LTO flag by default since we're seeing
segfaults in compiler lto plugins, binutils and linker errors again and
again for various clang / gcc / binutils combinations.

Pass `-DNEBALE_LTO` to `cmake` in order to re-enable LTO.

LTO situation in short:
- LTO does not work at all for gcc<4.9
- With gcc>=4.9 the "slim" LTO format is getting used dumping IR
- Older binutils need LTO plugins which know how to read this IR
- Recent binutils handle this format all by themselves
- LLVM is more or less the same with some Clang versions segfaulting

If you need the performance benefit of LTO, make sure your compiler and
binutils are up to date and see for yourself if LTO builds work for you.

References:
- https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ
- https://github.com/Project-OSRM/osrm-backend/pull/3481#issuecomment-270618997
- https://github.com/Project-OSRM/osrm-backend/issues/3501
- https://github.com/Project-OSRM/osrm-backend/issues/3441

(and a ton of other LTO tickets if you search for them)
2017-01-06 16:49:49 +01:00
Daniel J. Hofmann
1153b78c06 Fixes various compiler diagnostics
Found with LLVM 3.9.1 and then fixed the most severe categories.
2017-01-06 16:47:52 +01:00
Daniel J. Hofmann
b5d5f309a3 Consider number of lanes to cross, resolves #3025.
Lane Anticipation currently triggers on quick steps with lanes. This
changeset makes the "quick" part more dynamic by taking lanes left and
right of the turn into account. The reasoning for this is as follows.

The user can drive on the leftmost or rightmost lane and has to cross
all lanes left or right of the turn, respecitvely.

We scale our threshold appropriately, which now means the threshold
describes the duration the user needs for crossing _a single lane_.

Note: this is a heuristic and assumes the worst case. Which in my
opinion is fine to do since triggering Lane Anticipation in complex
scenarios is desirable.
2017-01-06 12:44:40 +01:00
Daniel J. Hofmann
5100f2cc7b Guards against no lanes for lanes left and right of turn, resolves #3518 2017-01-06 12:44:02 +01:00
Moritz Kobitzsch
f6fef5c166 refactor graph contraction: flush moved into dedicated function 2017-01-05 16:28:38 +01:00
Daniel J. Hofmann
559c88b36d Adds runtime alignment assertions, see #3267 2017-01-05 16:27:53 +01:00
Michael Krasnyk
7dea7476f1 Removed unused structure and fixed "multi-line comment" warning 2017-01-05 12:59:12 +01:00
Michael Krasnyk
dc81f581a0 [skip ci] Added info to CONTRIBUTING.md about automatic format checks 2017-01-04 17:31:58 +01:00
FILLAU Jean-Maxime
300283d572 Adding a new command line option osrm-extract --with-osm-metadata
This keep the metadata reader flag disabled by default unless explicitly specified.

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-01-04 14:35:45 +01:00
FILLAU Jean-Maxime
aad2124faa Adding nodes's and ways's version access in lua binding.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2017-01-04 14:35:45 +01:00
Michael Krasnyk
aced058c4a Use clang-format from mason 2017-01-04 08:46:16 +01:00
Michael Krasnyk
24ab71a346 Fix c++ formatting 2017-01-04 08:46:16 +01:00
Michael Krasnyk
2640a319c1 Wrap way.nodes() returned reference into sol::as_table 2017-01-04 08:29:27 +01:00
Moritz Kobitzsch
e6ff17ab2a refactor merging of segregated roads
adjust to generalFindMaximum function
moved parallel detection to ratio/absolute based regression testing
considerably improved detection quality using normalised regression lines
only follow initial direction/narrow turns for parallel detection
2017-01-03 12:32:51 +01:00
Patrick Niklaus
f7ad2e1e26 Don't retain SharedDataFacade between queries (#3485)
* Don't retain SharedDataFacade between queries

* More caching code
2017-01-03 12:06:55 +01:00
Daniel J. Hofmann
2ed6b181c8 Reworks the Readme Landing Page 2017-01-03 11:06:07 +01:00
Michael Krasnyk
f48bbb78de Enable npm and library tests on windows 2017-01-03 10:24:48 +01:00
Michael Krasnyk
bd2a5ebe10 Don't report error if osrm-routed was killed by js script 2017-01-03 10:24:48 +01:00
Michael Krasnyk
f8499957fa Unhandled exceptions lead to error 0xC0000409 on windows 2017-01-03 10:24:48 +01:00
Michael Krasnyk
5db134bbba Help strings may contain windows extensions 2017-01-03 10:24:48 +01:00
Michael Krasnyk
8645d8c7fc Make osrm::util::range a model of SinglePassRangeConcept
References:
- http://www.boost.org/doc/libs/1_63_0/libs/range/doc/html/range/concepts/single_pass_range.html
2017-01-03 10:22:03 +01:00
Daniel J. Hofmann
b8e13d9b1b Removes Profile Symlink 2017-01-03 10:14:51 +01:00
Jihyun Yu
421caa1856 Fix copying vector on std::sort comparator (#3504) 2016-12-30 13:57:21 -08:00
Michael Krasnyk
ed9d10e96c Tests for profile API version 2016-12-23 15:02:10 +01:00
Patrick Niklaus
0f3a463854 Add api_version gloabal variable to profiles
Currently only `0` is supported (the default).
2016-12-23 15:02:10 +01:00
Moritz Kobitzsch
b9b52cb857 clean-up unused headers, use NoTurn for ferries instead of suppressed 2016-12-23 15:01:02 +01:00
Daniel J. Hofmann
9af67c5a9f Refactors Karen's work a bit 2016-12-23 15:01:02 +01:00
karenzshea
8ffe915395 do not emit turns on ferries 2016-12-23 15:01:02 +01:00
Michael Krasnyk
b376c97db8 Join LAYOUT and DATA shared memory blocks into REGION 2016-12-23 11:56:22 +01:00
Daniel J. Hofmann
7b11cd3a11 Makes Types in Squared Dist Calculation Explicit, see #3483. 2016-12-22 15:43:04 +01:00
Michael Krasnyk
76de3b6ace Make a hard reset of named barrier mutexes on signal 2016-12-22 15:13:12 +01:00
Moritz Kobitzsch
bc081b7132 refactor route step / intermediate intersections
rename intersection (engine version) to IntermediateIntersection
follow coding convention for existing functions, move invalidate into routeStep
moved elongate into route step
move forward-step-signage into route step
replace post-processings `forwardInto` with `RouteStep` functionality. Don't change maneuver in step
separete declaration and implementation
2016-12-22 08:33:27 +01:00
Patrick Niklaus
3cbac0f012 Revert "Smarter search radius formula for map matching"
This reverts commit b73c59088c.
2016-12-21 22:41:48 -08:00
Patrick Niklaus
f40b34af9d Revert "Fix capture"
This reverts commit 4f81e31d63.
2016-12-21 22:41:42 -08:00
Patrick Niklaus
cc14fb8bff Revert "Hardcode search radius parameters"
This reverts commit 2c9e18d5a9.
2016-12-21 22:41:34 -08:00
Patrick Niklaus
c5e3fa916f Revert "Fix call to std::min"
This reverts commit 8bb183bc8c.
2016-12-21 22:41:22 -08:00
Moritz Kobitzsch
dff7fe214b don't assign exit in arrive when ending in roundabout 2016-12-21 17:48:23 +01:00
Michael Krasnyk
3b2ca720a8
Revert "Make a hard reset of named barrier mutexes on signal"
This reverts commit df4231341f.
2016-12-21 13:48:16 +01:00
Michael Krasnyk
df4231341f
Make a hard reset of named barrier mutexes on signal 2016-12-21 13:37:16 +01:00
Moritz Kobitzsch
0a2f934c87 add test for falsely classified obvious turn (#3364) 2016-12-20 11:55:10 -08:00
Moritz Kobitzsch
3721f8c887 test showing failure to unpack route with u-turns at both ends 2016-12-20 17:41:43 +01:00
Moritz Kobitzsch
1ba5ff44cc reduce warnings when compiling tests, add constructor to base parameters, fixes gcc49 unit tests building 2016-12-19 14:24:17 -05:00
Daniel J. Hofmann
5ecd2e4c67 Fixes GCC 4.9's protected keywork issues 2016-12-19 14:22:17 +01:00
Daniel J. Hofmann
b1f6797aab Adds generate_hints=true for dropping hints in response, resolves #1789.
Adds an `generate_hints=false` option which lets us skip generating and
emitting hints for Waypoints. This can be used to decrease the response
size when the user does not need hints anyway.

We should think about making `false` the default here in v6.
2016-12-19 12:09:36 +01:00
Moritz Kobitzsch
f04d146ca3 improve ascii art reflecting tunnels 2016-12-19 09:57:34 +01:00
Kajari
8c50a42ec4 add ascii art to a set of tests 2016-12-19 09:57:05 +01:00
Patrick Niklaus
c4b3cdfd80 Fix changing shared memory in multi-process setup (#3462)
This change fixes two bugs:

1. A dead-lock that occurs between osrm-datastore and libosrm when an
   old dataset is free during a data update. This happened because the
   mutexes where acquired in a different order.

2. A region is deleted eventhough it is still in use. This happens when
   libosrm gets overtaken by osrm-datastore, so the new dataset is in
   the same region the old one was.
2016-12-16 13:50:17 -08:00
FILLAU Jean-Maxime
37051e1583 Adding the location validity access for lua scripting.
Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
2016-12-16 16:02:24 +01:00
Daniel Patterson
d3ef993d5f Bump SOL2 to v2.15.5 to fix OSX compilation problems. 2016-12-16 10:13:33 +01:00
Patrick Niklaus
9832825abd Merge pull request #3451 from Project-OSRM/update/mason
Update mason to v0.3.0 and change update script
2016-12-15 14:28:14 +01:00
Moritz Kobitzsch
d584bcad11 fix roundabout handling with lanes
instead of artificially removing lanes from a roundabout, we don't assing them in the first place.
this also prevents a problem where we would end up collapsing turns with lanes in a roundabout
2016-12-15 13:07:26 +01:00
Daniel J. Hofmann
e48ca65af4 Advanced Roundabouts
These kind of roundabouts came up during Lane Handling for roundabouts.
They're called Turbo-roundabouts or Turbine-roundabouts and are very
popular e.g. in Germany and the UK.

Seems like our roundabout handler sometimes is getting confused.

Trying to figure out why, and codifying some scenarios for cucumber.

References:
- https://github.com/Project-OSRM/osrm-backend/pull/2693
2016-12-15 13:07:26 +01:00
Michael Krasnyk
f429e08851 Enforce Boost>=1.62 for MSVC
Reference:
https://github.com/Project-OSRM/osrm-backend/issues/3088#issuecomment-256485167
2016-12-15 12:47:50 +01:00
Daniel J. Hofmann
de062d4ca3 Explain Workaround for Broken Setups to Users 2016-12-15 12:47:50 +01:00
Daniel J. Hofmann
d83ab9d905 Enforces Boost>=1.54 requirement with CMake 2016-12-15 12:47:50 +01:00
Daniel J. Hofmann
4618b502ac Enforces GCC>=4.9 and Clang>=3.4 requirement with CMake 2016-12-15 12:47:50 +01:00
Daniel J. Hofmann
94854b5c90 Adds barrier=gate regression tests, see #581 2016-12-15 12:03:24 +01:00
Patrick Niklaus
f8dd965435 Squashed 'third_party/mason/' content from commit cf3561b
git-subtree-dir: third_party/mason
git-subtree-split: cf3561bf78cb146821dba3d95c308fc44db05f46
2016-12-15 10:31:15 +00:00
Patrick Niklaus
6e29f9889b Merge commit 'f8dd96543542220181c76afb8c084f4908213fb5' as 'third_party/mason' 2016-12-15 10:31:15 +00:00
Patrick Niklaus
48d4e91d98
Change the update script to allow recreation 2016-12-15 10:30:51 +00:00
Patrick Niklaus
708ac04562
Remove old mason 2016-12-15 10:28:43 +00:00
Patrick Niklaus
38b2ad298d
Update mason to 0.3.0 2016-12-15 10:28:43 +00:00
Daniel Patterson
a51ef67db8 Use common function for clamping logic for all user-visible bearings. 2016-12-15 10:59:17 +01:00
Moritz Kobitzsch
67ce19cb14 fix problem at the source 2016-12-15 10:59:17 +01:00
Daniel Patterson
1b51163b1d Clarify API and ensure bearings returned to users are in the range 0-359 2016-12-15 10:59:17 +01:00
Michael Krasnyk
84b618ed1a Add headers consistency check 2016-12-15 10:58:17 +01:00
Moritz Kobitzsch
dc8e6bd8d9 use correct type in graph contractor to avoid overflows in nodes 2016-12-15 10:56:07 +01:00
karenzshea
68e38880df switch back to lua based env naming 2016-12-15 10:55:16 +01:00
karenzshea
d5904d5756 increase template depth on clang and gcc builds 2016-12-15 10:55:16 +01:00
Daniel J. Hofmann
0f59b78c02 Rewrite lua bindings using sol interface 2016-12-15 10:55:16 +01:00
Daniel J. Hofmann
6e7fe5feb0 Clean plate: luabind ripped out and sol2 basic integration 2016-12-15 10:55:16 +01:00
Daniel Patterson
3dfbf42e61 Don't mark all lanes as designated when there are blank lane specifiers in the tag. 2016-12-15 10:55:16 +01:00
Daniel Patterson
f88f51fd98 Log some memory usage statistics after preprocessing tasks. 2016-12-13 21:59:12 +01:00
Daniel J. Hofmann
98659fb0a0 Adds failing tests for directional access overrides, discovered in #3345 2016-12-13 17:37:42 +01:00
Daniel J. Hofmann
8a1afe456f Works around Unreachable Warning for Debug Build 2016-12-13 12:41:25 +01:00
Patrick Niklaus
f1384f5e44 Merge pull request #3434 from Project-OSRM/fix/invalid-assertions
fix invalid assertion in coordinate_extractor
2016-12-12 19:19:47 +01:00
Moritz Kobitzsch
1cd5394a16 fix invalid assertion in coordinate_extractor 2016-12-12 10:12:32 +01:00
Daniel Patterson
8c7f744b1a Update node weights if traffic data is applied. 2016-12-11 16:02:58 +01:00
Patrick Niklaus
896445a337
Fix path to node binaries 2016-12-09 16:43:32 +00:00
Patrick Niklaus
8c21e1267e
nvm -> install_node 2016-12-09 16:30:14 +00:00
Patrick Niklaus
ad3fd46da5
Try to use mapbox node mirror 2016-12-09 15:28:28 +00:00
Huyen Chau Nguyen
62f0e11bfa assert that there is an open logger file when trying to log geojson output (#3417) 2016-12-09 14:58:20 +01:00
Patrick Niklaus
03d653c0bb Fix removing shared memory segments in a multi-process setup 2016-12-09 12:18:05 +01:00
Daniel J. Hofmann
cbfb055f81 Changes Single Coordinate Geoms from Point to LineString, closes #3425. 2016-12-09 11:53:06 +01:00
Moritz Kobitzsch
2288704bb5 don't assign unused name to exception 2016-12-08 13:35:28 +01:00
Daniel J. Hofmann
97dcf4eef9 Fixes Compiler Crashes on Windows 2016-12-08 13:23:21 +01:00
Daniel Patterson
17e15033e1 Log helpful error message if mmap fails. 2016-12-07 22:03:49 +01:00
Daniel J. Hofmann
875f482203 Refactors and improves the Sliproad Handler, resolves #3109 2016-12-07 19:22:03 +01:00
Moritz Kobitzsch
df3c39cef5 clean-up guidance code/code in general
removes duplicated includes
removes unused includes
eliminates dedicated toolkits that resulted in circular dependencies
moves functionality close to data, where possible
2016-12-07 12:10:56 +01:00
Moritz Kobitzsch
a28a20a1ba fix errors in coordinate extractor due to duplicated coordinates
fix offset calculation in curve detection
2016-12-07 11:33:58 +01:00
Daniel Patterson
17a18b5c7c Revert "Add simple code review checklist to PR template."
This reverts commit 3f07a830e6.
2016-12-06 17:21:38 -08:00
Daniel Patterson
423c083038 Refactor logging, improve error handling workflow, clang-format. (#3385) 2016-12-06 12:31:13 -08:00
Daniel Patterson
468d8c0031 Refactor logging, improve error handling workflow, clang-format. (#3385) 2016-12-06 12:30:46 -08:00
Pepijn Schoen
6f4c6e84ae Handle file output through a FileWriter, align interfaces for FileWriter and FileReader 2016-12-06 15:59:12 +01:00
Michael Krasnyk
4b1aae40af Decoding should not fail for incomplete polyline strings (#3404)
Possible fails in
1) correct lattitude, longitude is missing
2) no end-of-number (0 5th bit) marker in the last character
2016-12-06 14:09:18 +01:00
Daniel J. Hofmann
0e6863aec1 Removes access and service restriction list from bike and foot profile 2016-12-05 14:15:47 +01:00
Daniel J. Hofmann
949d505783 Removes access_restricted flag internally 2016-12-05 14:15:47 +01:00
Emil Tin
d11927046f car profile: remove use of is_access_restricted flag 2016-12-05 14:15:47 +01:00
Emil Tin
9461c83511 car profile: handle forward/backward access 2016-12-05 14:15:47 +01:00
Emil Tin
532cbfce13 profiles: Directional helper, some car refactoring 2016-12-05 14:15:47 +01:00
Michael Krasnyk
0fbd18b0dd Make absolute fixtures path 2016-12-04 16:34:42 +01:00
Daniel Patterson
3f07a830e6 Add simple code review checklist to PR template.
Add some checkboxes for common, mechanical parts that we should aim to hit for all PRs.
2016-12-02 23:18:57 -08:00
Moritz Kobitzsch
24b01fae00 fix extraction of coordinate along a way (#3397)
Also fix interpolation when coordinates are duplicated at the end of the vector
2016-12-02 13:11:04 -08:00
Daniel Patterson
0817cd6dfd Enforce iteration order so that tiles are encoded consistently on all platforms (#3393) 2016-12-02 08:59:39 -08:00
Daniel J. Hofmann
9d8b92f418 Abstracts away over differences in IntersectionView and Intersection.
Usage:

    struct MyIntersection : EnableIntersectionOps<MyIntersection> {

    };

Done.

We require MyIntersection having at least the member attributes from
IntersectionViewData but don't enforce a inheritance hierarchy.
2016-12-02 12:32:07 +01:00
Daniel Patterson
928a6f0c7d Variant got re-packaged, need to update search paths. (#3392) 2016-12-01 16:59:29 -08:00
Daniel Patterson
29b3caf529 Upgrade to mapbox/variant 1.1.4 2016-12-01 15:44:27 -08:00
Patrick Niklaus
20c8ac0272
Bump osrm version to 5.5 2016-12-01 22:12:28 +00:00
Patrick Niklaus
c99c8bccbc Make the binutil detection work the same for clang and gcc
This uses the cmake internal find_program that will utilize the PATH at
configuration time. This way we don't need to pass CXXFLAGS to clang.
2016-12-01 21:55:17 +01:00
Patrick Niklaus
735191255d No need to set ccache explicitly if its in the path 2016-12-01 21:55:17 +01:00
Dane Springmeyer
da6ca640a7 only install/enable binutils gold and llvm-ar when building in Release 2016-12-01 21:55:17 +01:00
Dane Springmeyer
f6f7a9290f no need for llvm package 2016-12-01 21:55:17 +01:00
Dane Springmeyer
9687a9325c remove llvm-nm 2016-12-01 21:55:17 +01:00
Dane Springmeyer
43566bfd14 support -flto with clang++ 2016-12-01 21:55:17 +01:00
Michael Krasnyk
110e6c3689 Fix failing on windows io read test (#3390) 2016-12-01 11:44:28 -08:00
Moritz Kobitzsch
561b7cc58e Rember Intersection Shapes
Changes the processing order in the edge based graph factory.
Instead of iterating over all outgoing edges in order, we compute the edge
expanded graph in the order of intersections.
This allows to remember intersection shapes and re-use them for all possible ingoing edges.

Also: use low accuracry mode for intersections degree 2 intersections

We can use lower accuracy here, since the `bearing`
after the turn is not as relevant for off-route detection.
Getting lost is near impossible here.
2016-12-01 15:24:20 +01:00
Moritz Kobitzsch
5775679f64 fix coordinate extraction / errors in offset detector 2016-12-01 12:16:25 +01:00
Daniel Patterson
560d8ffec0 Restructure API docs so that they can be formatted with Docbox. (#3355)
Generate Docbox browseable HTML with `npm run build-api-docs`
2016-11-30 19:38:53 -08:00
Daniel Patterson
2544c3f20e Update changelog for FileReader change. 2016-11-30 19:10:44 -08:00
Daniel Patterson
5a311012af Consolidate file reading through the new FileReader class/interface. (#3321) 2016-11-30 19:08:01 -08:00
Karen Shea
ef087f963d Merge pull request #3324 from Project-OSRM/constrain-staggering
Constrain staggered intersection detection by mode change and intermediary intersections
2016-11-30 07:35:17 -05:00
Moritz Kobitzsch
a1127c3e09 reduce numbers of intersections in findNextIntersection, don't normalise for turn lanes 2016-11-30 10:21:53 +01:00
Patrick Niklaus
01a57ff1d8 Merge pull request #3367 from Project-OSRM/fix/rpath4all
Rework RPATH and building as subproject
2016-11-29 23:02:57 +01:00
karenzshea
37824e2954 don't staggered intersections on intermediary mode changes 2016-11-29 14:39:16 -05:00
Patrick Niklaus
4489c8dfc2
Expose LibOSRM find_package style variable to work as subproject 2016-11-29 15:38:51 +00:00
Patrick Niklaus
ee63e39ff5
Add $ORIGIN and @executable_path to RPATH 2016-11-29 15:37:11 +00:00
karenzshea
ce5bcc797b opening typo 2016-11-29 09:39:05 -05:00
Daniel J. Hofmann
fe5cc55b0e support junction = circular in all profiles, add additional tests
References:
- https://wiki.openstreetmap.org/wiki/Tag:junction%3Dcircular
- https://lists.openstreetmap.org/pipermail/tagging/2016-November/030520.html
- https://github.com/Project-OSRM/osrm-backend/issues/3361
2016-11-29 13:44:32 +01:00
Moritz Kobitzsch
12d58ace10 add support for junction=circular, allowing named circular junctions to be treated as rotaries 2016-11-29 13:44:32 +01:00
Moritz Kobitzsch
4636aaabfe make can be ignored false by default 2016-11-29 11:47:35 +01:00
Moritz Kobitzsch
186cc8340a handle service roads next to roundabouts - ambiguous exit... :( 2016-11-29 11:47:35 +01:00
Michael Krasnyk
e343f71541 Refactor Hilbert values computation 2016-11-28 14:17:12 +01:00
Michael Krasnyk
0df0d31d83 Fix nodes file reading in rtree benchmark 2016-11-28 14:17:12 +01:00
Moritz Kobitzsch
aaf42a1caf add a follow-up section on testing to help decide what to do on guidance tests 2016-11-24 10:12:14 +01:00
Moritz Kobitzsch
d02dd67e95 fix update to length cache 2016-11-23 11:27:59 +01:00
Moritz Kobitzsch
a49bd70985 add low precision intersection_generator mode for faster graph traversal 2016-11-22 18:25:19 +01:00
Dane Springmeyer
b2c27fbd25 test xcode8.2 2016-11-22 18:03:51 +01:00
karenzshea
9fe0e91d92 add tests for bridleways 2016-11-22 10:18:55 +01:00
Daniel J. Hofmann
08b7270f5c Fixes accidentally registering types twice to Luabind, closes #2811. 2016-11-22 10:09:08 +01:00
Kajari Ghosh
fc52dd85fe refactor graph_loader (#3333)
Refactors the GraphLoader class to use the safer FileReader wrapper for better error handling.
2016-11-21 17:32:00 -08:00
Karen Shea
6d961d4a15 Merge pull request #3217 from Project-OSRM/refactor/obviousness
Refactor find obvious turn handling
2016-11-21 14:50:44 -05:00
karenzshea
0bd08224bf add comments, refactor find obvious turn 2016-11-21 13:16:30 -05:00
Daniel J. Hofmann
2a383efbf6 Makes Throughput Numbers Integral Types 2016-11-21 12:41:25 +01:00
Patrick Niklaus
b84d70d305 Add regression test for nil values 2016-11-21 12:17:44 +01:00
Patrick Niklaus
3bade8625f Don't crash on assigning nil to a string in lua 2016-11-21 12:17:44 +01:00
Patrick Niklaus
844300b95a Print number of used jobs 2016-11-19 17:02:31 +01:00
Patrick Niklaus
dd811539a3 Remove overriding c++ compiler from cmake on mason build 2016-11-19 17:02:31 +01:00
Patrick Niklaus
79c2ae46d8 Determine number of jobs over ncpu + 1 2016-11-19 17:02:31 +01:00
Patrick Niklaus
d023e7c581 Don't use mason clang on OSX 2016-11-19 17:02:31 +01:00
Patrick Niklaus
4ccb08983f Fixed installing clang for mason builds 2016-11-19 17:02:31 +01:00
Patrick Niklaus
8c941d1344 Don't install clang when CLANG_VERSION is not set 2016-11-19 17:02:31 +01:00
Patrick Niklaus
841c032a0d Don't warn in example on 32bit only print message 2016-11-19 17:02:31 +01:00
Patrick Niklaus
a764fd1f29 Don't expose all OSRM flags only the ones needed by external code 2016-11-19 17:02:31 +01:00
Patrick Niklaus
3687864cc1 Only run OSX in release 2016-11-18 17:49:05 +01:00
Dane Springmeyer
4b5466629f test with assertions+release on travis 2016-11-18 17:49:05 +01:00
Patrick Niklaus
f19bf70b55 Account for imprecision in distance computation 2016-11-18 17:46:32 +01:00
Patrick Niklaus
24fa94af59 Remove obsolete test code 2016-11-18 17:46:32 +01:00
Patrick Niklaus
95a584a30d Make rounding when computing PhantomNode weight symmetric
Resolves a problem where the duration in forward and backward direction
was slightly different.
2016-11-18 17:46:32 +01:00
karenzshea
6ba36a2bc7 test and control for pushing both ways 2016-11-18 10:13:38 -05:00
karenzshea
039989a339 fix overlapping roads 2016-11-18 09:58:03 -05:00
karenzshea
a7559077a0 add modes columns to bike tests 2016-11-18 09:21:48 -05:00
Daniel J. Hofmann
bbe80192aa Staggered Intersections for Bike 2016-11-18 08:52:48 -05:00
karenzshea
9b16b757a4 halfway staggered intersection test 2016-11-18 08:52:48 -05:00
karenzshea
3680fc9d90 add check/test for intermediary intersections 2016-11-18 08:52:47 -05:00
karenzshea
836e8bdff0 don't collapse with mode changes 2016-11-18 08:52:47 -05:00
Patrick Niklaus
3d4b39be7d Include changed car.lua dependencies in changelog 2016-11-18 00:21:34 +01:00
Emil Tin
193dfd9d8b lua: add changelog item 2016-11-18 00:21:34 +01:00
Emil Tin
305e813489 lua: improve naming 2016-11-18 00:21:34 +01:00
Emil Tin
a5756fc764 fix c++ formatting 2016-11-18 00:21:34 +01:00
Emil Tin
f5bf788814 lua: simplify destination helper 2016-11-18 00:21:34 +01:00
Emil Tin
00f7d7776d lua: refactor destination helper 2016-11-18 00:21:34 +01:00
Emil Tin
dce685c780 ensure we don't pass empty tags to LUA 2016-11-18 00:21:34 +01:00
Emil Tin
173a39fd8b lua: fix typo 2016-11-18 00:21:34 +01:00
Emil Tin
5d564ee510 lua: Set and Sequence 2016-11-18 00:21:34 +01:00
Emil Tin
24c2708d1e lua: eliminte tag cache, simplify tag checks 2016-11-18 00:21:34 +01:00
Emil Tin
d87a972c66 don't return empty tags strings to lua 2016-11-18 00:21:34 +01:00
Emil Tin
f90736b6b3 lua: handle_hov() 2016-11-18 00:21:34 +01:00
Emil Tin
9aeb3086cb lua: cleanup handle_blocking(), move common cases up early 2016-11-18 00:21:34 +01:00
Emil Tin
9e361a8178 lua: exit earlier when possible 2016-11-18 00:21:34 +01:00
Emil Tin
c3aeef4e09 lua: eliminate TagCache.set_tag() 2016-11-18 00:21:34 +01:00
Emil Tin
50090e6447 lua: some cleanup 2016-11-18 00:21:34 +01:00
Emil Tin
b9e5d26e3a remove dead code 2016-11-18 00:21:34 +01:00
Emil Tin
184cfab33b increase performance by passing vars instead of a table 2016-11-18 00:21:34 +01:00
Emil Tin
fd95b2da76 streamline way_function 2016-11-18 00:21:34 +01:00
Emil Tin
ce04a608b8 lua: refactor car.lua into smaller functions 2016-11-18 00:21:34 +01:00
Emil Tin
cff69178e8 lua: simple tag cache enabling factoring way_function into smaller functions 2016-11-18 00:21:34 +01:00
Emil Tin
6c682b2258 lua: helpers for debugging 2016-11-18 00:21:34 +01:00
Alex Barth
c1087eaecc Update http.md 2016-11-17 23:59:18 +01:00
Kerrick Staley
8bb183bc8c Fix call to std::min 2016-11-17 17:56:23 +01:00
Kerrick Staley
15359befdc Update docs 2016-11-17 17:56:23 +01:00
Kerrick Staley
2c9e18d5a9 Hardcode search radius parameters 2016-11-17 17:56:23 +01:00
Kerrick Staley
4f81e31d63 Fix capture 2016-11-17 17:56:23 +01:00
kerrick-lyft
b73c59088c Smarter search radius formula for map matching 2016-11-17 17:56:23 +01:00
Michael Krasnyk
44e4728bde Added gcc 4.9 release build 2016-11-17 16:02:56 +01:00
Michael Krasnyk
ba2629456f Added a copy of std::align due to missing implementation in gcc < 5
References:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350
2016-11-17 16:02:56 +01:00
Daniel J. Hofmann
1b4779a58c Avoids Shuffling Data Around for Nothing, closes 3306 2016-11-17 12:51:18 +01:00
Michael Krasnyk
1eaf9f3269 Fix ubsan runtime error: left shift of negative value -9 2016-11-16 12:12:20 -08:00
Daniel J. H
73e365d398 Conditionally checks std::is_trivially_copyable only if available. (#3327) 2016-11-16 12:07:45 -08:00
Michael Krasnyk
d5bf508046 Fix alignments in shared facade via alignof/std::align 2016-11-16 18:20:19 +01:00
Moritz Kobitzsch
47b097038a fixes warning due to type only used in debug 2016-11-16 12:20:05 +01:00
Moritz Kobitzsch
a4264c7849 fix node-based-graph-walker 2016-11-16 12:03:59 +01:00
Daniel J. H
463228d0bf Merge pull request #3323 from Project-OSRM/libosmium-2.10.2
Osmium 2.10.2, resolves #3303
2016-11-16 12:01:56 +01:00
Daniel J. Hofmann
6f885b5bdb Squashed 'third_party/libosmium/' changes from 40c4a48..d5ecf4d
d5ecf4d Release v2.10.2
7c04564 Update embedded protozero to version 1.4.4.
e209d81 Write code for 64bit systems, so it compiles on 32bit w/o warning.
640217c Fix buffer overflow.
8b4620f Release v2.10.1
38bf3ab Update protozero to 1.4.3.
f81b3c6 Fix IdSet on 32 bit.
5ff4753 Workaround so the test works on 32bit systems.
7542694 Include our endian.hpp before using the endianness test macros.

git-subtree-dir: third_party/libosmium
git-subtree-split: d5ecf4df90e2995c816886d2a002c3d3de7062ee
2016-11-16 11:33:59 +01:00
Daniel J. Hofmann
1dde5d288d Merge commit '6f885b5bdb2d220eb49e7d0fabcd520f56f2b419' into libosmium-2.10.2 2016-11-16 11:33:59 +01:00
Daniel J. Hofmann
820feb3a04 Update Libosmium Dependency Script to 2.10.2 2016-11-16 10:58:52 +01:00
Daniel Patterson
46b00e1378 Update docs for tile plugin. 2016-11-15 18:56:03 -08:00
Daniel Patterson
eb12c16fd6 Output newlines for each progress indicator when not on a tty. 2016-11-15 18:14:05 -08:00
Daniel Patterson
17c32f5ce7 Fully revert 04f8b653c94614 2016-11-15 16:55:02 -08:00
Daniel Patterson
53ef2e2955 Use an enum type for the 'should read fingerprint' flag, rather than a mysterious boolean
Fix tests.
2016-11-15 16:55:02 -08:00
Daniel Patterson
7b1131b982 Consolidate vector deserialization. 2016-11-15 16:55:02 -08:00
Daniel Patterson
1fc969e6c8 Fix naming convention, and pass-by-reference for data layout. 2016-11-15 16:55:02 -08:00
Daniel Patterson
49f960064c Partial revert of 04f8b653c94614 - the PackedVector is special. 2016-11-15 16:55:02 -08:00
Daniel Patterson
83a9d0590d Pass-by-reference instead of pointer. 2016-11-15 16:55:02 -08:00
Daniel Patterson
d8b016b92a Simplify read error detection. 2016-11-15 16:55:02 -08:00
Daniel Patterson
608044305d Rename the datafacades to more clearly describe what they do. 2016-11-15 16:55:02 -08:00
Daniel Patterson
4760b85930 Add checking assertions for all copy operations. 2016-11-15 16:55:02 -08:00
Daniel Patterson
9e2782d923 Fix undefined behaviour - we were referring to two different temporaries. 2016-11-15 16:55:02 -08:00
Daniel Patterson
2dfeb0cabc Remove unused code. 2016-11-15 16:55:02 -08:00
Daniel Patterson
2f9b5788d0 Destructor should fail hard if an exception is raised. 2016-11-15 16:55:02 -08:00
Daniel Patterson
be496eb4e3 Return the type we claim it will return. 2016-11-15 16:55:02 -08:00
Daniel Patterson
97244557b1 Don't need to use new, make_unique<> can do what we need here. 2016-11-15 16:55:02 -08:00
Daniel Patterson
e2e5eb0169 Remove use of ShM<>::vector in favour of the boost::iterator_range 2016-11-15 16:55:02 -08:00
Daniel Patterson
6949d7ee5b Remove ownership of block pointers from base class. 2016-11-15 16:55:02 -08:00
Daniel Patterson
02303904b8 Update changelog. 2016-11-15 16:55:02 -08:00
Daniel Patterson
4ad6d88888 Refactor file loading to use a common class that has proper error handling. 2016-11-15 16:55:02 -08:00
Daniel Patterson
e226b52f21 const-ify things, use RAII for file closure, and start to use io:: to read some stuff. 2016-11-15 16:55:02 -08:00
Daniel Patterson
b1125b7f1f Rename base class to something more in line with it's actual function. 2016-11-15 16:55:02 -08:00
Daniel Patterson
33ff92d27e Remove debugging code. 2016-11-15 16:55:02 -08:00
Daniel Patterson
de4fd76d57 Clean up some todo notes. 2016-11-15 16:55:02 -08:00
Daniel Patterson
bf6df74d44 Consolidate datafacade file loading logic.
Both datafacades now use a single large memory block and common
file loading logic.
2016-11-15 16:55:02 -08:00
Daniel J. Hofmann
8f6dd805e5 Fixes ODR Violation in Graph Loader, closes #3308 2016-11-15 12:04:13 +01:00
Patrick Niklaus
3235f30a98
[skip ci] clarify release branches 2016-11-14 23:21:48 +00:00
Daniel J. Hofmann
7e4020c010 Allocates memory for the node info list upfront.
Turns out we were not doing this. Huh.

Callstack:
- 78583d2c8c/include/util/graph_loader.hpp (L65-L68)
- 538bbd47d1/src/extractor/extractor.cpp (L423-L424)
- 78583d2c8c/src/extractor/extractor.cpp (L465-L466)
- 78583d2c8c/src/extractor/extractor.cpp (L254-L261)
2016-11-15 00:06:52 +01:00
Moritz Kobitzsch
538bbd47d1 fix length limited graph walker 2016-11-14 18:38:15 +01:00
Moritz Kobitzsch
78583d2c8c fix getTurnDirection, widen straight range, adjust tests accordingly 2016-11-14 11:09:14 +01:00
Dane Springmeyer
fa1a0a1325 Ensure pkg-config reports OSRM_LIB_LINKER_FLAGS 2016-11-12 14:35:32 +01:00
Dane Springmeyer
6df1437cfc drop md5sum dependency, depend on node.js script 2016-11-12 02:48:13 +01:00
Dane Springmeyer
15ed53d4a7 install ccache/cmake via consistent method 2016-11-12 02:48:13 +01:00
Dane Springmeyer
63be191775 speed up osx builds by avoiding homebrew 2016-11-12 02:48:13 +01:00
Moritz Kobitzsch
6ec505281e fix edge discovery in tile plugin 2016-11-12 02:15:04 +01:00
Patrick Niklaus
5a293e891b Merge pull request #3296 from Project-OSRM/libosmium-2.10.0
Osmium 2.10
2016-11-12 02:12:49 +01:00
Michael Krasnyk
b57169e221 Flush stxxl vectors before using in PrepareData 2016-11-12 02:09:51 +01:00
Lev Dragunov
045d25041f Review fixes. 2016-11-12 02:05:48 +01:00
Lev Dragunov
170923874b Add request duration to routed logs. 2016-11-12 02:05:48 +01:00
Dane Springmeyer
8137e95fbb Merge pull request #3274 from Project-OSRM/customize-tool-root
Improve support for customized build directory
2016-11-11 13:54:11 -08:00
Daniel J. Hofmann
0375af197d Skips OSM object metadata reading, closes #3278 2016-11-11 16:35:57 +01:00
Daniel J. Hofmann
babbda98a6 Squashed 'third_party/libosmium/' changes from 80df1d6..40c4a48
40c4a48 Release v2.10.0
6addb2e Search for protozero also in the place where libosmium was found.
9c0d4bb Consistently use lhs and rhs as parameter names in operators etc.
6179759 Update change log.
894eb7d Explicitly use size_t to get no narrowing conversions.
e549e73 Fix CMake config for index_lookup.
ccf0bc2 Fix bug where some compilers deduce the wrong type.
fc3507d Cleaned and documented index example and renamed to osmium_index_lookup.
d3c3036 Rename serdump example to dump_internal and document it.
0e9822e Also forward set_uid_from_signed() function.
29ef95c Rename build_taglist function because it was to similar to build_tag_list.
c088dd0 Move static constant out of class so clang will compile it.
606cdc4 Fix CMake build script: Path for finding libosmium.
65f91fe Removed unused typedef.
07174f5 Use condition_variable to tell producer when thread queue is not full.
b35e957 Some code cleanup in XML parser.
c703dff Fix problem with MemberMeta.
1ccbbef Refactoring CompressionFactory.
6561bd6 Use our own exception type for map factory errors.
56e31fa Throw not_found error directly instead of using helper function.
28230c3 Test empty value for node location store, reorganize tests.
2ba316c Reorganize and fix projection tests.
f949485 Don't run quite as many tests with projections because they are slow.
1bad16d Add information about build environment to benchmark output.
99617bb Change proj_geojson benchmark into mercator benchmark.
553b946 Allow optional parameters on Reader in any order.
dcc3d8f Factor out some common code.
004d8cd Fix forwarding constructor.
9702978 Fix metadata check.
6cfb6c4 Faster implementation of decode_dense_nodes without reading metdata.
4ba4638 Add additional read_metadata parameter to other Reader constructors.
d005937 Optionally ignore metadata when reading file.
63961da Mark all CRC32 update functions as noexcept.
cc4ca75 Refactor set_user() function to speed it up.
38d19dc Update comments with file sizes. OSM has grown...
f7d0824 Add new benchmark that shows performance when main thread is busy.
25070dc Use const ref params.
88e8d96 Mark add_user() as deprecated.
f58d9db Refactor some low-level collection code to clean up code.
4680def Add example showing how to create OSM data out of thin air.
d42fd50 Add an example showing how tags in OSM files can be changed.
49bf5bc Add additional constructors to Builders taking a reference to parent.
7b91d63 Change Builder::add_item() to take a reference instead of pointer.
2957e48 Some cleanup of examples.
d0b458d Calculate size of object at compile time.
3fbb6e7 Use explicit cast.
1851f3d Remove a test that depends on math details.
f6a0802 Various cleanups of example programs.
ba4921f Rename add_user() to set_user().
d7637c9 Various cleanups related to builders.
07827bc Fix add_user().
9a5b395 Also refactor OSMObjectBuilder like ChangesetBuilder before.
b1f423c Use call chaining on the builder.
e49473d Get rid of ObjectBuilder class.
67d70b9 Refactor ChangesetBuilder::add_user().
8199c33 Make ChangesetBuilder derive directly from Builder.
61d1b67 Simplify some code.
d38467a Change derivation hierarchy of some builder classes.
b52f8af Refactor Builder code.
d012bfa Refactored some code setting attributes on objects using builder instead.
6a05f60 Also forward set_removed function from builders.
8d63b7d Return *this from Builder setter functions and test it.
72a1266 Update catch.hpp to newest version.
3424a74 Check GEOS version is <= 3.5.
aee9f9d Cleanup test code.
aef198c Improved asserts in Buffer.
a98b9bf Code cleanup in tests.
a150466 Use GDAL/OGR instead of GEOS to test our WKB implementation.
b04a525 Refactor test.
39aa932 Refactored test_factory_with_projection so it works without GEOS.
648f43a Remove unused dependency on geos from tile test.
f1748ae Add setters to Builder classes forwarding to underlying objects.
8166879 In debug mode check that Builders are correctly called and destructed.
1c4257e Call commit() on buffer only after all builders are destructed.
2618636 Add functions to check availability of relation members.
b45a4d9 Mark RelationMember::set_ref() as deprecated.
7886771 Move "basic" and "buffer" tests to "osm" and "memory", respectively.
b664685 Use functions instead of macros in location test for faster compile.
b4929ac Add more tests for number parser.
02662a7 Merge pull request #171 from lonvia/fix-long-exponentials
5344a6c fix parsing of numbers in e-notiation with many post-comma digits
3aeaff3 Add some typedefs to NodeRefList and memory::Collection.
e750665 Add iterators to IdSetSmall and add docs and tests to IdSet classes.
50ecb2a Add more features to IdSetDense, including unset and iterator.
e3dec78 Make IdSet virtual base class with two implementations.
8ea0153 Use C array instead of std::array in IdSet and clear explicitly.
3ba9905 Deprecate osmium::index::BoolVector in favour of new IdSet.
453d1ca Add osmium::index::IdSet.
c78254e Add function to (temporarily) disable the progress bar.
4d88a9f Better document osmium::io::Header class.
320e3af Look for protozero includes in CMake config.
838d25e Allow optional checking for libosmium version number in CMake config.
6ce60c1 Fix entity_bits static_assert() tests.
f054731 Update change log.
77ac4c2 Make sleep duration for full queues much smaller.
7e39c01 Make some entity_bits functions constexpr.
69ea72f Fix ~ operator on entity_bits and more tests for entity bits.
dafe4cf Update embedded Catch unit test header to version 1.5.7.
a41c832 Fixed parsing of location coordinates starting with decimal dot.
6523bae README cosmetics.
229acac Add tests for some examples.
f1e753d Merge pull request #163 from sebastic/executable-not-elf-or-script
ccea2d5 Remove executable bit from .cpp files.
af77fb4 Changelog formatting fixes.

git-subtree-dir: third_party/libosmium
git-subtree-split: 40c4a48f88d25edace6f0b9e079c306308c7760b
2016-11-11 15:50:02 +01:00
Daniel J. Hofmann
72bfbed1f1 Merge commit 'babbda98a6ea1d53a8bc5015ef5dfb313c47186a' into libosmium-2.10.0 2016-11-11 15:50:02 +01:00
Daniel J. Hofmann
feeae05f1c Update Libosmium Dependency Script 2016-11-11 15:16:07 +01:00
Moritz Kobitzsch
f88ac989ea reserve when possible 2016-11-11 14:48:50 +01:00
Dane Springmeyer
41f083cded test customized build directory, make test/data/Makefile customizable 2016-11-10 11:56:51 -08:00
Patrick Niklaus
12ded539aa Merge pull request #3235 from Project-OSRM/mason-improvements
Mason improvements
2016-11-10 16:58:18 +01:00
Moritz Kobitzsch
827a1fbd7a separate intersection generation and intersection normalization 2016-11-10 12:56:46 +01:00
Moritz Kobitzsch
e84a0ea37c reduce coordinate_extraction overhead. slowdown reduced by 30 percent 2016-11-10 10:44:54 +01:00
Moritz Kobitzsch
88208bfa5d add testscases for mode changes / additional assertions 2016-11-09 12:55:28 +01:00
Moritz Kobitzsch
7073403f1b rip out dedicated file for single function (minor refactor) 2016-11-09 12:52:39 +01:00
Michael Krasnyk
2501882adb Remove duplicated linking of boost and tbb libraries 2016-11-09 12:44:49 +01:00
Michael Krasnyk
4f2bb19b0f Use single precision values in vector<float> initializer list (#3270) 2016-11-08 21:06:55 -08:00
Dane Springmeyer
de77befb23 Merge commit 'a5db3d72f1bc9a8253e327a18d535d244a635b6a' into mason-improvements 2016-11-08 15:30:44 -08:00
Dane Springmeyer
a5db3d72f1 Squashed 'third_party/mason/' changes from 1b3085e..8df1478
58ae447 bump to v0.1.1
c5ef33f rename llvm 4.x to 4.0.0 [skip ci]
5d5d26b add llvm 4.x based sub-packages
9708680 only set LIBCXX_ENABLE_STATIC_ABI_LIBRARY for linux [skip ci]
6918fb0 install LLVMgold.so on linux [skip ci]
ab20ff7 binutils: using 'all-gold' breaks make install on linux [skip ci]
cb8b15f fix binutils install [skip ci]
df77b02 properly set LLVM_BINUTILS_INCDIR value [skip ci]
295d4db binutils gold fixes [skip ci]
ac85676 enable LLVMgold.so for linux [skip ci]
acc4249 add binutils 2.27
16d4452 add lldb and llvm-cov 3.8.1 packages
757b908 remove patching no longer needed [skip ci]
69415b5 better fix for statically linking/linked libc++ with llvm 3.8.1 [skip ci]
43933ed Added mesa-13.0.0-glx (non-CXX11ABI)
2bb81cc Added mesa-13.0.0-glx
d70e3ef LLVM_EXTERNALIZE_DEBUGINFO is osx specific
ba737bf llvm 3.8.1 linux build fixes
4279f58 Updates for mesa 13.0.0
d544278 Revert typo in mason.sh
03ecb2c Add mesa 13.0.0 (Gallium-OSMesa)
0997905 Add expat 2.2.0
f41eb6d mason.cmake: multiple static libs also need to be split
c9fcd1a add lldb to llvm 3.8.1 [skip ci]
6d8e16c minor llvm/clang++ improvements
b2bdb33 Add note that we need to create a github release [skip ci]

git-subtree-dir: third_party/mason
git-subtree-split: 8df14782dda0c2c7314b5c6dba98e9e36a67eedc
2016-11-08 15:30:44 -08:00
Dane Springmeyer
b8898ef410 mason improvements 2016-11-08 15:29:49 -08:00
Daniel Patterson
d0543e6c3b Changelog fix. 2016-11-08 14:38:15 -08:00
Daniel Patterson
cef53c4b56 Fix key/val offset bug. 2016-11-08 11:45:28 -08:00
Daniel Patterson
481b03baeb Review changes. 2016-11-08 11:45:28 -08:00
Daniel Patterson
f96e61ee06 Construct adjacency list and properly traverse it. 2016-11-08 11:45:28 -08:00
Daniel Patterson
d21c8e3800 Add simple check for number of turns found in the tile. 2016-11-08 11:45:28 -08:00
Daniel Patterson
af7960a796 Fix buffering of query box - it was shrinking in the Y axis, rather than growing. 2016-11-08 11:45:28 -08:00
Daniel Patterson
4c6d6aeaa7 Fix retrieval of forward/reverse data. 2016-11-08 11:45:27 -08:00
Daniel J. Hofmann
ef2261661c Remove {highway: type} fallback from bike / walk profile, fixes #3231
References:
- https://github.com/Project-OSRM/osrm-text-instructions/issues/62#issuecomment-257889721
- https://github.com/Project-OSRM/osrm-text-instructions/pull/63
2016-11-08 14:28:56 +01:00
Moritz Kobitzsch
9c11f4231c add locations feature to allow testing turn locations, fix minor bug breaking the arrival location 2016-11-08 13:42:15 +01:00
Moritz Kobitzsch
837ab105ad fix error in ordering arguments for requiresNameAnnounced versions 2016-11-08 12:14:23 +01:00
Daniel J. Hofmann
6ac9617d49 Adapt test to returning ref, Take Pronunciation into Account, Fixes name change heuristic usage in UTurn check 2016-11-08 12:14:23 +01:00
Moritz Kobitzsch
ccdebccde1 adjust sliproad handler for empty-name check, illustrate testcase 2016-11-08 12:14:23 +01:00
Daniel J. Hofmann
c1651ccb12 Uses Name Change Heuristic Instead of Comparing Name Ids
References:
- https://github.com/Project-OSRM/osrm-backend/issues/2857
- https://github.com/Project-OSRM/osrm-backend/pull/2900
- https://github.com/Project-OSRM/osrm-backend/issues/2909
2016-11-08 12:14:23 +01:00
Kajari Ghosh
f33180f092 request polyline with precision of 5 or 6 positions (#3220) 2016-11-07 15:11:21 -05:00
Moritz Kobitzsch
1b03b8df6d raising timeout limit for cucumber on clang 2016-11-07 18:29:49 +01:00
Moritz Kobitzsch
3eeb3cb6c6 fix collapsing of roundabout instructions 2016-11-07 17:16:44 +01:00
Michael Krasnyk
3e18e31bc9 Added percent-encoding to URL parser
Reference:
https://tools.ietf.org/html/rfc1738
2016-11-07 14:16:51 +01:00
Moritz Kobitzsch
2fb40944bf pull in intersection finder accumulator 2016-11-04 13:28:09 +01:00
Michael Krasnyk
b108d8ea21 Use explicit std::function for to_lane_count instead of auto 2016-11-04 10:46:24 +00:00
kerrick-lyft
79917d2c8e Fix typo: Ẁaypoint -> Waypoint 2016-11-03 21:25:10 +00:00
Daniel J. Hofmann
d2cd4fac2d Fixes Always-Zero Lane Count Introduced in #3237 2016-11-03 15:52:18 +01:00
Moritz Kobitzsch
cd03877c90 link ConnectedRoad and TurnOperation via class hierarchy
and empower intersection by adding basic functionality to pod type
refactor extractor/toolkit into intersection
2016-11-03 13:42:29 +01:00
Moritz Kobitzsch
388d84a89e check for compatibility in post-processing (#3227) 2016-11-02 16:59:35 -06:00
Michael Krasnyk
9d24a4422a FindOsmium invoke is required for MSVC build dependencies
The commit is aprtial revert of
87d09f7 | * make adjustments based on PR review from @themarex
because osmium requires ws2_32
2016-11-02 18:40:17 +00:00
Patrick Niklaus
9693f9269b Add regression test 2016-11-02 17:52:41 +00:00
Patrick Niklaus
08a5648e3e Use coorect osm ids for start/target segment 2016-11-02 17:52:41 +00:00
Daniel J. Hofmann
ccf5552406 Fixes Cucumber's Unknown Node Error Reporting
Before: `unknown node %s`
After: `unknown node t`

https://nodejs.org/api/util.html#util_util_format_format_args
2016-11-02 16:46:51 +00:00
Patrick Niklaus
b749d9bd2f Address PR comments 2016-11-02 16:45:20 +00:00
Patrick Niklaus
d342a18324 Add regression test 2016-11-02 16:45:20 +00:00
Patrick Niklaus
8f00936790 Fix non-overlap logic for simplified geometries. 2016-11-02 16:45:20 +00:00
Moritz Kobitzsch
8a3aec301a add a segment on turn restrictions to the cucumber guide 2016-11-02 16:06:37 +01:00
Moritz Kobitzsch
faa5185440 add node-based-graph traversal capabilities 2016-11-02 15:38:09 +01:00
Moritz Kobitzsch
4ba8ccfcce add a geojson debugger that allows creating features for easy inspection 2016-11-02 14:54:00 +01:00
Kajari Ghosh
c30f43b148 added max_speed to the profiles (#3089) 2016-11-01 17:13:10 -04:00
Denis Koronchik
5da63998d6 Add support of custom ServiceHandler 2016-10-31 15:38:03 +01:00
Kajari Ghosh
6fc0609a62 Map matching test coverage fix (#3201)
* fixed map matching test coverage
2016-10-29 11:22:09 -04:00
Patrick Niklaus
f02b7b0910
[skip ci] Fix formating using format.sh 2016-10-28 14:45:05 -07:00
Dane Springmeyer
9435254661 Merge pull request #3119 from Project-OSRM/masonize
Masonize
2016-10-28 13:39:37 -07:00
Dane Springmeyer
de14a72931 adjust example build setup to new mason location 2016-10-28 12:48:20 -07:00
Michael Krasnyk
164f4ffc32 Updated cmake version to 3.7.0-rc2 2016-10-28 12:42:36 -07:00
Michael Krasnyk
b5c77de923 Fix msvc linking of boost libraries 2016-10-28 12:42:36 -07:00
Dane Springmeyer
6067fdf27f tell mason.cmake where the mason command is 2016-10-28 12:34:34 -07:00
Dane Springmeyer
a34a885031 Squashed 'third_party/mason/' content from commit 1b3085e
git-subtree-dir: third_party/mason
git-subtree-split: 1b3085e812b08ef092ba43945e3ab9f802632280
2016-10-28 12:21:21 -07:00
Dane Springmeyer
f39eb999e5 Merge commit 'a34a885031fcb1797621e8968497561a4837e06a' as 'third_party/mason' 2016-10-28 12:21:21 -07:00
Dane Springmeyer
87d09f78e6 make adjustments based on PR review from @themarex 2016-10-28 12:18:13 -07:00
Dane Springmeyer
83b7d75121 Add support for building against mason-provided deps 2016-10-27 23:26:33 -07:00
Dane Springmeyer
4598599f52 # This is a combination of 4 commits.
# The first commit's message is:
Add support for building against mason-provided deps

# This is the 2nd commit message:

back to just one travis job: linux/release

# This is the 3rd commit message:

remove pkg-config debugging [skip ci]

# This is the 4th commit message:

use clang++ 3.8.1 for mason builds since 3.8 is what we have been using
2016-10-27 23:26:33 -07:00
Daniel Patterson
da77edfc83 Explicitly set minimum OSX version, and detect SDK path.
This fixes situations where XCode is installed with a newer SDK than the current OS. (#3198)
2016-10-27 16:29:27 -06:00
Dane Springmeyer
2917122287 Merge pull request #3196 from Project-OSRM/build-fixes
Minor build fixes
2016-10-27 14:43:36 -07:00
Dane Springmeyer
a22e0fa62e minor build fixes
- Travis: Upgrade clang from 3.8.0 to 3.8.1 (provides smaller package for faster downloading)
  - Travis: Makes BUILD_COMPONENTS an option
  - Followup after #3130 (Boost_LIBRARIES variable no longer exists)
2016-10-27 13:39:33 -07:00
Denis Koronchik
dc7e61c25d Fix declaration of makeRouteStep function 2016-10-27 20:12:02 +02:00
Moritz Kobitzsch
8dc667f20d fix warnings due to superfluous ; 2016-10-27 20:06:14 +02:00
Moritz Kobitzsch
8ff4bc09ac fix breaking the sorting order by node adjustments 2016-10-27 19:55:56 +02:00
Moritz Kobitzsch
88c3f4c481 Considering multiple small turns, right after each
other can result in a combined turn angle that is
straight instead of turning left and right.
2016-10-27 19:19:23 +02:00
Moritz Kobitzsch
01a2c66472 rip out unused m_node_info_list 2016-10-27 18:51:59 +02:00
Huyen Chau Nguyen
cf35bbeb50 refactor function names; consolidate readCount() functions;
remove templated types as much as possible for type safety;
add more comments;
clean up code, add const if possible;
2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen
fe94977c9b refactor loading code of .ramIndex files and move to io.hpp 2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen
69a60686dc refactor loading code of .datasource_indexes and .datasource_names files and move to io.hpp 2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen
7b97e1035f refactor loading code of .nodes and .edges files and move to io.hpp 2016-10-26 13:18:52 -07:00
karenzshea
c4f010e363 read properties stream to size of properties object, not 1 2016-10-26 13:18:52 -07:00
karenzshea
51ebadfc45 deduplicate code for loading profile properties into io.hpp 2016-10-26 13:18:52 -07:00
Daniel Patterson
ceddfada3d Don't mark all lanes as designated when there are blank lane specifiers in the tag. 2016-10-25 14:37:59 -06:00
Daniel J. Hofmann
a933b5d949 Prevents the Matching getting confused when users are time-travelling. 2016-10-25 10:42:24 -07:00
Moritz Kobitzsch
ba5871cfa1 fix turn scenarios 2016-10-25 10:12:25 -07:00
Moritz Kobitzsch
e8b947bca6 fix coordinate extraction with less than 1 meters past lane distance 2016-10-25 10:07:09 -07:00
Michael Krasnyk
7753845f5c Make thread-locked access to stxxl containers
From stxxl FAQ: "you should not share a data structure between
threads (without implementing proper locking yourself)."
The access to name_char_data can be implicitly parallelized
if _GLIBCXX_PARALLEL is defined and invalidate local-thread iterators.
2016-10-25 10:03:26 -07:00
Dane Springmeyer
19eec48207 Merge pull request #3163 from Project-OSRM/pc-fixes
Add -l to rt and gcov
2016-10-24 18:53:49 -07:00
Dane Springmeyer
293856981f add -l to rt and gcov 2016-10-24 17:09:03 -07:00
Michael Krasnyk
86b70f2632 Don't fail on incorrect lane tags '1; 2' 2016-10-24 15:25:46 -07:00
Daniel J. Hofmann
1905a0f473 Documents InvalidValue response code, resolves #3150 2016-10-24 09:54:09 -07:00
Moritz Kobitzsch
d05b85c227 fix turn restriction and make route unique 2016-10-22 06:48:49 +02:00
Daniel J. Hofmann
19f00589de Removes constant speed offset from calibration two years ago, resolves #3023.
Our fine-tuned profiles are better in modelling real speed by now. This
constant offset is no longer needed. We still scale maxspeed, though.

https://github.com/Project-OSRM/osrm-backend/issues/3053
2016-10-22 06:48:49 +02:00
Daniel J. Hofmann
7f28a14c76 Fixes Grammar in Github Pull Request Template 2016-10-21 16:52:05 -07:00
karenzshea
fead71da54 add comment on find() [skip ci] 2016-10-21 14:23:02 -07:00
karenzshea
c26e90cac0 sort/unique turn penalty lookup 2016-10-21 14:23:02 -07:00
karenzshea
d4e5710928 parse turn penalties in parallel, add unique and sorting steps 2016-10-21 14:23:02 -07:00
karenzshea
5c2783310a add pr todo for updating wiki [skip ci] 2016-10-21 13:58:51 -07:00
Patrick Niklaus
b8795c7341 Rename increasingly inaccuratly named distance member of QueryEdge to weight 2016-10-21 21:00:02 +02:00
Daniel J. Hofmann
1d994da12b Makes Scripts Fail Fast and Loud 2016-10-21 17:56:56 +02:00
Dane Springmeyer
46994e87be Merge pull request #3130 from Project-OSRM/cmake-fixes
cmake fixes
2016-10-20 15:34:24 -07:00
Moritz Kobitzsch
40bfe89d97 add test 2016-10-20 14:28:33 -07:00
Moritz Kobitzsch
e3c2d4dddc use-lane can occur in roundabouts as well 2016-10-20 14:28:33 -07:00
Dane Springmeyer
502d9e10c2 cmake fixes:
- Builds up ENGINE_LIBRARY_LISTING correctly to pass to pkg-config
    - Previous behavior had major flaw and would result in paths in libosrm.pc like: "-L-L"
      when the data was "-L/path -lfoo" or just "-lpthread" with no -L/path. It only worked correctly for static libraries
  - Refactors to call find_package for boost in one place (helps prepare for upcoming mason PR)
2016-10-20 12:09:27 -07:00
Daniel J. Hofmann
865c6590fa Limits the object cache size to 256M 2016-10-20 11:33:28 -07:00
jakepruitt
c30784895d clang-format and remove debug 2016-10-20 11:32:28 -07:00
jakepruitt
fa1fc810ea std::for_each -> std::copy 2016-10-20 11:32:28 -07:00
jakepruitt
052b0e831d Remove debug logging 2016-10-20 11:32:28 -07:00
jakepruitt
42271d99b2 Store node ID's and weights separately in CompressedEdgeContainer
Removes CompressedEdges from the extractor and shared data format by
directly serializing vectors of node ID's, forward weights and reverse
weights for each node-based-edge

Refs #2575
2016-10-20 11:32:28 -07:00
Moritz Kobitzsch
ecee13bffa actually calculate distance instead of using .distance which is a timing value 2016-10-20 12:27:02 +02:00
Moritz Kobitzsch
5e167b8745 Turn Angles in OSRM were computed using a lookahead of 10 meters.
This PR adds more advanced coordinate extraction, analysing the road
to detect offsets due to OSM way modelling.

In addition it improves the handling of bearings. Right now OSM reports
bearings simply based on the very first coordinate along a way.
With this PR, we store the bearings for a turn correctly, making the
bearings for turns correct.
2016-10-20 10:47:29 +02:00
Moritz Kobitzsch
1f8ca2879f fix u-turn collapsing onto empty name / in presence of turning use lane 2016-10-20 09:39:38 +02:00
Huyen Chau Nguyen
2d13116487 fix memory leak of char[] initialization 2016-10-19 17:26:21 -07:00
Huyen Chau Nguyen
316ef305de Refactor loading code for timestamp file 2016-10-19 17:26:21 -07:00
Daniel J. Hofmann
ab1a9271c8 Canonicalizes Spaces in Semicolon Stringlists, fixes #3086 2016-10-19 14:14:18 -07:00
Daniel J. Hofmann
18bc02f087 Collapses Double OSRM <-> Engine <-> .. PImpl Indirection, Resolves #3019. 2016-10-19 13:42:08 -07:00
Moritz Kobitzsch
2a2abe9e0f remove unused class DiscreteAngle 2016-10-19 21:40:45 +02:00
Patrick Niklaus
b7ee38eca7 Refactored loading code for .hsgr file 2016-10-19 19:59:23 +02:00
Moritz Kobitzsch
ae157d0b4f fix changelog to not include 5.5.1 ahead of time 2016-10-19 18:37:53 +02:00
Patrick Niklaus
769485cc2f Initilialize tbb task scheduler correctly. Thanks @oxidase! 2016-10-19 18:30:06 +02:00
Patrick Niklaus
983ad3513a Enabled address sanitizer 2016-10-19 18:30:06 +02:00
Patrick Niklaus
ca914b8b1f Use newest bintools with gcc 6, thanks @oxidase 2016-10-19 18:30:06 +02:00
Daniel J. Hofmann
ca21b8833a Removes Gnu Date Usage 👴
\U+1Fstallman-emoji
2016-10-19 18:26:20 +02:00
Kajari Ghosh
3f0f0e306b Directional Destination Tags (#3061)
* cucumber test scenarios, #3027

* post review comments

* two tests are still failing

* fixed one test

* passing tests

* cleaner code refactor

* possible sceanrios for destination:ref:forward/backward

* added code for direction:ref:forward/backward, tests pass

* changelog

* store direction in variable

* added tags to taginfo

* fixed dumb error

* use boolean flags

* null pointer checks

* hopefully better null pointer checks
2016-10-18 23:09:19 -04:00
Patrick Niklaus
f77a2474ea
[skip ci] Forgot to add changelog entries 2016-10-18 22:20:42 +02:00
Patrick Niklaus
8205c34abe Fix duplicated code in tile plugin 2016-10-18 22:11:43 +02:00
Daniel J. Hofmann
ee4fb89336 Adds missing routable service tags
http://taginfo.openstreetmap.org/keys/service#values
2016-10-18 22:11:13 +02:00
Patrick Niklaus
81c5cba0e5 Recover from stale mutexes with force unlocking and retry 2016-10-18 21:58:50 +02:00
Patrick Niklaus
caa7c994a0 Make SharedDataFacade try to cleanup 2016-10-18 21:58:50 +02:00
Patrick Niklaus
847f530c8e Only keep reader lock on shared memory during queries. 2016-10-18 21:58:50 +02:00
Patrick Niklaus
c69545c47a Don't block all requests to switch data
This switchtes the data even if there are requests still running on the
old data. osrm-datastore then waits until all of these old requests have
finished before freeing the old regions.

This also means that osrm-datastore will return with an error if there
is a data update currenlty in progress.
2016-10-18 21:58:50 +02:00
Patrick Niklaus
1557ff81bc Simplify the locking logic 2016-10-18 21:58:50 +02:00
Patrick Niklaus
ebac9f586b Adapt SharedMemory ownership changes from @oxidase
We don't leak any pointers anymore and make owning the shared memory
explicit.
2016-10-18 21:58:50 +02:00
Patrick Niklaus
2512cf386d Add better debug log output 2016-10-18 21:58:50 +02:00
Patrick Niklaus
da04563e26 Added header guards 2016-10-18 21:58:50 +02:00
Patrick Niklaus
ceaf362326 Make SharedDataFacade immutable 2016-10-18 21:58:50 +02:00
Johan Uhle
9af00b1925 Docs: Rotaries can have exits as well 2016-10-18 02:20:18 +02:00
karenzshea
f540485cb0 Add a speed for driveway to service speeds 2016-10-17 15:45:31 -07:00
karenzshea
5617d3886d Fix cucumber support code for routability testing to actually test
input/output for speed and time values, adjust resulting broken tests
2016-10-17 15:45:11 -07:00
Huyen Chau Nguyen
06d13b6954 run clang-format on edited files 2016-10-17 15:27:14 -07:00
Huyen Chau Nguyen
d0c142b9c7 remove util self-written make_unique and use C++14 stdlib make_uniqe 2016-10-17 15:27:14 -07:00
Moritz Kobitzsch
ef1f14550f max all trips roundtrips again 2016-10-17 15:26:38 -07:00
Moritz Kobitzsch
5839bf334b fix random feature fail 2016-10-17 15:26:38 -07:00
Moritz Kobitzsch
46c936b48e handle trips with identical coordinates 2016-10-17 15:26:38 -07:00
Daniel J. Hofmann
8ed6bb8a1b Asserts on valid v5 conforming maneuver types, resolves #3035 2016-10-14 15:59:26 +02:00
Daniel Patterson
b72dc8c0cf Enable use of other build types than Debug and Release, and properly default to Release. 2016-10-14 12:37:01 +02:00
karenzshea
72fa35da10 add a toolkit function to find lanes to the left/right of turn lanes 2016-10-13 17:59:25 +02:00
Moritz Kobitzsch
17eb664597 don't get disturbed by service roads in obvious discovery 2016-10-13 16:10:59 +02:00
Daniel J. Hofmann
77931ffe24 Changes Lua detection to be less strict 2016-10-12 23:09:59 +02:00
Karen Shea
45df2c991f Merge pull request #3045 from Project-OSRM/fix/tilez-limit
Add max zoom limit of z12 to tile plugin parameters
2016-10-12 19:14:44 +02:00
karenzshea
615e302b8c test for tile that fails IsValid() check 2016-10-12 11:20:01 -04:00
karenzshea
1ed8e7e98c test a z12 tile 2016-10-12 10:20:14 -04:00
karenzshea
ee012ae2da valid tiles are >= z12 2016-10-12 10:03:43 -04:00
Daniel J. Hofmann
32dcce88f7 Fixes missing memory include for make_unique; reported in #3018.
https://github.com/Project-OSRM/osrm-backend/issues/3018#issuecomment-253118518
2016-10-12 12:55:05 +02:00
Daniel J. Hofmann
a13cf3f2be Route over alternating oneways but not reversible ones, closes #2837.
- alternating: high frequency, route over them with penalty
- reversible: low frequency, do not route over them - time dependence

- http://wiki.openstreetmap.org/wiki/Tag:oneway%3Dreversible
- http://wiki.openstreetmap.org/wiki/Tag:oneway%3Dalternating

This distinction was made at the Elbe-Labe Meetup in Dresden, with
accompanying Wiki pages and tagging scheme. Thanks all involed!

- https://github.com/Project-OSRM/osrm-backend/issues/2837
- http://wiki.openstreetmap.org/wiki/Key:oneway
2016-10-12 12:53:07 +02:00
Moritz Kobitzsch
6cf99c886f don't emit invalid on sliproads with incompatible modes 2016-10-11 10:59:10 +02:00
Emil Tin
7cbb1807e7 cucumber: change syntax of node maps 2016-10-11 09:07:48 +02:00
Patrick Niklaus
d47d03c15b Add explicit test for malformed coordinate 2016-10-11 00:04:53 +02:00
Patrick Niklaus
240a7696da Catch boost bad_numeric_cast exception and let parser return an error 2016-10-11 00:04:53 +02:00
Patrick Niklaus
14b024e4dc
[skip ci] Document InvalidQuery. Fixes #3026 2016-10-10 17:37:34 +02:00
Patrick Niklaus
339ebe8f81
[skip ci] Update changelog 2016-10-10 13:54:06 +02:00
Patrick Niklaus
9eb7fc03ce Use a shared (!) reader writer lock to protect CURRENT_REGIONS
This fixes issue #3016.
2016-10-10 12:13:45 +02:00
Moritz Kobitzsch
036475afd0 restructure for readability 2016-10-07 09:35:16 +02:00
Moritz Kobitzsch
378322f6e3 don't provide turn-straight next to suppress-straight 2016-10-07 09:35:16 +02:00
Daniel J. Hofmann
d964b81308 Silence static visitor upstream deprecation warnings. 2016-10-06 21:08:48 +02:00
jakepruitt
49a28b478c Remove TODO - tiles are tested and seem to work 2016-10-06 10:09:57 -07:00
Lauren Budorick
a75e16e26b Deduplicate foward/reverse geometries
Changes the internal representation of compressed geometries to be a
single array shared between forward and reverse geometries that can be
read in either direction. Includes a change on
extractor::OriginalEdgeData to store via_geometry ids that indicate
which direction to read the geometry for that edge based edge.

Closes #2592
2016-10-06 10:09:57 -07:00
Moritz Kobitzsch
73179641b1 clang-format code 2016-10-06 14:06:19 +02:00
Patrick Niklaus
58316c608d Fix verison detection for multiple lua installations
If both lua 5.3 and lua 5.2 are installed the old code threw an error
that 5.2 was not found since FindLua always picks the neweste version.
2016-10-06 13:36:34 +02:00
Patrick Niklaus
1c2ead8fb8 Make DataFacade local to every request
This is the first step to having fine grained locking on data updates,
see issue #2570.
2016-10-06 12:56:38 +02:00
Moritz Kobitzsch
66f2cc5184 fix detection of forks in present of oneways 2016-10-05 17:49:54 +02:00
Daniel J. Hofmann
dbd108df8c Reworks how we search for Lua in CMake and constrain to Lua 5.1 5.2
At the moment we have a FindLua52.cmake module that is happy with
Lua52 but also Lua51 and even Lua53. Let's instead pull in the official
one from CMake (since it's not yet in CMake 2.8 which we support).

https://github.com/Kitware/CMake/blob/master/Modules/FindLua.cmake

BSD licenced.

Requires Lua 5.1 or Lua 5.2, since seeing memory issues on 5.3:

https://github.com/Project-OSRM/osrm-backend/issues/2926
2016-10-05 13:23:48 +02:00
Michael Krasnyk
ff1ab217ba Debug and i686 builds 2016-10-04 16:37:29 +02:00
Patrick Niklaus
49a9d7f57a Try switching to GCC 6 2016-10-04 16:37:29 +02:00
Michael Krasnyk
da15c014f5 Avoid doubled reprocessing for scenarios without caching 2016-10-04 14:35:21 +02:00
Daniel J. Hofmann
9a85a50586 Implements Cucumber shared vs. static library detection, fixes #2999 2016-10-04 14:14:37 +02:00
Daniel J. Hofmann
94ca782816 Bumps version to 5.4.0 2016-10-04 10:46:56 +02:00
Daniel J. Hofmann
d17eacc52b Makes the OSRM interface threadsafe.
Technically speaking we're changing the `libosrm` API.

But since we're only lifting restrictions by marking the API threadsafe,
we should be fine here.
2016-10-04 09:32:22 +02:00
Daniel J. Hofmann
d86bba3e24 Re-introduces the old RouteParameters ctor for API compatibility, see #2978 2016-10-03 20:00:12 +02:00
karenzshea
7f7b47611d add note about dangers of post subtree merges rebases [skip ci] 2016-10-03 13:51:30 -04:00
Karen Shea
2d4c128ea2 Merge pull request #2994 from Project-OSRM/retry/libosmium
Update to libosmium@2.9.0
2016-10-03 19:43:14 +02:00
karenzshea
5d9fc83db4 adjust test cases that specify coords without leading 0 2016-10-03 13:15:39 -04:00
karenzshea
879f7eb042 Squashed 'third_party/libosmium/' changes from 2282c84..80df1d6
80df1d6 Release v2.9.0
110dc5c Update change log.
6ad5829 Better handling of areas with duplicate segments.
f5985ed Better exception message for invalid areas.
fa09300 Explicit cast to make intent clear.
6f9b522 Fix name of struct stat on Windows.
6b0a47b Clean up code in data tests.
aa1226c Fix progress bar.
3663a19 Extend ProgressBar class so that it works with multiple files.
40c4d5a Add version of file_size() taking a file name.
43a2fac Merge pull request #162 from osmcode/windows-build-scripts
cc2305d [skip travis] 1st iteration of new build scripts
7abe4e1 Clean up disk location cache examples.
48841d5 Update change log.
cf854e9 Change timestamp parser.
01aa8c7 Add examples osmium_pub_names and osmium_road_length.
483c9f2 Benchmark code cleanup.
3ffea2d Cleaned up some test code.
80f0ff7 Explicit conversion from int to bool.
0ba5918 Write space after progress bar to defend against glitches in output.
8584423 Change progress bar to take max_size on construction.
d2c7585 Only call gzoffset when compiling with zlib > 1.2.4.
1b417e5 Add support for a progress report in osmium::io::Reader().
3b4c8c8 Minor cleanup of appveyor config.
d787e25 Fix OPL parser: Relation member without role at end of line.
53ca080 Make lots of variables const.
d776ab2 Add to change log.
eec3b62 Properly initialize m_data field.
cc607e1 Take argument by const ref.
be1e346 Remove unused function.
2a356ee Make lots of one-argument constructors explicit.
adca74f Add comments to and cleanup up examples.
381e535 Simplify WKB code.
b49efd8 Fix opl_parse_changeset_id() return type.
bb52e57 Use uint64_t for line count and column to be on the safe side.
243f6a7 Use parentheses to make sure the right precedence is used.
5a7648e Consistently catch by const ref unless var needs to be non-const.
e3be990 Avoid some warnings.
c436d92 Do not include unistd.h on Windows.
95b228c Add dummy function to avoid warnings.
f276ca3 Fixed includes and changelog update.
8c54bd9 Change timestamp error message.
27e1d5c Add OPL parser.
1d2caab Add more includes to osm.hpp to make usual osmium use simpler.
9d88361 More tests for area CRC.
4f8964d Initialize Item::m_diff member on construction.
f2b648b Parse coordinates in scientific notations ourselves.
b01323f More include fixes.
69f39d4 Fix some includes.
156536d Make padded_length a plain function, not a template function.
65cd1dc Extend functions to set Location lon/lat.
98b7b17 Update to protozero 1.4.2.
a6420cf Add diff indicator to items and use for diff opl and debug output.
0ef02a3 Add workaround for YCM.
3a986f4 Update protozero version.
5245c5b Document osmium_count example program and add memory usage output.
796ca13 Document handler class.
2ba1c1f Add example for mercator projection and tiles.
201f744 Restrict tiles to zoom <= 30.
202291d Add member_type_string class.
494ed6e Cleaned up Tile tests.
af13a8b Add documentation and range checks to Tile struct.
9df5d91 Some small changes to avoid conversion warnings.
afac031 Explicit cast to avoid warning.
8188f66 Better contribution info.
fa89d1d Fixed a problem limiting cache file sizes on Windows to 32 bit.
23a89df Remove obsolete info about versioning from CONTRIBUTING.md file.
115ae23 Release v2.8.0
4174b3c Style fix.
1795dcb Function wait_and_pop_with_timeout() is not needed any more.
4a3a71b Fix for possible threading problem.
cc85925 Updated change log.
67bc8b1 Use unordered_map instead of map in PBF string table code.
18b7b66 Set better default for string table chunk size and document it.
e6d7410 Remove dependency on sparsehash and boost program_options for examples.
14d92d6 Fix regression: Debug output of invalid location works again.
ef91ce1 Bugfix: PBF String table corruption when there are many strings.
649af78 Remove DeltaEncodeIterator completely.
56e5ac2 Function getting queue sizes from environment uses default when getting 0.
bfaab7d Add change log.
d260339 Remove use of PROTOZERO_STRICT_API macro.
c61722d Remove use of DeltaEncodeIterator simplifying code.
f7c60b6 Updates for new protozero.
0bdfb9d Updated change log.
bb56cbb Switch to newest protozero 1.4.0.
9e19a82 Add ccache support to CMake cnfig, better travis builds.
00d8868 Make I/O max queue sizes configurable via environment.
dc7e504 Remove unused debugging code.
13f66a0 Track pop() calls and queue underruns when OSMIUM_DEBUG_QUEUE_SIZE is set.
5c2e367 Add EWKT support.
8f7c7d3 Automatically set correct SRID when creating geometries.
ff11893 Better check of optional components in CMake config.
4562429 Use fallback implementation for coordinates given in scientific notation.
3bdf46e Mark enable_debug_output() as deprecated.
ea1093e Update catch unit test framework.
8623f1e Release v2.7.2
e135dd8 Fix data corruption regression in mmap based indexes.
adbd3b0 Do not output empty discussion tags in changeset XML output.
8126fbb Formatting.
c6970fd Fix coordinate output.
3471b4b Resize output string once in output_int().
0ddf0e7 Use our own function to convert integers to strings instead of printf.
f9a1dd3 Reading and writing coordinates is now independant of locale.
8104294 Use hand-crafted function for hex output (faster than printf).
0bb452a Fix links in change log.
1862d06 Release v2.7.1
8bfe2ba Release v2.7.0
c3604f3 Use 64bit counter in area stats.
9e589b3 Update gdalcpp.hpp from upstream.
fd55d9b Cleanup of OGR-related code.
d0c53e0 Fix bug: Relation wasn't found correctly from member.
24145f9 Use make_iterator helper function.
a8a287d Refactor count_not_removed function. (No template necessary.)
389332a Also print removed flag from member_meta.
5e7c5d0 Remove unnecessary overload of begin() and end() function in iterator_range.
2ec007f Do not add rings to invalid area, even if create_empty_areas is set.
fee8b73 Optionally keep type tag in area assembler. Better doc for config.
c7e1f8a Fix timer output in assembler code.
032ab40 Update change log.
dcfa439 Node location store keeps track of whether node ids are ordered.
54d5eb8 Add tests for new file based index code.
4fe5b30 Use correct empty value when initializing index.
40b5c79 Static or not static, that is the question.
aaa9b46 Open index file with minimum size, because zero-sized mmap is not allowed.
fea2337 Fix for disk-based indexes.
428a413 More tests of corner cases for id to location index.
9d2a31b Add config option to areas assembler for only creating some areas.
d11bf8d Count and report inner rings with the same tags as relation/outer rings.
bde10c4 Speed up copy of tags.
e4c9f87 Revert "Consistently remove some tags from area."
9cd7a03 Set areas assembly config setting create_empty_areas to true by default.
660fb63 Better ordering of OSMObjects.
b4199c2 Use std::strcmp instead of just strcmp.
579c34b Better field width/precision in problem reporter.
a2ebeeb Use field names with 8 characters or less in OGR problem reporter.
ef523fe Switch remaining "typedef"s to "using".
19425f8 Switching from "typedef" to "using" in geom code.
b13c2be More cases of switching from "typedef" to "using".
7f53977 Refactoring iterators: Not derived from std::iterator any more.
1922224 Consistently remove some tags from area.
295495f Fix check for detecting wrong role.
9aa6d46 Report more IDs in problem reporters.
d7a5da7 Remove now unused spike segment reporter.
0666d66 Only report duplicate segments if they belong to the same way.
9e17f89 Improved error reporting for area assembler.
e983a48 More code cleanup and docs.
927eeda Replace awkward std::pair construct by real class.
d0543b9 Various area code refactorings.
0ae8f07 Do not build areas for ways with tag area=no.
d4cabe7 Add some convenience functions to check for tags in TagList.
99f4be9 Add missing include.
a8dda78 Travis: Only run tests if build succeeded.
9db3034 Add missing "nodes" fields.
50e9fcb Report ways that are in multiple rings as errors.
58a3669 Add some paranoia asserts.
3958c1d Use iterator_range to make equal_range results easier to use.
c12c710 Add for_each_member() function to iterate over members of an mp relation.
ca35452 Change argument order in create_area() functions.
4473ae1 Keep stats on multipolygons with no tags on the relation.
12c5335 Bugfix: Check that there is a problem reporter before using it.
ec2afce Update change log.
5af2ec9 Use new area assembler interface in multipolygon collector.
73e3440 Some code cleanup in area code and new interface for calling assembler.
7737479 Add the number of nodes in area to problem reporter.
b4f9343 Use const_iterator where possible.
02372b2 Simplify code that checks for open rings.
8d6099e Pull out location_to_ring_map into details ns and add == and < ops.
1a05042 Mixed code cleanups and added comments.
4b8d1be Ignore empty role when checking inner/outer roles on multipolygons.
e22f573 Now GCC is complaining about the clang pragma...
48000c0 Add some missing includes and forward declarations.
ba9504a Workaround for bug in old libc.
a138265 Completely new algorithm for assembling multipolygons.
74054bd Add specialization of std::hash function for Location.
5ed4c90 Use newest gdalcpp.hpp with implicit transaction support.
676949e Add "locations_on_ways" support for OPL format, too.
ce05c19 Add support for reading/writing XML/PBF files with locations on ways.
62b2ee4 Fix checksum test.
bd512a8 Added "add_crc32" file option for adding CRC32 checksum to debug output.
3a100fa Incorporate locations in NodeRefs into CRC32 checksum.
ac02f86 Update catch.hpp to newest version. Removed outdated info in README.
481f48b When assembling areas ignore ways containing no or only a single node.
a0ae33a Fix unsigned overflow in pool.hpp.
91b8adf Fix undefined behaviour in WKB writer.
697f460 Check results of dynamic casts.
f1e4571 Fix from_item_type() implementation so it also works with undefined type.
65df99b Add future_queue_type alias to simplify code.
4340e4d Removed SortedQueue implementation which was never used.
cdd8f8c Add version.hpp with macros defining version of the library.
ff5d42a Update to newest gdalcpp.hpp.
a184f66 Update change log.
0ea76f7 Add osmium::Area::outer_rings() and inner_rings() functions.
b0404b7 New ItemIteratorRange class for iteration over buffers and subitems.
eff8a7c Add default type to string_to_object_id for IDs without type prefix.
e877a6f Clean up code inner vs. outer ring in geometry factory.
9224be5 Disable use of XML entities in OSM files.
9d9fa08 Output operator of location shows full precision of coordinates.
9a8e7c0 Documentation fixes.

git-subtree-dir: third_party/libosmium
git-subtree-split: 80df1d6850bdfa661587839b77dcea0ab8fc814a
2016-10-03 13:08:59 -04:00
karenzshea
5b4e2950d9 Merge commit '879f7eb04200d7d2c28af565229bf6e3d54274fd' into retry/libosmium 2016-10-03 13:08:59 -04:00
karenzshea
050585bbd9 rename dep update file, bump to osmium@2.9.0 2016-10-03 13:08:45 -04:00
karenzshea
89007ae669 Adapts Tile tests to protozero's strict iterator_range API from @daniel-j-h 2016-10-03 13:07:18 -04:00
Daniel J. Hofmann
b821a1dd98 Disables ld.gold on binutils < 2.26, resolves #2984 2016-10-03 15:41:40 +02:00
Moritz Kobitzsch
d1f1358e48 adjust for comments by daniel-j-h 2016-09-30 17:27:14 +02:00
Daniel Patterson
805d93912d Construct an adjacency list in order to discover turns. 2016-09-30 17:12:23 +02:00
Daniel Patterson
0b7b16abc0 Include new method in test mock objects. 2016-09-30 17:12:22 +02:00
Daniel Patterson
3dd7732ffc Add code comments and document some magic constants. 2016-09-30 17:12:22 +02:00
Daniel Patterson
c8eb2b2d11 Refactor edge unpacking so that it's CH indepenent and we don't repeat ourselves so much. 2016-09-30 17:12:22 +02:00
Lauren Budorick
14e7460465 Include turn information in debug tiles. 2016-09-30 17:12:20 +02:00
Daniel J. Hofmann
6290aeea93 Fixes Tile Unit Test Compilation 2016-09-30 16:58:50 +02:00
Moritz Kobitzsch
10b93c6908 re-introduce space into summaries 2016-09-30 14:36:09 +02:00
Moritz Kobitzsch
e4d0d49300 move summaries to car profile, test for references, use boost adaptors 2016-09-30 10:59:23 +02:00
karenzshea
cbb96ce7f4 handle empty names in summaries 2016-09-30 10:43:36 +02:00
karenzshea
54aaf574d9 removing caching from edge weight update test, so it runs fresh each time 2016-09-30 00:12:47 +02:00
Moritz Kobitzsch
a824e64682 Merge branch 'master' into guido/notification 2016-09-29 16:03:44 +02:00
Moritz Kobitzsch
df6186f0f1 fix documentation 2016-09-29 12:05:19 +02:00
Moritz Kobitzsch
78d530ddae fix polyline decoding 2016-09-29 11:56:51 +02:00
Moritz Kobitzsch
da15e1fc5e adjust case/add clarification 2016-09-29 10:50:28 +02:00
Ansis Brammanis
7e2663f2ad calculate roundabout radius from circumference, fix #2716 2016-09-29 10:42:42 +02:00
karenzshea
1a96483f7b prefer notification over new-name/suppressed types 2016-09-29 10:26:56 +02:00
karenzshea
3d5a53566c implement flag edge-weight-updates-over-factor, to log edge weight
updates over provided x factor
2016-09-28 15:19:59 +02:00
karenzshea
eafe3fa928 remove luajit support 2016-09-28 11:12:11 +02:00
Moritz Kobitzsch
6cfb1d6a85 add changelog for trip-changes 2016-09-28 10:51:21 +02:00
Moritz Kobitzsch
0abd32fca3 prefer first result 2016-09-28 10:32:33 +02:00
Daniel J. Hofmann
d1f555dcef Removes unused JSON logger.
References:
- https://github.com/Project-OSRM/osrm-backend/pull/2769
2016-09-28 10:01:56 +02:00
Moritz Kobitzsch
6cfd1c92e1 make changelog readable 2016-09-28 09:40:25 +02:00
Daniel J. Hofmann
bbbbacb073 Reworks Restriction Whitelist / Blacklist, resolves #2833
Takes a stricter aproach for whitelisting / blacklisting restrictions:

- uses `restriction=`
- uses more specific `restriction:<type>=`
- uses `except=<type>` to invert

Where `type` is the type of transportation to restrict, e.g. `motorcar`.

https://github.com/Project-OSRM/osrm-backend/issues/2833
2016-09-28 09:35:02 +02:00
Moritz Kobitzsch
e7b2f85a20 correct changelog 2016-09-28 09:34:10 +02:00
Moritz Kobitzsch
75de7c8eaf changelog updated 2016-09-28 09:06:44 +02:00
Michael Krasnyk
3f3c85ba72 Added profile files per test generation 2016-09-28 09:04:58 +02:00
Daniel J. Hofmann
89264eb89b Better documents profile request parameter, resolves #2952 2016-09-28 09:03:06 +02:00
Daniel Patterson
fa5714ab82 Unset FORTIFY_SOURCE before setting to avoid warnings for compilers where FORTIFY_SOURCE is predefined. (#2946) 2016-09-27 21:32:22 -07:00
Moritz Kobitzsch
8aa93f32cc add changelog entry for reduction of name changes 2016-09-21 12:45:59 +02:00
Daniel J. Hofmann
60010dd998 Reduce NewName Instructructions / Name Changes
With @karenzshea's name / ref split (ref. #2857) in master we want to
make use of it and reduce `NewName` instructions when ever possible.
This is a first step towards #2744 by using the already existing name
change heuristic from the extractor now in post-processing as well.

Limitations: at the moment we don't have the `SuffixTable` in
post-processing; this would require us serializing and subsequently
deserializing the table, passing it through from the profiles to the
API.
2016-09-21 12:42:39 +02:00
Moritz Kobitzsch
7ffe832ff8 add changelog entry for HOV change 2016-09-21 11:48:50 +02:00
Daniel J. Hofmann
a63b10972b Handle HOV designated-only Lanes, resolves #2929
In https://github.com/Project-OSRM/osrm-backend/issues/2711 we made
`hov=designated` routability configurable.

We want to handle designated-only lanes in the same way. Example:

    hov:lanes:forward=designated|designated
    hov:lanes:backward=designated

should have more or less the same effects as

    hov=designated

In contrast

    hov:lanes:forward=designated|no|yes hov:lanes:backward=yes

should not be handled. See

    https://github.com/Project-OSRM/osrm-backend/issues/2711

for explanation wrt. tag semantics with the difference that
backward/forward only set the backward/forward mode to inaccessible.

References:
- http://wiki.openstreetmap.org/wiki/Key:hov#hov:lanes.3D.2A
2016-09-21 10:56:42 +02:00
Michael Krasnyk
3eac6effbb
Fix "Error: write after end" and removed @bug tags
https://nodejs.org/api/child_process.html#child_process_event_exit
Note that when the 'exit' event is triggered, child process stdio streams might still be open.
2016-09-20 20:40:53 +02:00
Patrick Niklaus
7d124ce54d Close GH-2795: Rewrite cucumber test caching (and support logic). Fixes #2745 2016-09-19 14:13:44 -07:00
Moritz Kobitzsch
8522cddd61 Prevent loops in extraction based on merge 2016-09-19 13:33:52 +02:00
Daniel J. Hofmann
bf2b1a64b9 Fixes sign mismatch in Nearest limit comparison 2016-09-16 15:40:05 +02:00
Moritz Kobitzsch
70ee624e5c make changelog reasonable 2016-09-16 08:46:02 +02:00
Moritz Kobitzsch
3a49635eb7 remove dead code 2016-09-16 07:14:44 +02:00
Moritz Kobitzsch
aa5f8dce23 fix may be uninitialised warnings 2016-09-15 08:25:17 +02:00
Daniel J. Hofmann
c186e51a08 Do Not Copy Lane Strings Into Fn 2016-09-14 20:27:17 +02:00
Moritz Kobitzsch
861314256e fix roundabout-intersection on immediate exit 2016-09-13 19:16:45 +02:00
Moritz Kobitzsch
38f5adbe5c we can count 2016-09-13 16:22:22 +02:00
Moritz Kobitzsch
092e77e89b fix false positives in sliproads 2016-09-13 14:11:29 +02:00
Moritz Kobitzsch
64a72f574d also reserve entry for refs 2016-09-13 13:48:28 +02:00
Daniel Patterson
1b4a52e99c Update changelog for issue #2896 fix. 2016-09-12 15:14:50 -07:00
Michael Krasnyk
1d94eb88f6
Test for PR #2898
Test checks that osrm-extract terminates for
http://www.openstreetmap.org/way/198481519
2016-09-12 22:20:11 +02:00
Moritz Kobitzsch
b3c5a9c010 fix looping in sliproad handler for lanes 2016-09-12 18:20:28 +02:00
Daniel J. Hofmann
e3c1b133bf Adds a limit for number of results returned in Nearest service, resolves #2872 2016-09-12 11:59:08 +02:00
Daniel J. Hofmann
e6fe9d0d67 Fixes issue where two ways with same name but different pronunciation where deduplicated, resolves #2860 2016-09-09 18:28:44 +02:00
Daniel J. Hofmann
05c1fe7f46 We do duration based routing (also see #77); closes #2885 2016-09-09 16:27:00 +02:00
Daniel J. Hofmann
e3a38a6b0d Fixes compilation against newer Boost versions; seems like we were lucky before; closes #2889 2016-09-09 16:14:25 +02:00
Moritz Kobitzsch
2b9cf742c5 make sure to reserve enough external memory 2016-09-09 15:38:26 +02:00
Daniel J. Hofmann
a289e1cd96 Fixes bearing range of zero exhaustive graph traversal 2016-09-08 17:33:50 +02:00
Moritz Kobitzsch
c306a59854 make sure to not-collapse different travel modes 2016-09-08 15:01:25 +02:00
karenzshea
dcc1b5ab2b return name and reference separately 2016-09-08 14:28:23 +02:00
Moritz Kobitzsch
938dff011f handle all our new strings correctly, introduce rotary_pronunciation 2016-09-07 16:09:13 +02:00
Moritz Kobitzsch
9123c93a90 fix interaction between sliproads/segregated intersections 2016-09-07 12:36:29 +02:00
Moritz Kobitzsch
a551286a8f adjust testscases for collapse of use lane 2016-09-07 12:17:36 +02:00
Daniel J. Hofmann
86fd04e556 Improves lane handling for subsequent going straight, resolves #2625
Before we only worked on subsequent quick turns, as in:
`right, right` keeps the user on the rightmost lanes.

This changeset modifies the logic to work on any subsequent steps
that are "quick" and have lane information we can constrain later.

Because we do not have a from-lane => to-lanes mapping we take the
lanes left and right of the turn lanes into account when heuristically
assigning the leftmost / rightmost lanes.

There are some edge cases where this still does not give us the optimal
solution but it gets close to what is actually possible at the moment
without having a lane mapping in post-processing.

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2625

fix rebase
2016-09-07 12:17:36 +02:00
Moritz Kobitzsch
b6dbf81206 don't assign lanes on delayed turns 2016-09-07 12:17:34 +02:00
Daniel J. Hofmann
af47252efe Do not collapse away lane information as long as it is necessary 2016-09-07 12:17:00 +02:00
Moritz Kobitzsch
3b81b39998 turn lane handler moved to scenario based handling 2016-09-07 12:16:59 +02:00
Moritz Kobitzsch
802b93fa9a fix testcases, one case only works by turn restriction, needs investigation 2016-09-07 12:04:17 +02:00
Daniel Patterson
7899444135 Add example request to the route API esection 2016-09-06 10:31:08 -07:00
Daniel Patterson
1ab2b87cc0 Update turn penalty function to better fit measured data 2016-09-06 09:07:00 -07:00
Moritz Kobitzsch
97c66c6c82 added some concerns regarding the angles/length of the turns 2016-09-06 09:57:33 +02:00
Daniel J. Hofmann
733207d4a1 Be more strict classifying staggered intersections, resolves #2824 2016-09-06 09:57:33 +02:00
Moritz Kobitzsch
a0ed70f0a2 don't detect sliproads at wrong locations, don't emit invalid instructions 2016-09-06 09:01:06 +02:00
Moritz Kobitzsch
d3a6b5a77e detect broken roundabout-taggings 2016-09-05 16:49:57 +02:00
Moritz Kobitzsch
7a523713c7 remove broken assertion 2016-09-05 15:06:56 +02:00
Moritz Kobitzsch
f7265892ed correctly detect loss of prefix/suffix 2016-09-05 15:03:21 +02:00
Moritz Kobitzsch
be266c7c2b fix copy-paste typo in guidance lib 2016-09-05 15:00:42 +02:00
Moritz Kobitzsch
b1b41435b6 Revert "make sure collapse only happens on valid indices"
This reverts commit 47a6cd5462.
2016-09-05 14:54:30 +02:00
Moritz Kobitzsch
8f32a80778 changelog entry 2016-09-05 14:52:14 +02:00
Moritz Kobitzsch
5d79e0ac2f catch infinite loops 2016-09-05 14:52:13 +02:00
Moritz Kobitzsch
47a6cd5462 make sure collapse only happens on valid indices 2016-09-05 12:41:33 +02:00
Moritz Kobitzsch
7528b27f99 mark broken case todo 2016-09-05 11:50:36 +02:00
Daniel Patterson
a4f9499305 Invalid string values in lanes:psv:backward should result in 0 lanes,
not `nil`.
2016-09-04 14:23:43 -07:00
Daniel J. Hofmann
bb244e28bb Adds a failing test case for 255 unicode code points
The OSM spec says "up to 255 full unicode chars", so we should be able
to handle 255 x 🐼 --- but we don't.

The internal limit is on 255 _bytes_ in the `std::string`, but there can
be up to four bytes in a utf8 encoded code point.

References:
- http://wiki.openstreetmap.org/wiki/API_v0.6#Tags
- http://www.fileformat.info/info/unicode/char/1f43c/browsertest.htm
- https://en.wikipedia.org/wiki/UTF-8#Description
2016-09-02 16:10:32 +02:00
Moritz Kobitzsch
6fac14dbd8 ignore invalid only_* restrictions 2016-09-01 09:14:01 +02:00
Daniel J. Hofmann
8b144f22c9 Exposes osrm::exception for client usage, resolves #2813 2016-09-01 09:12:35 +02:00
karenzshea
146eb3a20e add test case for ignoring unknown restrictions 2016-08-31 09:52:05 -04:00
karenzshea
d8e444e620 explicitly return false for no_* restrictions 2016-08-31 08:33:56 -04:00
Patrick Niklaus
da9d63a384
Always overwrite m_is_core_node on data swap
This fixes a seg fault when swapping between core/no core datasets
2016-08-30 17:31:08 +02:00
Patrick Niklaus
c5e85f3d6d
Set parent nodes of core entry nodes not to themselves 2016-08-30 17:31:08 +02:00
Patrick Niklaus
e05750547c Merge pull request #2800 from oxidase/fix/2785
[ready] Don't use --gc-sections gold option for binutils < 2.25
2016-08-29 15:13:33 +02:00
Patrick Niklaus
315823cce1 Use service tag to penaltize alleys and forbid emergency access 2016-08-29 14:15:22 +02:00
Patrick Niklaus
6ff07f4e82 State all turn penalties in seconds 2016-08-29 13:54:56 +02:00
Michael Krasnyk
41b54cf25d
Don't use gold gc-sections for binutils < 2.25
Issue 2785: check gold binutils version and don't use gc-sections for versions prior 2.25
due to https://sourceware.org/bugzilla/show_bug.cgi?id=17639

readelf --debug-dump=frames build/libosrm_extract.so
Contents of the .eh_frame section:
...
readelf: Warning: Invalid length 0xfff01dd8 in FDE at 0x000020
2016-08-25 23:51:25 +02:00
Patrick Niklaus
5ee15ee339
Use webkit code snippet to detect GNU gold 2016-08-25 22:45:49 +02:00
Patrick Niklaus
01b0bce2d5
Use gold linker by default if available 2016-08-25 22:45:49 +02:00
Patrick Niklaus
cb57ccacef Merge pull request #2805 from rkcpi/centos-build-fix
Fix build on CentOS
2016-08-25 10:43:43 +02:00
Moritz Kobitzsch
7e0d14b113 make collapse work by better detecting continue/non-continue situations 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
d06eec5e42 improve segregated road detection 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
9648821a79 handle missing cases, cleaning up 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
21fb18fe5e identify merges on non-perception cases 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
6a2518c0df handle stronger merge cases as well 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
7886d06839 adjust angles pre-merge as well 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
5a9eb6ef72 prepare solution 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
b6c3d1d5bf Cucumber Scenario for #2725 2016-08-24 10:34:07 +02:00
Moritz Kobitzsch
9b2f6585fb handle non-through case 2016-08-24 10:12:27 +02:00
Moritz Kobitzsch
46fd17a9ff moved obviousness discovery. updated sliproad handler. back to original cases failing 2016-08-24 10:12:27 +02:00
Daniel J. Hofmann
da73bae9c6 Scenario for unnecessary slight left onto Stralauer Str 2016-08-24 10:12:27 +02:00
Moritz Kobitzsch
766e2713ab fix segmentation fault for via-routes with invalid intermediate segments 2016-08-23 14:17:32 +02:00
Sandra Thieme
9957254a5a Use c++1y instead of c++14 2016-08-23 13:01:07 +02:00
Patrick Niklaus
9f6859561c Merge pull request #2796 from frodrigo/update_car_profile_from_omim
Add local maxspeed for Netherland
2016-08-22 23:20:17 +02:00
Frédéric Rodrigo
88573a66cd Add local maxspeed for Netherland 2016-08-22 18:53:33 +02:00
Moritz Kobitzsch
3ccbe9842c
add a PR template to the repo 2016-08-19 14:21:20 +02:00
Daniel J. Hofmann
5971822f82
Enable data flow guided fuzzing using traces 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann
cdf6baba1d
Add fuzz testing drivers for json escaping and uri decoding 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann
4b7ddb6826
Add fuzz testing drivers for url and request parser 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann
06b74c1f08
Add fuzz testing drivers for all parameters 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann
3a0eed2ee5
Make sanitizer used for Fuzz testing configurable via FUZZ_SANITIZER 2016-08-19 13:59:59 +02:00
Daniel J. Hofmann
2557bdcf39
Basic Fuzz Testing.
[100%] Fuzzing libosrm
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-0.log 2>&1
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-1.log 2>&1
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-2.log 2>&1
    /tmp/osrm-backend/build/fuzz/driver -max_len=4096 corpus  > fuzz-3.log 2>&1

References:
- http://llvm.org/docs/LibFuzzer.html
- http://llvm.org/releases/3.8.0/docs/LibFuzzer.html
- https://github.com/Project-OSRM/osrm-backend/issues/1678
2016-08-19 13:59:59 +02:00
Patrick Niklaus
12d478784b
Enable toll roads by default again.
Currently we don't route over the Golden Gate bridge by default.
This sets the value to false by default. To test the behavior for
tolls when ignored, we would need issue #2781 implemented.
2016-08-19 13:01:15 +02:00
Moritz Kobitzsch
38fef77d70
additional collapse cases 2016-08-19 12:43:51 +02:00
Moritz Kobitzsch
e8bae78749
fix errors introduced in refactor 2016-08-18 11:36:36 +02:00
Moritz Kobitzsch
e14bc30428
adjusted for comments 2016-08-18 11:36:36 +02:00
Moritz Kobitzsch
9485c97738
adjusting u-turn handling in lane matching to fully fix 2706 2016-08-18 11:36:36 +02:00
Patrick Niklaus
11aed6c93e Merge pull request #2734 from oxidase/gdb-printers
Added gdb pretty printers
2016-08-18 11:24:16 +02:00
Daniel J. Hofmann
d53c267129
Be more aggresive classifying Roundabout Intersections.
Roundabout Intersections are roundabouts with up to four ways and turn
angles which makes the turns obvious, e.g. as in:

```
    *
    *
* *   * *
    *
    *
```

but not

```
     *
    *
* *   *
    * *
     * *
```

For Roundabout Intersections we issue instructions such as
"turn <direction>" instead of "take the <nth> exit".

At the moment we have a limit on the radius for these Roundabout
Intersections of 5 meters. Which fails to classify a wide range of
Roundabout Intersections in the US (with the US-wide streets).

This changeset removes the Roundabout Intersection radius limit:

- if the roundabout is larger than a threshold and is named we classify
  it as a rotary

- if the roundabout matches our criteria for Roundabout Intersections
  we classify it as a Roundabout Intersection

- else fallback to plain old Roundabout

There is a second issue with determining a roundabout's radius.
But that's for another pull request (tracking in #2716).

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2716
2016-08-18 10:50:32 +02:00
Patrick Niklaus
2f6de614c1
Ignore any following columns in a CSV file 2016-08-18 10:19:36 +02:00
Moritz Kobitzsch
087080a6c3 mark via-case todo to prevent known failure to show up in local cucumber 2016-08-15 15:52:47 +02:00
Patrick Niklaus
41b22916f3 Merge pull request #2756 from gojuno/turn_annotation_bugfix
JSON instruction serialization fix.
2016-08-12 19:14:47 +02:00
Lev Dragunov
89f1071947 Static checks for guidance array sizes. 2016-08-12 18:52:54 +03:00
Moritz Kobitzsch
464de785cb fix removal of multiple geometries for first vertex 2016-08-09 12:02:07 +02:00
Lev Dragunov
8986777c58 JSON instruction serialization fix. 2016-08-08 20:32:01 +03:00
Daniel Patterson
65def1a9e2 We should be returning an error if any errors that occur during reprocessing. 2016-08-05 15:11:12 -07:00
Daniel Patterson
176c2244ad Catch and report errors during osrm-contract tests. 2016-08-05 14:19:22 -07:00
Daniel J. Hofmann
b161e10b73 No Go To 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann
5bef5dcb04 Disable our added failing cucumber tests for now 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann
46a4c27582 Fall back to generic match finding if not a reverse-lane 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann
acc6da86de Skip handling none values for our edge cases for now..
Conflicts:
	src/extractor/guidance/turn_lane_augmentation.cpp
2016-08-05 18:32:42 +02:00
Daniel Patterson
4d84bc0f01 Add a minimal version of the failing test case. 2016-08-05 18:32:42 +02:00
Daniel J. Hofmann
c737635a3b Reproducing breaking intersection in cucumber scenario
Conflicts:
	src/extractor/guidance/turn_lane_augmentation.cpp
2016-08-05 18:32:42 +02:00
Daniel J. Hofmann
b7eeafb183 Try to come up with a small test case 2016-08-05 18:32:42 +02:00
Patrick Niklaus
677306eeee Merge pull request #2707 from oxidase/left_side_driving
Left side driving
2016-08-05 18:09:10 +02:00
Patrick Niklaus
2284ebaacb
[skip ci] Iterate on the release docs 2016-08-05 18:07:28 +02:00
Patrick Niklaus
6b4975b2e4
Fix the release branch 2016-08-05 18:07:28 +02:00
Johan Uhle
94c38d115a
Fixing up the release flow docs
- Clarifying guarantees between patch/minor/major versions
- Consolidating version release flow into one flow for patch/minor/major versions
- Add constraint that all minor/major released code needs to have had a release candidate before
2016-08-05 18:07:28 +02:00
Daniel J. Hofmann
b1e309b4eb
Collapse Staggered Intersections.
Staggered intersection are very short zig-zags of only a few meters.
They are common in rural and exurban areas, especially in the US.

(In addition, these cases could as well be tagging issues)

We do not want to announce these short left-rights or right-lefts:

          * -> b      a -> *
          |       or       |       becomes  a   ->   b
     a -> *                * -> b

Here is one example:

- https://www.openstreetmap.org/edit#map=20/39.26017/-84.25182

And here are two edge-cases that we don't handle at the moment:

- http://www.openstreetmap.org/edit#map=20/38.87900/-76.98519
- http://www.openstreetmap.org/edit#map=19/45.51056/-122.63462

and probably should not handle since the distance in between is
quite long (roughly 7-15 meters). For these we want to announce
two turns to not confuse the user.

Thanks to @1ec5 for raising this issue and @karenzshea for
providing additional US examples and cultural insights.
2016-08-05 14:35:13 +02:00
Patrick Niklaus
e8ce119972 Merge pull request #2743 from Project-OSRM/avoid-10m-timeout
Set cacher timeout just under 10 minutes
2016-08-05 10:32:12 +02:00
Dane Springmeyer
8b7cd2931b set cacher timeout just under 10 minutes 2016-08-04 17:16:53 -07:00
Daniel J. Hofmann
8bee57b0b0 Makes toll=yes way's routability configurable in profiles.
The primary use-case is conditionally filtering ways such as:

https://www.openstreetmap.org/edit#map=18/38.94198/-77.28127

which we are guiding the user onto in the route from DC to IAD:

http://map.project-osrm.org/?z=12&center=38.934443%2C-77.167969&loc=38.902656%2C-77.029095&loc=38.952210%2C-77.453424&hl=en&alt=0

This changeset makes `toll=yes` configurable in the profiles, disabling
them by default. Neither do we support time-based fees nor vehicle
category fees at the moment.

References:
- http://wiki.openstreetmap.org/wiki/Key:toll
2016-08-04 14:29:22 +02:00
Patrick Niklaus
6bfe3a2d41 Merge pull request #2733 from gavinsherry/master
Remove unused variable node_info_list
2016-08-04 11:24:33 +02:00
Daniel J. Hofmann
7f71f0ed12 Warn on unused return values in guidance code, resolves #2686.
https://github.com/Project-OSRM/osrm-backend/pull/2685/files

fixes an issue where we did

    elongate(fstStep, sndStep);

instead of

    newStep = elongate(fstStep, sndStep);

we didn't get any warnings.

The only way to trigger a warning here is to use

```cpp
__attribute__((warn_unused_result))
```

This changeset does exactly that: for the new guidance code prone to
these kind of issue we add such an attribute to the declaration.
2016-08-03 12:26:07 +02:00
Daniel J. Hofmann
583aaff286 Makes designated HOV way's routability configurable in profiles.
Why only `hov=designated` and not all access tags, such as `hov:yes`,
`hov=no` and so on? From the Wiki:

- designated: The way is designated to high occupancy vehicles.
- yes: High occupancy vehicles are allowed. This by itself does not imply that other vehicles are restricted from using the way.
- no: High occupancy vehicles are not allowed on the way. This by itself does not imply that other vehicle types are allowed to use it.

The primary use-case is conditionally filtering ways such as:

http://www.openstreetmap.org/way/11198593#map=19/37.82571/-122.30521&layers=D

In addition there is a notion of HOV lanes for lane handling:

http://wiki.openstreetmap.org/wiki/Key:hov#hov:lanes.3D.2A

This changeset does not handle lanes at all, only designated HOV ways.
For HOV lane support, a logic similar to the lane access handling needs
to be implemented. This needs to go hand in hand with the existing lane
handling introduced in:

7d076e9344

References:
- #2711
- http://wiki.openstreetmap.org/wiki/Key:access
- http://wiki.openstreetmap.org/wiki/Key:hov#Values
2016-08-03 12:24:43 +02:00
Daniel J. Hofmann
b24f5c7c1a Adapt lane dump to lanes at intersection (#2675), resolves #2709 2016-08-03 12:19:14 +02:00
Daniel J. Hofmann
026f71934b Adds Cucumber Scenario for sharp left turn at traffic light 2016-08-03 12:18:31 +02:00
Michael Krasnyk
1353d55880
Added gdb pretty printers 2016-08-02 23:32:42 +02:00
Gavin Sherry
b09f637d02 Remove unused variable node_info_list 2016-08-02 14:17:57 -07:00
Michael Krasnyk
979f9cab20
Added test for issue #2706 2016-08-02 19:06:10 +02:00
Michael Krasnyk
eb6083daf5 Fix travis build 2016-08-02 12:31:46 +02:00
Daniel J. Hofmann
c4718495a0
Add Florida Ave NW scenario for TurnLeft instead of MergeRight 2016-07-30 23:55:39 +02:00
Moritz Kobitzsch
0d36d472c9
change paradigm of merge to only emit on motorway-like roads 2016-07-30 23:55:39 +02:00
Daniel Patterson
35422a0fb5
Clang format. 2016-07-30 23:53:38 +02:00
Daniel Patterson
d012b44b7f
Filter out edges that have any speed=0 segments.
They become non-snappable and non-routable.  Note that a single segment
of speed=0 will eliminate the entire edge.
2016-07-30 23:53:38 +02:00
Patrick Niklaus
eda6d9dc7c
Builds components on travis again 2016-07-30 23:49:35 +02:00
Patrick Niklaus
63c86198a3
Fix compilation of components.cpp 2016-07-30 23:49:35 +02:00
Patrick Niklaus
33bdfe9cf9 Merge pull request #2720 from oxidase/issue/2706
Fix #2706 by using correct fallback u-turn
2016-07-30 16:25:26 +02:00
Michael Krasnyk
a87c5998a1
Fix #2706 by using correct fallback u-turn
Regression is due to a combination of 08248e3853
and http://www.openstreetmap.org/changeset/40938983
where in ways http://www.openstreetmap.org/way/27292481
and http://www.openstreetmap.org/way/432488408
nodes
4315134884 (part of way 432488408)
4315134891 (part of way 432488408)
4315134886 (part of way 432488408)
form a u-turn that has index 0 after sorting and used as an allowed one
with a reversed edge.
A u-turn that corresponds to the condition uturn_could_be_valid == true has index 1
and ignored.
2016-07-30 12:15:22 +02:00
Michael Krasnyk
c918a7957b
Updated format and ChangeLog 2016-07-28 22:59:22 +02:00
Michael Krasnyk
61e6afdef0
added a lanes test in clockwise roundabouts 2016-07-28 22:59:22 +02:00
Michael Krasnyk
95dc36e908
addressed comments
Signed-off-by: Lauren Budorick <lauren@mapbox.com>
2016-07-28 22:59:22 +02:00
Lauren Budorick
951a4dc112
commit test file 2016-07-28 22:59:22 +02:00
Lauren Budorick
c09b9b4c99
Initial left hand driving implementation 2016-07-28 22:59:22 +02:00
Patrick Niklaus
b0873e2aa4 Merge pull request #2712 from Project-OSRM/talk-to-us
Talk to us!
2016-07-28 11:11:00 +02:00
Daniel J. Hofmann
2bdb8fce63 Talk to us! 2016-07-28 11:01:51 +02:00
Konstantin Shalnev
d8a692740a Added 'return EXIT_SUCCESS' (#2710) 2016-07-27 16:31:57 -07:00
Patrick Niklaus
14797c421e Reformated the docs for annotations 2016-07-27 15:51:11 -07:00
Daniel Patterson
280b000f07 Include datasources for each segment in route annotation. 2016-07-27 15:51:11 -07:00
Daniel J. Hofmann
fb4834458e No longer hard crash datastore on unrecognised options 2016-07-27 11:33:56 +02:00
Patrick Niklaus
c7a1576100
Apply clang-format again 2016-07-26 15:00:58 +02:00
Daniel Patterson
aebf6fa0b1
[skip ci] Update format script to enforce clang-format version, and work on OSX 2016-07-26 15:00:14 +02:00
Johan Uhle
f76e3d4522 Docs: Clarify turn lanes on missing data
After https://github.com/Project-OSRM/osrm-backend/issues/2675#issuecomment-235230198
2016-07-26 13:18:01 +02:00
Daniel J. Hofmann
eaf42ba437
Moves invalid id warnings to debug, closes #2630 2016-07-26 13:01:31 +02:00
Patrick Niklaus
e83905b783
Fix exception handling around unrecognised options 2016-07-26 11:43:08 +02:00
Daniel Patterson
0b868969be
Remove generic std::exception handlers, they don't seem to be adding value, and they hide useful info. 2016-07-26 11:43:08 +02:00
Patrick Niklaus
b4710633b1
Rename function to reduce confusion 2016-07-26 11:23:14 +02:00
Moritz Kobitzsch
7d076e9344
handle access flags for lanes 2016-07-25 20:01:58 +02:00
Dane Springmeyer
71d64e8cd9
Default to c++14 / drop g++-4.8 from testing matrix 2016-07-25 19:30:43 +02:00
Daniel J. Hofmann
748fd3efa9
Remove lanes from roundabouts, closes #2626
After half a day of looking at the tagging and the data came to the
following conclusion:

We can't keep the user to the innermost / outermost lanes depending on
the exit the route takes: we found situations where both heuristics were
wrong.

Even on popular roundabouts the tagging is often wrong or in the best
case not present at all.

There are at least two different ways to interpret roundabout
indications: 1/ where e.g. a right arrow on the lane indicates turn
restrictions for the roundabout and the need to take this lane to exit
the roundabout to the right (possibly skipping multiple exits) and 2/
where a right arrow just means this is a lane in a immediate right turn.

Example: Australia marks lanes with arrows that seem to indicate
"angles you can exit the roundabout from", for example, these two ways:
- http://www.openstreetmap.org/way/320941710
- http://www.openstreetmap.org/way/42918021

Whereas Germany marks lanes with "directions you can travel in these
lanes immediately after entering the roundabout":
- http://www.openstreetmap.org/way/52578338

These two different interpretations of how to draw the arrows on the
roads mean we have conflicting solutions to "which lanes can you use to
take exit B from entry A" based on locality.

Continuing to tag ways based on lane markings is no problem, but
unfortunately, we can't reliably resolve good advice for navigation
system users (like "use the inside lane to take the second exit at the
roundabout"), there are too many situations that would generate bad
instructions (instructions that tell users to go into a lane they
shouldn't use).
2016-07-25 19:29:55 +02:00
Moritz Kobitzsch
1fc63e1e72
move hardcoded road priorities into profiles, change road classification 2016-07-25 13:07:54 +02:00
Daniel J. Hofmann
fd6bb5ec1f Lane Handling for multiple indications per lane as in left;left|, fixes #2694
Before we asserted on unique lane indications per lane. Turns out the
OSM data contains lane strings such as:

    left;left|right

Which represents two lanes as in:

    <<     >
     ||    |

The two left indications _on a single lane_ look like data issue.
And we can't represent this with our enum-approach at the moment.

We don't want to crash there, so silently swallow this and
generate a single left|right for it.
2016-07-25 12:17:23 +02:00
Patrick Niklaus
261dbf3edd
Fix log output of osrm-extract 2016-07-25 12:03:30 +02:00
Moritz Kobitzsch
9e323d2d42
improve sliproad / fork handling 2016-07-22 15:16:59 +02:00
Konstantin Käfer
1309dd2a0f
Switch profiles from Lua to library interface
There's now an abstracted interface and no direct calls to Lua anymore.

fixes #1974
2016-07-22 15:03:57 +02:00
Patrick Niklaus
9b737230d6
Reenable ARM builds 2016-07-22 13:57:57 +02:00
Patrick Niklaus
ecbd709535
Update the changelog for 5.3.0 2016-07-22 13:57:28 +02:00
Patrick Niklaus
060ec99678
Fix devide by zero when updating speeds 2016-07-21 18:57:21 +02:00
Dane Springmeyer
3601d1d262
increase travis cacher timeout to ensure large caches are able to be uploaded and downloaded 2016-07-21 17:58:57 +02:00
Moritz Kobitzsch
41ba20ca9a switch api format to new structure 2016-07-21 17:42:10 +02:00
Patrick Niklaus
57e3f173d3
[skip ci] Update docker files to gcc 5 2016-07-21 17:19:35 +02:00
Patrick Niklaus
92c298c7cf
[skip ci] Fix example URLs in readme 2016-07-21 17:08:39 +02:00
Moritz Kobitzsch
b25011ee60 fix use-lane handling 2016-07-21 16:37:54 +02:00
Moritz Kobitzsch
0e017a6ce5 collapse use-lane instructions if possible 2016-07-20 10:23:26 +02:00
Moritz Kobitzsch
2431e15ffa mark second case as todo, see https://github.com/Project-OSRM/osrm-backend/issues/2661 2016-07-20 09:55:30 +02:00
Moritz Kobitzsch
396add1e9d make roundabout maneuvers continuous with respect to lane changes 2016-07-20 09:55:30 +02:00
Patrick Niklaus
86241a2793
[skip ci] Add docs for contributing 2016-07-19 17:38:03 +02:00
Moritz Kobitzsch
ee47afbe17 fix 2672 2016-07-19 17:06:47 +02:00
Moritz Kobitzsch
8831ca2f32 fix roundabouts with traffic lights 2016-07-19 14:49:09 +02:00
Daniel J. Hofmann
abde215bc3 Remove semantically wrong ordering for LaneTupel 2016-07-18 12:33:56 +02:00
Daniel J. Hofmann
130d5298fc Fixes Undefined Behavior in LaneTupel (Strict Aliasing), resolves 2665
It's complicated :sigh: read this please:
http://dbp-consulting.com/tutorials/StrictAliasing.html

tl;dr: has to go through a memcpy (in C++) as in:
184cc11cee/src/support/utilities.h (L29-L40)
2016-07-18 12:32:25 +02:00
Moritz Kobitzsch
50cbba1620 adding a todo testscase / regression test-case 2016-07-15 10:35:25 +02:00
Patrick Niklaus
2cc293ad16
[skip ci] Update changelog for RC3 2016-07-13 21:57:07 +02:00
Patrick Niklaus
6ac65a922f
Disable ARM builds until sourceforge comes up again 2016-07-13 14:19:33 +02:00
Patrick Niklaus
3d80f989d0
Fix tests after cucumber update and changed escaping. 2016-07-13 11:48:53 +02:00
Patrick Niklaus
4fcb5d28a4 Merge pull request #2624 from oxidase/issues/2617
Fix ambiguous data issues
2016-07-13 11:20:40 +02:00
Patrick Niklaus
3ebdacf369 Merge pull request #2629 from ssuluh/master
Fix windows compilation with regard to struct/class packing
2016-07-13 11:08:34 +02:00
Moritz Kobitzsch
2ddc00c21e
update cucumber to 1.2.1 and remove hack 2016-07-13 11:04:35 +02:00
Daniel J. Hofmann
e76e39a398
Improves Lane Handling for Multi-Hop Roundabout Instruction
This changeset implements Lane Anticipation on roundabouts, delimited
by enter / leave step pairs. It does not handle lane anticipation
within a roundabout.

Lane anticipation happens on the granularity of a valid roundbaout:

We discard partial roundabout (enter without exit or exit without
enter) or data issues (no roundabout, exit before enter).

Related:

- https://github.com/Project-OSRM/osrm-backend/issues/2626 for lanes
  within a roundabout

- https://github.com/Project-OSRM/osrm-backend/issues/2625 for handling
  going straight in lane anticipation
2016-07-13 10:44:12 +02:00
Patrick Niklaus
04667f1ed8
Log incoming requests before they are processed 2016-07-11 16:50:09 +02:00
Surya Suluh
2091c3443b Fix windows compilation with regard to struct/class packing 2016-07-11 09:47:04 -04:00
Michael Krasnyk
2b466b2fb2
Fix ambiguity in edges by using names lexicographical order 2016-07-11 05:54:30 +02:00
Michael Krasnyk
e17b306265
Fix ambiguity in edge weights by using minimal weight 2016-07-08 18:20:55 +02:00
Daniel J. Hofmann
b00b15ab98 Manual modernize run with LLVM 3.8
More is blocked by:
- https://github.com/Project-OSRM/osrm-backend/issues/2631
2016-07-07 12:45:24 +02:00
Moritz Kobitzsch
f4db79fe9b fix obvious turn collapsing for straight turns 2016-07-06 10:50:47 +02:00
Moritz Kobitzsch
0e4061f858 deduplicate code for roundabout handling 2016-07-01 11:34:44 +02:00
Moritz Kobitzsch
043a1446e1 adjust changelog (mention both files) and update a typo 2016-06-30 10:39:05 +02:00
Moritz Kobitzsch
49221995e8 add documentation on use lane type 2016-06-28 17:53:31 +02:00
Moritz Kobitzsch
247a7488b8 Adjusting Changelog 5.3.0-rc.2 to follow scheme 2016-06-28 13:25:35 +02:00
Moritz Kobitzsch
1806198971 Prepare Update to 5.3.0 RC2 2016-06-28 13:22:33 +02:00
Moritz Kobitzsch
375331b80c fixing lua issue in profile 2016-06-28 12:59:02 +02:00
Patrick Niklaus
8fdbe965cc
[skip ci] Fix documentation 2016-06-28 11:08:37 +02:00
Patrick Niklaus
dc77d02e8a
Change OSRM version to 5.3.0 2016-06-28 10:35:45 +02:00
Moritz Kobitzsch
6265b8fa77
fix broken assertion 2016-06-28 10:30:02 +02:00
Moritz Kobitzsch
311b348d09
handle sliproads at traffic lights 2016-06-28 10:23:22 +02:00
Daniel Patterson
ec02cdc4cc Use mmap instead of read - it's a lot faster here.
Also clean up construction of STRONG_TYPEDEF so that it can be
packed properly in structs (this explains all the () -> {}) changes
here.
2016-06-27 17:24:30 -07:00
Moritz Kobitzsch
5905708111 expose lanes as enums, adjusted for comments 2016-06-27 11:12:02 +02:00
Moritz Kobitzsch
5d91b759d1 Implement Turn Lane Api 2016-06-27 10:07:48 +02:00
Daniel J. Hofmann
ec0a1a4ab1 Anticipate Lane Changes 2016-06-27 10:07:43 +02:00
Moritz Kobitzsch
efa29edf09 basic turn lane handling 2016-06-27 10:07:41 +02:00
Moritz Kobitzsch
2a05b70dfc
reduce number of end-of-road instructions in unnecessary cases 2016-06-26 16:40:15 +02:00
Patrick Niklaus
8693e68271 Merge pull request #2588 from Project-OSRM/fix/bike_surface_speeds
bike: surface should never increase speed
2016-06-26 16:37:12 +02:00
Emil Tin
d21a9a514d bike: surface should never increase speed 2016-06-25 12:52:54 +02:00
Moritz Kobitzsch
e03d132823
fix invalid circle centers 2016-06-24 15:12:51 +02:00
Daniel J. Hofmann
61ba985bc9
Prevent linker from discarding TBB symbols we need, fixes #2557
We build `osrm_contract` (the library) linking in libtbb. We then
build `osrm-contract` (the binary) linking in `osrm_contract` (the
library).

Because we're only using TBB's `parallel_invoke` in the code for the
binary, it seems like the linker discards some symbols in the library.

Therefore we have to link libtbb for the binary again. Even worse, the
order now matters: if we first link in `osrm_contract` and then libtbb,
we're still hitting the issue re. discarded symbols.

Therefore we first link in all dependencies (libtbb, libboost*), and
only then `osrm_contract`.

Strictly speaking, we probably have to do this for all of our binary
targets, or we will hit similar issues in the future.
2016-06-24 12:06:28 +02:00
Moritz Kobitzsch
4629a20fe4
improve handling of obvious for end-of-road situations 2016-06-24 12:05:42 +02:00
Patrick Niklaus
a28125ee9a Merge pull request #2577 from noblige/noblige/compile-armv7
option to disable LTO
2016-06-24 12:04:02 +02:00
Daniel J. Hofmann
df877aca1b Hard-abort on assertion and show detailed information, solves #2579
From

> [warn} oops

to

> [assert] /tmp/osrm-backend/src/extractor/extractor.cpp:79
> in: int osrm::extractor::Extractor::run(): false
> terminate called without an active exception
2016-06-23 18:57:35 +02:00
Aleksei Potov
05dc415aba option to disable LTO 2016-06-23 09:44:02 -07:00
Daniel Patterson
6dedd9cb72 Fix segfault when route includes very short segments. 2016-06-22 14:48:57 -07:00
Daniel J. Hofmann
256d39b572 Sync OSRM version in CMakeLists, fixes #2576 2016-06-22 17:03:31 +02:00
Patrick Niklaus
d186ae1863
Fix semi-colon warnings 2016-06-22 13:20:55 +02:00
Patrick Niklaus
fddc19e98d
Fix regressed formating 2016-06-21 22:25:48 +02:00
Lauren Budorick
2592cd2e58
Update tests to catch 0-subtraction error 2016-06-21 19:31:46 +02:00
Patrick Niklaus
93b6438cea
Fix fromTop and fromLeft calculation 2016-06-21 19:31:46 +02:00
Daniel J. Hofmann
f6746d88b7
Removes unused -s from osrm-datastore, use osrm-springclean tool, closes #2561 2016-06-21 18:09:11 +02:00
Daniel J. Hofmann
34ace4dd4b
Let Travis fail fast if CMake/Clang download fails, fixes #2433 2016-06-21 18:08:19 +02:00
Daniel J. Hofmann
41d0f42ddf
Show user hint on wrong Node.js version, fixes #2435.
This is more of a hack but looks like the best we can do.

The reason for this is the following:

1/ we require strict mode for our v4 script

2/ v0.10 in strict mode marks 'let' as a reserved keyword,
   aborting before execution any code in the script. Thus,
   we can't assert e.g. on process.versions['node'] !== '4'.
2016-06-21 18:07:35 +02:00
Moritz Kobitzsch
2868f702a5
fix issues with roundabouts and intersections and sliproads 2016-06-21 16:56:57 +02:00
Patrick Niklaus
ec4dcee8bd Merge pull request #2549 from oxidase/issue/2546
Fix omitting the last point's coordinates in the geometry field
2016-06-21 16:41:35 +02:00
Michael Krasnyk
8c378191df
Fix omitting the last point's coordinates in the geometry field 2016-06-21 07:06:43 +02:00
Daniel J. Hofmann
b98431e8e6
Use BaseDataFacades in guidance and prevent ODR violations with inline 2016-06-21 00:49:06 +02:00
Moritz Kobitzsch
3c8781855e
handle steep off-ramps 2016-06-21 00:47:43 +02:00
Patrick Niklaus
27a94f3ca6 Merge pull request #2504 from oxidase/issue/2502
Fixes for i686 and armhf platforms
2016-06-20 22:01:09 +00:00
Michael Krasnyk
04e334e3e2
Make storage blocks aligned to 4 bytes for ARM NEON/VFP instructions
Aligned blocks prevent bus errors in NEON/VFP instructions.

Block pointers are aligned to 4 bytes, that is guaranteed
by aligned mmaped-pointers, the 4 bytes size of the CANARY block and
aligned sizes of blocks.
2016-06-20 22:45:40 +02:00
Michael Krasnyk
12d4832037
Fix platform-independent data in data files 2016-06-20 22:45:40 +02:00
Michael Krasnyk
6e4f6fec91
Added armhf Travis build 2016-06-20 22:45:40 +02:00
Michael Krasnyk
57c9525e5c
Added i686 Travis build 2016-06-20 22:45:40 +02:00
Michael Krasnyk
543e4fb57d
Fix rounding issue in query coordinates by using toFixed
that internally uses boost::numeric_cast<std::int32_t>
instead of static_cast<std::int32_t>
2016-06-20 22:45:40 +02:00
Michael Krasnyk
3881ead8e5
Fix rounding issue due to non-associative floating arithmetic
Failing test
features/car/traffic_turn_penalties.feature:33

Tables were not identical:
    from |     to |     route |     speed |     time
|     a |     h |     ad,dhk,dhk |     63 km/h |     11.5s +-1 |
|     i |     g |     fim,fg,fg |     59 km/h |     12s  +-1 |
| (-) a | (-) e | (-) ad,de,de | (-) 57 km/h | (-) 12.5s +-1 |
| (+) a | (+) e | (+) ad,de,de | (+) 58 km/h | (+) 12.5s +-1 |
|     c |     g |     cd,de,ef,fg,fg |     63 km/h |     23s +-1 |
|     p |     g |     mp,fim,fg,fg |     61 km/h |     23.5s +-1 |
|     a |     l |     ad,dhk,kl,kl |     60 km/h |     24s +-1 |
|     l |     e |     kl,dhk,de,de |     59 km/h |     24.5s +-1 |
|     g |     n |     fg,fim,mn,mn |     57 km/h |     25s +-1 |
2016-06-20 22:45:40 +02:00
Michael Krasnyk
911d1e81b6
Make explicit promotion to int64_t
to avoid incorrect promotions for 32 bit size_t
2016-06-20 22:45:40 +02:00
Michael Krasnyk
ae06300c17
Fix unused variables warnings in crc32 2016-06-20 22:43:28 +02:00
Michael Krasnyk
26879ca91a
Make build directory configurable via OSRM_BUILD_DIR in tests 2016-06-20 22:43:28 +02:00
Moritz Kobitzsch
306744e5cb fix roundabout-handling when name changes 2016-06-17 11:02:14 +02:00
Moritz Kobitzsch
3ca32898a1
move guidance decision into debug header 2016-06-15 11:30:30 +02:00
Patrick Niklaus
532fda267f [skip ci] Update changelog for 5.2.1
Conflicts:
	CHANGELOG.md
2016-06-14 14:32:33 +02:00
Daniel Patterson
494845b160 Copy data to beginning of buffer, not end. (#2542)
Copy data to beginning of buffer, not end.
2016-06-13 12:59:42 -07:00
Patrick Niklaus
0fc823041e
Removed debug code 2016-06-13 17:57:33 +02:00
Patrick Niklaus
71eae4137d
[skip ci] Update changelog 2016-06-13 17:27:53 +02:00
Moritz Kobitzsch
47b19f209b prefer obvious turn assignment over forks 2016-06-13 15:00:18 +02:00
Moritz Kobitzsch
2b5355edca
improve slipway handling to allow multiple styles of turn lanes / turn roads 2016-06-13 11:56:50 +02:00
Patrick Niklaus
e9a0beb4e8
Fix shared memory encoding for node-ids 2016-06-12 20:50:57 +02:00
Vladimir Kurchatkin
6bdfe68897 Add feature name to vector tiles (#2488) 2016-06-10 11:15:14 -07:00
Daniel J. Hofmann
cf2d2b6763
Boost.Test Testing Docs 2016-06-10 19:03:44 +02:00
Moritz Kobitzsch
95cd44f34f
add directions guide 2016-06-10 19:03:44 +02:00
Moritz Kobitzsch
d330e60d40
added a guide on writing good cucumber tests for osrm 2016-06-10 19:03:44 +02:00
Moritz Kobitzsch
99004bbec8 add testcase 2016-06-10 10:20:39 +02:00
Emil Tin
bbcc728a07 Update http.md
clarify "new name" instruction
2016-06-10 09:42:13 +02:00
Daniel J. Hofmann
033dc0a72d Pre-allocate up-front whenever possible 2016-06-09 16:06:27 +02:00
Patrick Niklaus
1c140a112a
Make sure we also reserve space for destination and pronunciation 2016-06-08 10:58:11 +02:00
Moritz Kobitzsch
312e86eb58 handle merge on collapsed instructions 2016-06-06 11:55:14 +02:00
Moritz Kobitzsch
1dfdb38d4a improve collapse-handling 2016-06-06 10:05:18 +02:00
Dane Springmeyer
dfafe7dc5f
Install clang-3.8 via mason binary 2016-06-04 12:15:29 +02:00
Dane Springmeyer
6ecc123d15
Fix various issues with pkg-config 2016-06-04 12:08:54 +02:00
Daniel J. Hofmann
6f322d2140 Silence multiline comment warning 2016-06-03 14:47:45 +02:00
Daniel J. Hofmann
dfa762bccc Pronunciation.
Spelling is hard. Maybe this time. /cc @themarex @systemed
2016-06-02 16:35:21 +02:00
Daniel J. Hofmann
87f00d2c4c Restrict CMake version to 2.8.11+ for target_include_directories 2016-06-02 16:07:29 +02:00
Daniel J. Hofmann
6f94e0dfb8 Update the Changelog for v5.2.0-rc2 2016-06-02 15:22:56 +02:00
Daniel J. Hofmann
ad70759f91 Revert "Handle small roundabouts, fixes #516."
This reverts commit 7641b12b08.

Conflicts:
	profiles/bicycle.lua
	profiles/car.lua
2016-06-02 15:08:24 +02:00
Daniel J. Hofmann
27c4e8ddd0 Revert "Adds tag to taginfo"
This reverts commit 14fdf861ca.
2016-06-02 15:00:50 +02:00
Daniel J. Hofmann
805d74b6ae Revert "Fixes roundabout spelling in existing cucumber test"
This reverts commit ef7b36da32.
2016-06-02 15:00:49 +02:00
Daniel J. Hofmann
4ad78309e2 Revert "Set speeds for mini roundabouts in car and bike profile"
This reverts commit a85f39c140.
2016-06-02 15:00:47 +02:00
Daniel J. Hofmann
b78207ddd8 Revert "Add implied oneway cucumber tests for mini roundabouts"
This reverts commit bd707b0cfc.

Conflicts:
	features/bicycle/oneway.feature
	features/car/oneway.feature
2016-06-02 15:00:44 +02:00
Daniel J. Hofmann
b6834da9a4 Revert "Test guidance instructions for entering and leaving mini roundabouts"
This reverts commit 9cdc9008aa.
2016-06-02 14:57:48 +02:00
Daniel J. Hofmann
801cc72691 Sync with Clang38 Format 2016-06-02 14:43:27 +02:00
Patrick Niklaus
e198709643 Add documentation about nodes property 2016-06-02 14:28:33 +02:00
Patrick Niklaus
ed8d5e0b0a Add missing semicolon 2016-06-02 14:27:25 +02:00
Lauren Budorick
e8fb312703 Update OSM node IDs annotation cucumber code per d6de2ca71c 2016-06-02 14:27:25 +02:00
Lauren Budorick
058b8c3b31 Template vector 2016-06-02 14:27:25 +02:00
Lauren Budorick
ae3ccb009e Formatting [ci skip] 2016-06-02 14:27:25 +02:00
Lauren Budorick
0c60a2aef8 Minor cleanups + comments 2016-06-02 14:27:25 +02:00
Lauren Budorick
44fdf86702 IT WORKS 2016-06-02 14:27:25 +02:00
Lauren Budorick
1659bbf7b1 Refining packed_vector.hpp
* Rename to std::vector-like APIs (push_back, at)
* Add size, reserve, capacity methods
2016-06-02 14:27:25 +02:00
Lauren Budorick
46b58fba83 Packed vector cleanups and unit test 2016-06-02 14:27:25 +02:00
Lauren Budorick
84da86ba4a Add packed vector sketch 2016-06-02 14:27:25 +02:00
Lauren Budorick
6777127497 Add cucumber tests for node IDs 2016-06-02 14:27:25 +02:00
Lauren Budorick
a4ac07866a Recreate feature/expose_node_ids 2016-06-02 14:27:25 +02:00
Daniel J. Hofmann
448f8377fb Sync with Clang38 Format 2016-06-02 13:14:33 +02:00
Daniel J. Hofmann
c490752ca7 highway=motorway_link does not imply oneway, fixes #1662
References:
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway_link#Tagging_oneway
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway_link
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway
2016-06-02 13:05:50 +02:00
Daniel J. Hofmann
6edc565c01 Add destinations API feature 2016-06-02 12:00:23 +02:00
Daniel J. Hofmann
bb0c2754d3 With empty summaries no longer the case, update library tests accordingly 2016-06-02 00:26:04 +02:00
Moritz Kobitzsch
58d6e8f4d0 handle short summaries correctly 2016-06-02 00:26:04 +02:00
Moritz Kobitzsch
bdc66049a5
fix INVALID_NAME_ID vs INVALID_NAMEID -> EMPTY_NAMEID 2016-06-01 23:19:26 +02:00
Patrick Niklaus
0a53775fb3
Expose pronunciation in RouteStep
Uses name:pronunciation by default for cars.
2016-06-01 23:17:57 +02:00
Daniel J. Hofmann
9cdc9008aa Test guidance instructions for entering and leaving mini roundabouts 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann
bd707b0cfc Add implied oneway cucumber tests for mini roundabouts 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann
a85f39c140 Set speeds for mini roundabouts in car and bike profile 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann
ef7b36da32 Fixes roundabout spelling in existing cucumber test 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann
14fdf861ca Adds tag to taginfo 2016-06-01 20:17:48 +02:00
Daniel J. Hofmann
7641b12b08 Handle small roundabouts, fixes #516.
This gives us ~51k additional roundabout instructions.
Guidance handes sizes internally.

Note: it is highway=mini_roundabout but junction=roundabout

References:
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmini_roundabout
- http://wiki.openstreetmap.org/wiki/Tag:junction=roundabout
- http://taginfo.openstreetmap.org/tags/highway=mini_roundabout
2016-06-01 20:17:48 +02:00
Daniel J. Hofmann
e7159adf59 Switching off any LLVM APT references as servers are no longer available
References:
- http://lists.llvm.org/pipermail/llvm-foundation/2016-June/000025.html
2016-06-01 20:04:52 +02:00
Daniel J. Hofmann
51f08f2994 Let's still show the badge although we dropped support for Windows
This reverts commit a03eac8e48.
2016-06-01 19:22:31 +02:00
Daniel J. Hofmann
a03eac8e48 Remove Windows Build Badge from Readme 2016-06-01 15:37:16 +02:00
Daniel J. Hofmann
503137221d Let osrm-routed log status code, fixes #512.
Disclaimer: osrm-routed is not recommended for production usage.
Use node-osrm instead: https://github.com/Project-OSRM/node-osrm
2016-05-31 14:44:50 +02:00
Patrick Niklaus
fb9205bf81 Merge pull request #2476 from oxidase/refactor/2472
Refactor ramIndex #2472
2016-05-31 03:00:47 -04:00
Michael Krasnyk
bfbb313088
Conditional hashing of osrm libraries 2016-05-29 07:39:49 +02:00
Michael Krasnyk
25d3c4b843
Updated change log and adjusted format 2016-05-29 07:39:49 +02:00
Michael Krasnyk
371c06d66d
Change size of QueryCandidate from 32 to 24 bytes 2016-05-29 07:39:49 +02:00
Michael Krasnyk
3e5c978719
Reduce ramIndex file size
PR #2472: the bottom-most node of the r-tree contains
only a single index to a leaf node, so out of 532 bytes
only 4 are used.
2016-05-29 07:39:49 +02:00
Michael Krasnyk
843f1a6356
Set LeafNode alignment to LEAF_PAGE_SIZE bytes
References:
- https://github.com/Project-OSRM/osrm-backend/pull/2348#issuecomment-219804408
- http://stackoverflow.com/questions/15523537/alignas-specifier-vs-attribute-aligned-c11
- http://stackoverflow.com/questions/7895869/cross-platform-alignx-macro
2016-05-29 07:39:49 +02:00
Dane Springmeyer
a5c5faa21d
drop support for using DYLD_LIBRARY_PATH on OS X 2016-05-29 06:01:16 +02:00
Patrick Niklaus
6a1e17c6fa
Print TBB version in FindTBB 2016-05-29 00:06:45 +02:00
Patrick Niklaus
cd30f370b8
Remove the use of atomics and use thread-local accumulation instead 2016-05-29 00:06:18 +02:00
Dane Springmeyer
4ae8abe6a3
run clang-format [skip ci] 2016-05-27 22:35:17 +02:00
Dane Springmeyer
82bfd4ee40
fix compile with clang-3.5 2016-05-27 22:35:17 +02:00
Patrick Niklaus
e08c4cff13
Make PRs fail if they don't adhere to our style format 2016-05-27 21:05:43 +02:00
Patrick Niklaus
6e16eab6ec
Format with clang-format 3.8 2016-05-27 21:05:04 +02:00
Patrick Niklaus
21c47514da
Update clang-format to 3.8 2016-05-27 17:45:00 +02:00
Patrick Niklaus
d6de2ca71c
Really place annotations in RouteLeg and not Route 2016-05-27 16:46:28 +02:00
Dane Springmeyer
451a0d9090
try caching test data on travis 2016-05-27 00:40:49 +02:00
Patrick Niklaus
262354f733
Rename annotate to annotations 2016-05-26 23:35:11 +02:00
Daniel J. Hofmann
498370330d
String bulk insertion 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann
6865853776
Not everything is a NodeID! 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann
1418c0dbbc
Move ExtractionWays and ExtractionNodes into container to avoid copying 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann
bbc79dd49f
ExtractionContainers already owns its data 2016-05-26 22:50:17 +02:00
Daniel J. Hofmann
8036320d94
Do not bind primitives per ref 2016-05-26 22:50:17 +02:00
Patrick Niklaus
c30f69d6e9
Fix breaking test uncovered by this fix 2016-05-26 22:34:39 +02:00
Patrick Niklaus
2e2f34f241
Fix retry code launch classes 2016-05-26 22:34:39 +02:00
Lauren Budorick
cbbeef5c46
Prune unnecessary cucumber code 2016-05-26 22:34:39 +02:00
Moritz Kobitzsch
823ee54f22
add turn restrictions to test-cases 2016-05-26 21:31:04 +02:00
Daniel Patterson
3d03797e53
Distinguish between offramps and sliproads. 2016-05-26 21:31:04 +02:00
Patrick Niklaus
089e60fa1e
Remove obsolete timer code 2016-05-26 20:25:33 +02:00
Patrick Niklaus
baf8e4784b
Transfer match benchmark to own binary 2016-05-26 20:25:33 +02:00
Moritz Kobitzsch
d53350b263
be more verbose on broken configs 2016-05-26 20:04:24 +02:00
Patrick Niklaus
824afdceca
use 5 seconds as cucumber timeout 2016-05-26 20:02:21 +02:00
Patrick Niklaus
a8230e976f Merge pull request #2454 from oxidase/reset-force-flags
Remove force flags and update extract/contract hashes with arguments
2016-05-26 13:16:29 -04:00
Michael Krasnyk
6af7e6866c
Sort file extensions in rename lists 2016-05-26 17:05:11 +02:00
Michael Krasnyk
aaa27333ba
Remove force flags and update extractor/contractor hashes
with command line arguments and argument files data.
2016-05-26 16:36:26 +02:00
Moritz Kobitzsch
797f2a196b
handle intersection-access for roundabout correctly 2016-05-26 16:25:26 +02:00
Moritz Kobitzsch
51066ff18f fix options in step-definitions 2016-05-26 15:38:55 +02:00
Dane Springmeyer
4de64a92cb fix zlib linking order 2016-05-25 09:32:27 -04:00
Freenerd
a21fd2ea18 Contractor: log stats for loaded speed files 2016-05-24 14:35:16 -04:00
Patrick Niklaus
0df0b4305d Merge pull request #2453 from Project-OSRM/cmake-from-mason
[Travis] Install cmake from more reliable s3 endpoint
2016-05-24 14:32:45 -04:00
Dane Springmeyer
a5ed53e7aa install cmake from mason / simplify install 2016-05-24 13:35:13 -04:00
Daniel Patterson
0587c5f5c4
Trim datasource names before writing to datafile. 2016-05-24 15:20:14 +02:00
Patrick Niklaus
57dbb18c4c Merge pull request #2451 from Project-OSRM/disable-osx-spotlight
[Travis] Disable spotlight indexing on osx to speed up 'npm test'
2016-05-24 09:10:35 -04:00
Dane Springmeyer
4d92f08424 disable spotlight indexing on osx to speed up 'npm test' 2016-05-23 19:35:22 -04:00
Patrick Niklaus
254ee07942
Add new sanity check assertions to UnpackPath 2016-05-23 23:15:15 +02:00
Patrick Niklaus
0bf8bd2230
Remove invalid assertion.
This ports the matching change from RoutingBase.
2016-05-23 23:15:15 +02:00
Michael Krasnyk
b5225f07cb
Fix #2413 by converting enums to unsigned char constants 2016-05-23 18:33:24 +02:00
Moritz Kobitzsch
abed7690d0
fix continue on obvious 2016-05-23 17:55:30 +02:00
Patrick Niklaus
f96174ddbe Merge pull request #2428 from zimathias/disable-access-logging-option
Disable access logging option
2016-05-23 10:12:42 -04:00
Mathias Gug
e5b713841a Fix style. 2016-05-20 12:47:47 -07:00
Mathias Gug
3b1b12069f Add changelog entry. 2016-05-20 12:47:47 -07:00
Mathias Gug
1635f7351d Support environment variable to disable http requests logging. 2016-05-20 12:47:47 -07:00
Daniel J. Hofmann
ce5ae411c1
Resurrect Flat Map + Binary Search commit from PR 2412 2016-05-20 20:43:45 +02:00
Patrick Niklaus
d1bc32fb31
Add comments and debug code 2016-05-20 18:52:29 +02:00
Patrick Niklaus
f9f87f25d4
Use elogate() to fixup geometry when merging steps, fixes #2424 2016-05-20 18:52:29 +02:00
Patrick Niklaus
89aa6b7881
Add regression test for #2424 2016-05-20 18:52:29 +02:00
Patrick Niklaus
edf9e0c1ed
[skip ci] Update changelog and OSRM version 2016-05-20 18:52:00 +02:00
Dane Springmeyer
c2e520ad9d
Fix linking of osrm-example to boost_iostreams
Fixes linking error seen on OS X:

```
[ 50%] Linking CXX executable osrm-example
/Users/dane/.homebrew/Cellar/cmake/3.5.0/bin/cmake -E cmake_link_script CMakeFiles/osrm-example.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++    -std=c++11  -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/osrm-example.dir/example.cpp.o  -o osrm-example  /Users/dane/projects/osrm-backend/here/lib/libOSRM.a /Users/dane/.homebrew/lib/libboost_filesystem-mt.dylib /Users/dane/.homebrew/lib/libboost_system-mt.dylib /Users/dane/.homebrew/lib/libboost_thread-mt.dylib /Users/dane/.homebrew/lib/libboost_chrono-mt.dylib /Users/dane/.homebrew/lib/libboost_date_time-mt.dylib /Users/dane/.homebrew/lib/libboost_atomic-mt.dylib 
undef: __ZN5boost9iostreams18mapped_file_source9open_implERKNS0_24basic_mapped_file_paramsINS0_6detail4pathEEE
undef: __ZN5boost9iostreams18mapped_file_sourceC1Ev
undef: __ZNK5boost9iostreams18mapped_file_source4sizeEv
undef: __ZNK5boost9iostreams18mapped_file_source4dataEv
Undefined symbols for architecture x86_64:
  "boost::iostreams::mapped_file_source::open_impl(boost::iostreams::basic_mapped_file_params<boost::iostreams::detail::path> const&)", referenced from:
      void boost::iostreams::mapped_file_source::open<boost::filesystem::path>(boost::filesystem::path const&, unsigned long, long) in libOSRM.a(engine.cpp.o)
  "boost::iostreams::mapped_file_source::mapped_file_source()", referenced from:
      osrm::engine::datafacade::SharedDataFacade::CheckAndReloadFacade() in libOSRM.a(engine.cpp.o)
      osrm::engine::datafacade::InternalDataFacade::InternalDataFacade(osrm::storage::StorageConfig const&) in libOSRM.a(engine.cpp.o)
  "boost::iostreams::mapped_file_source::size() const", referenced from:
      osrm::engine::datafacade::SharedDataFacade::CheckAndReloadFacade() in libOSRM.a(engine.cpp.o)
      osrm::engine::datafacade::InternalDataFacade::InternalDataFacade(osrm::storage::StorageConfig const&) in libOSRM.a(engine.cpp.o)
  "boost::iostreams::mapped_file_source::data() const", referenced from:
      osrm::engine::datafacade::SharedDataFacade::CheckAndReloadFacade() in libOSRM.a(engine.cpp.o)
      osrm::engine::datafacade::InternalDataFacade::InternalDataFacade(osrm::storage::StorageConfig const&) in libOSRM.a(engine.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2016-05-20 16:04:18 +02:00
Dane Springmeyer
7649187095
workaround boostorg/numeric_conversion#4 2016-05-20 16:03:19 +02:00
Dane Springmeyer
fe39d0fd10 disable BOOST_TEST_DYN_LINK if Boost_USE_STATIC_LIBS 2016-05-20 00:03:37 -04:00
Patrick Niklaus
98b83b7208
Fix library test 2016-05-19 16:44:31 +02:00
Patrick Niklaus
57321979ae
Remove leftover debugging code 2016-05-19 16:44:31 +02:00
Patrick Niklaus
e3ce0c5887
Add fuzzy matching for bearings and intersections list 2016-05-19 16:44:31 +02:00
Patrick Niklaus
95af72c70c
Make intersection backwards compatible
For `depart` and `arrive` `step.intersections[0].{bearings|entry}` will have
only one entry.
2016-05-19 16:44:31 +02:00
Patrick Niklaus
3b37769624
Use bearing_before and bearing_after in the bearings field 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
d150df1c5c
format 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
a322e27e05
update changelog/docs 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
98fe0badbe
fix loading in storage 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
44b841a25d
fix storage 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
9c8bf820de
adjusted to in/out. only emit one of them for depart/arrive 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
4d9aa65e78
intersection classes with variable degree of discretization 2016-05-19 16:44:31 +02:00
Moritz Kobitzsch
0f3942558f
version using discrete values stored directly at intersection 2016-05-19 16:43:46 +02:00
Moritz Kobitzsch
ba074b0116
initial version of intersection classification 2016-05-19 16:43:46 +02:00
Daniel J. Hofmann
6aa97048df
Rip out custom CSV parser code and its third_party dependency 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
d9a5c79ea6
Map leaf nodes to RAM and iterate over them potentially in parallel 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
9d7714c714
Make looping through all leaf nodes less confusing 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
8291be375a
Expose concurrency in saving files 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
0a73737f69
Fold parsing and data loading in concurrently executing action 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
2fd1b6c913
Expose concurrency between intern/external node map and geometries 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
ea38a1d880
Parse multiple files concurrently 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
f576e13c51
Concurrent lookup hashtables 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
ee7bb8731a
Expose concurrency between segment speeds and turn penalties 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
da0c3ff394
Refactor edge weight parsing code 2016-05-19 00:01:54 +02:00
Daniel J. Hofmann
6ae559b42b
Throw error if edge based graph file could not be loaded 2016-05-19 00:01:54 +02:00
Mathias Gug
95ca6ebdaa
Update CHANGELOG entry. 2016-05-18 23:59:52 +02:00
Mathias Gug
0d6964d9c8
Add CHANGELOG entry. 2016-05-18 23:59:52 +02:00
Mathias Gug
ba386d4b2c
Document environment variable. 2016-05-18 23:59:52 +02:00
Mathias Gug
b5ffb51e18
Signal the parent process when we're ready to serve requests.
This can be used for a hot reload of the process binary. The supervising
process can be told when the new process is ready to serve requests.
2016-05-18 23:59:52 +02:00
Moritz Kobitzsch
a9f674497a
emit turn-straight for obvious turns where the main road continues 2016-05-18 19:54:53 +02:00
Patrick Niklaus
1e8a92ccb4
Add changelog entry 2016-05-18 19:16:44 +02:00
Mathias Gug
b9178bb8c7
Fix build on windows. 2016-05-18 19:13:18 +02:00
Mathias Gug
520b29d0d5
Use const for option. Include proper header files. 2016-05-18 19:13:18 +02:00
Mathias Gug
fe397e6953
Support SO_REUSEPORT option
so that multiple osrm-routed processes can bind to the same port.
2016-05-18 19:13:18 +02:00
Patrick Niklaus
dcb741d827 Merge pull request #2403 from oxidase/refactor/duration-parser
Refactoring of iso_8601_grammar
2016-05-17 12:26:28 -04:00
Michael Krasnyk
508c205d35
Refactoring of iso_8601_grammar
* formats 'hh:mm:ss' and ISO 8601 are merged into one grammar.
* iso_8601_grammar is changed to static const.
* iso_8601_grammar supports formats P[n]DT[n]H[n]M[n]S, P[n]W,
  and part of alternative PTHHMMSS and extended PTHH:MM:SS formats.
2016-05-17 00:39:32 +02:00
Daniel J. Hofmann
d5294bb5d0 Silences warnings when running npm test 2016-05-16 14:43:54 -04:00
Patrick Niklaus
6ed9be31ca Merge pull request #2408 from oxidase/master
Remove latitude rounding in yToLat
2016-05-16 17:04:49 +02:00
Michael Krasnyk
3bbd3a8a65
Remove latitude rounding in yToLat 2016-05-16 00:53:33 +02:00
Daniel Patterson
73a608895a Merge pull request #2402 from Project-OSRM/fix_docker
Remove Ruby from docker setup, use Node.
2016-05-13 13:38:10 -07:00
Daniel Patterson
96c73baeb3 Remove Ruby from docker setup, use Node. 2016-05-13 12:32:36 -07:00
Patrick Niklaus
73113f5eb8
Fix codecov.yml 2016-05-12 17:56:40 +02:00
Patrick Niklaus
7b74b86891
Add codecov file 2016-05-12 01:17:16 +02:00
Daniel Patterson
0903b8227f
Example of the annotation response value. 2016-05-12 01:11:09 +02:00
Daniel Patterson
fa525ad610
Return an array with meta-data for each coordinate.
Currently supports duration and distance for each coordinate.

This is particularly useful in map-matching, comparing how
a trip progresses compared to a real GPS trace that is
map-matched.
2016-05-12 01:11:09 +02:00
Daniel J. Hofmann
0f2bb5dde5
Disable builing components tool by default until GDAL 2 compatibility #1738 lands 2016-05-12 00:25:18 +02:00
Patrick Niklaus
84dc1b6845
[skip ci] Use codecov badge 2016-05-11 22:45:07 +02:00
Patrick Niklaus
4ce1a37772
Limit osrm-extact to 3 jobs because OOM 2016-05-11 22:43:26 +02:00
Patrick Niklaus
8dd4cc5c40
Integrate codecov 2016-05-11 22:43:18 +02:00
Patrick Niklaus
6aed145dae
[skip ci] Rephrased the API docs in terms of adding new types 2016-05-09 18:39:30 +02:00
Patrick Niklaus
d15cc77b0b Merge pull request #2386 from oxidase/rtree-optimize-addition
Missing two commits in StaticRTree changes
2016-05-08 14:20:59 +02:00
Michael Krasnyk
24a75d37fb
Approximate inverse Gudermannian function by a Padé approximant 2016-05-08 06:00:21 +02:00
Michael Krasnyk
7e80dae59b
Fix MSVS build. 2016-05-08 06:00:21 +02:00
Patrick Niklaus
7316c48e9f
Changelog entry for StaticRTree changes 2016-05-07 23:52:11 +02:00
Patrick Niklaus
c520c7a24a
Fix rtree benchmark 2016-05-07 23:52:11 +02:00
Patrick Niklaus
7564633045
Update SearchInBox to not copy TreeNode 2016-05-07 23:52:11 +02:00
Patrick Niklaus
7174c5d036
Make StaticRTree and facades const 2016-05-07 23:52:11 +02:00
Patrick Niklaus
ddd128ce0e
Only use const-ref for coordinate vector 2016-05-07 23:52:11 +02:00
Patrick Niklaus
f5aa5c0769
Don't wrap StaticRTree in thread-specfic ptr 2016-05-07 23:52:11 +02:00
Michael Krasnyk
2acde49f0f
Make LeafNode aligned to memory pages.
Changes:
* LeafNode is aligned to LEAF_PAGE_SIZE.
  Alignment brings 24 bytes memory overhead for 4096, but reduces
  cache misses rate.
* Unused m_element_count from leaf nodes file.
  The size is computed as m_leaves_region.size() / LEAF_PAGE_SIZE.
* Added try/catch for mmap exceptions messages.
2016-05-07 23:52:11 +02:00
Michael Krasnyk
8849015bbf
Fix construct_multiple_levels_test
candidate_cache is removed because of failing test
make util-tests && ./unit_tests/util-tests --run_test=*/construct_multiple_levels_test
first bad commit: [9692be6f50] Add cache for CandidateSegments to reduce heap worke even more

Now SegmentIndex contains leaf index, object index and fixed_projected_coordinate
2016-05-07 23:52:11 +02:00
Michael Krasnyk
70cd7a94ec
Fix memory mapping "Invalid argument" exception. 2016-05-07 23:52:11 +02:00
Patrick Niklaus
3984dea34b
Use mmap in StaticRTree 2016-05-07 23:52:11 +02:00
Patrick Niklaus
b11b471aa4
Move LoadLeafFromDisk to return by value 2016-05-07 23:52:11 +02:00
Patrick Niklaus
63754df4d4
Add cache for CandidateSegments to reduce heap worke even more 2016-05-07 23:52:11 +02:00
Patrick Niklaus
e644424508
Only save TreeNode index in search tree x3 speedup 2016-05-07 23:52:11 +02:00
Patrick Niklaus
4f6eef3d16 Merge pull request #2376 from oxidase/fix/addition-to-2356
Addition to fix #2356
2016-05-07 12:47:28 +02:00
Michael Krasnyk
e2e8104864
Addition to fix #2356
Updated unit tests for the Hint parser and
added emplacement of empty hints.
2016-05-07 09:47:32 +02:00
Patrick Niklaus
96127c289c
Set OSX timeout to a minute 2016-05-06 10:36:40 +02:00
Patrick Niklaus
cfed65f7ea
Double timeout again 2016-05-05 21:07:38 +02:00
Patrick Niklaus
c2263fec9b
One TIMEOUT to rule them all 2016-05-05 18:36:30 +02:00
Patrick Niklaus
497720d060
Bump timeout and lower jobs on OSX 2016-05-05 17:12:22 +02:00
Patrick Niklaus
238366e71f Merge pull request #2373 from oxidase/master
Fix #2362 by using generic path strings
2016-05-05 15:57:51 +02:00
Michael Krasnyk
2c8cf26e74 Fix build break in MSVC
fatal error C1189: #error:  "This header can't be used in operating systems without XSI (System V) shared memory support"
2016-05-05 13:24:27 +02:00
Michael Krasnyk
c87ae5612a Fix #2362 by using generic path strings
In windows native strings in Lua incorrectly
interpreted because native separators must be escaped.
Use of generic strings prevent use of backslashes and
"Generic paths are portable and independent of the operating system.".
2016-05-05 12:10:45 +02:00
Patrick Niklaus
a2d83753bc
Install ccmake on OSX 2016-05-05 11:39:15 +02:00
Patrick Niklaus
eedf75d951
Correct path to test data 2016-05-04 20:44:05 +02:00
Patrick Niklaus
3f51a1ae2e
Run tests from build directory 2016-05-04 19:46:27 +02:00
Patrick Niklaus
a000f80705
[skip ci] Use 3 jobs on travis to utilize cores better 2016-05-04 19:39:52 +02:00
Patrick Niklaus
7030bff7f7
Fix typo in compiler name 2016-05-04 19:24:13 +02:00
Patrick Niklaus
bb0b7fd2d1
Modify compiler name for ccache key 2016-05-04 19:22:43 +02:00
Patrick Niklaus
71e1f3679e
Restructure travis run 2016-05-04 19:12:07 +02:00
Patrick Niklaus
b33517b099
Remove pip from dependencies 2016-05-04 18:55:29 +02:00
Patrick Niklaus
f3d5336892
Lint .travis.yml 2016-05-04 18:46:08 +02:00
Patrick Niklaus
d81f25d54e
Enable ccache compression 2016-05-04 18:42:47 +02:00
Patrick Niklaus
44ebdfeb2d
[skip ci] Update changelog 2016-05-04 18:05:37 +02:00
Daniel J. Hofmann
a5a7a03fa0
Cucumber test for destination:ref and no destination=* 2016-05-04 15:28:34 +02:00
Daniel J. Hofmann
363d2145bd
Register a way's .nodes() function for use in the profile's way_function.
Can be used as in:

    function way_function(way, result)
      for node in way:get_nodes() do
        local id = node:id()
        io.write(">>> " .. id .. "\n")
      end

      -- ...
    end

Warning: we do not use libosmium's location cache, therefore .location()
on the nodes will crash at runtime. Once we switch to using libosmium's
cache this should work. Until then, you can use the node id now.
2016-05-04 15:28:34 +02:00
Daniel J. Hofmann
c7e19396a4
Guard against mis-tagging: only use destination tag in combination with oneway tag 2016-05-04 15:28:34 +02:00
Daniel J. Hofmann
445e5bed49
Respect ';'-separated list in destination:ref tag 2016-05-04 15:28:34 +02:00
Daniel J. Hofmann
4cf94319df
Basic destination sign handling.
This first part in our Exit Sign / Destination Sign quest re-wires
the `destination=` and `destination:ref=` tag to the `ref=` tag (in case
it's the highway does not already have a `ref=` tag).

Doing some analysis on both Berlin and San Francisco it looks like this
will add a couple of thousand `ref=` tags that we will announce in guidance.

References:
- https://github.com/Project-OSRM/osrm-backend/issues/2267#issuecomment-214771682
- http://wiki.openstreetmap.org/wiki/Key:destination
- http://wiki.openstreetmap.org/wiki/Proposed_features/Destination_details
2016-05-04 15:28:34 +02:00
Patrick Niklaus
1bb88b374e
Make hint values optional, fixes issue 2356 2016-05-04 15:24:48 +02:00
Patrick Niklaus
35fac07581
Add failing test for empty hint 2016-05-04 15:24:48 +02:00
Patrick Niklaus
9287475b2a
ccache needs language: cpp 2016-05-04 15:09:02 +02:00
Patrick Niklaus
b4976f89f2
APT seems slow, try explicitly enabling 2016-05-04 14:27:44 +02:00
Patrick Niklaus
93c8674a40
Disable coverage builds since coveralls is broken 2016-05-04 14:02:11 +02:00
Moritz Kobitzsch
d5f21fd13a
fix test-case 2016-05-04 14:00:34 +02:00
Patrick Niklaus
04eef0463a
Fix the second test that breaks because of phantom node 2016-05-04 14:00:34 +02:00
Patrick Niklaus
82c3bc7b0e
Adapt tests to desired behaviour 2016-05-04 14:00:34 +02:00
Patrick Niklaus
1d33cb96f5
Fix missing semicolon in cucumber support code 2016-05-04 14:00:34 +02:00
Moritz Kobitzsch
648646068c
additional testcase on what I would expect 2016-05-04 14:00:34 +02:00
Daniel Patterson
f251f93a11
Fix summary generation when empty strings are present.
Also corrects step ordering when steps have equal durations.
2016-05-04 14:00:34 +02:00
Patrick Niklaus
aab1aad8f4
Enable ccache 2016-05-04 13:54:04 +02:00
Patrick Niklaus
65a6dc704e
Disable all release builds but one 2016-05-04 13:41:55 +02:00
Moritz Kobitzsch
6018fcf490
Introduce on_ramp and off_ramp, deprecate ramp 2016-05-04 12:09:54 +02:00
Moritz Kobitzsch
1e6888c0d3 fix new-name on empty strings 2016-05-04 10:52:55 +02:00
Patrick Niklaus
c7303be33b
[skip ci] Add specifics about how we interpret semver 2016-05-03 23:36:27 +02:00
Lauren Budorick
d8acf76f2d
Fix wrong assertion size in CompressedEdgeContainer::GetLastEdgeSourceID 2016-05-03 21:50:27 +02:00
Moritz Kobitzsch
08248e3853
fix 2349 2016-05-03 21:14:31 +02:00
Moritz Kobitzsch
78acc6f215
fix search with u-turn 2016-05-03 21:13:22 +02:00
Patrick Niklaus
a4f1dc536d
Trip plugin does not have a continue_straight parameter, use false 2016-05-03 21:13:22 +02:00
jperaltamalvar
57a30dd375 Remove more typename
Needed to compile con Windows
2016-05-03 16:00:44 +02:00
Daniel J. Hofmann
5517ee334f Remove typename prefix from non-dependent type alias
I think VS is predantic but actually right here.

References:
- http://eel.is/c++draft/namespace.udecl#19
2016-05-03 12:00:40 +02:00
Daniel J. Hofmann
30af544919
Changelog for street name assembly 2016-05-03 00:09:17 +02:00
Daniel J. Hofmann
f0069d3dcc
Makes bicycle and foot profile's name and ref tag handling consistent with car profile 2016-05-03 00:09:17 +02:00
Patrick Niklaus
206bdff9e7
Inline and vectorize haversine for GetPathDistance 2016-05-02 19:53:42 +02:00
Patrick Niklaus
c32270b2b8
Make projectOnLine inline-able 2016-05-02 19:53:05 +02:00
Patrick Niklaus
cc03402570
Use pass-by-copy for Coordinate 2016-05-02 19:51:32 +02:00
Patrick Niklaus
21a76f1867
Move coordinate constructors to header to enable inlining 2016-05-02 19:50:52 +02:00
Patrick Niklaus
212ad94c90
x2 speedup in Douglas Peucker by projecting all coordinates first 2016-05-02 19:50:33 +02:00
Patrick Niklaus
378d9f4112
Remove debug ouput from post-processing 2016-05-02 19:47:59 +02:00
Patrick Niklaus
e341d367d8
Move detail:: to osrm::detail:: 2016-05-02 18:36:32 +02:00
Daniel J. Hofmann
98937b187f
We require Visual Studio 2015+
References:
- https://github.com/Project-OSRM/osrm-backend/issues/2341#issuecomment-216231618
2016-05-02 17:50:54 +02:00
Moritz Kobitzsch
59168e21b4
remove unnecessary warnings, initialize correctly 2016-05-02 17:29:37 +02:00
Patrick Niklaus
d12a95b4ef
Fix naming convention of Percent 2016-05-02 17:25:58 +02:00
Patrick Niklaus
83482afa02
Fix naming conventions of TrajanSCC 2016-05-02 17:25:58 +02:00
Patrick Niklaus
e470d1ae1c
Fix naming convention in RasterSource 2016-05-02 17:25:58 +02:00
Patrick Niklaus
e504128587
Fix naming convention in HiddenMarkovModell 2016-05-02 17:25:58 +02:00
Patrick Niklaus
1ab6c07bad
Fix naming convention in BayesClassifier 2016-05-02 17:25:58 +02:00
Patrick Niklaus
5ce465ce23
Remove extra ; in PostProcessing 2016-05-02 17:25:58 +02:00
Patrick Niklaus
a8b730576f
Fix naming convention in GeospatialQuery 2016-05-02 17:25:58 +02:00
Patrick Niklaus
b796033473
Clean up naming conventions in CRC32 code 2016-05-02 17:25:58 +02:00
Patrick Niklaus
d078ed67ca
Fix naming convention in GraphContractor 2016-05-02 17:25:58 +02:00
Lauren Budorick
346146d834 Address comments from b89164c14e (#2346) 2016-05-02 08:00:27 -07:00
Patrick Niklaus
64307ea882
Add missing headers and remove dead code 2016-04-29 20:02:08 +02:00
Patrick Niklaus
578eda7d28
[skip ci] Add release docs 2016-04-29 14:00:10 +02:00
Patrick Niklaus
505f4cb4a2
[skip ci] Add profile documentation 2016-04-29 13:10:43 +02:00
Patrick Niklaus
bac6b729bf
Overhault the README 2016-04-29 13:00:27 +02:00
Patrick Niklaus
d3a5cadb6c
[skip ci] Fix linkt to C++ library 2016-04-29 12:26:04 +02:00
Patrick Niklaus
65351faf83
[skip ci] Move correct docs. 2016-04-29 12:24:21 +02:00
Patrick Niklaus
3aa1c5f13c
Link docs from README 2016-04-29 12:20:51 +02:00
Patrick Niklaus
8f3fe410b8
Import docs from the wiki 2016-04-29 12:16:19 +02:00
Patrick Niklaus
ff3bf32b11 Merge pull request #2342 from Project-OSRM/publish-win-binaries
make AppVeyor publish binaries again
2016-04-29 11:16:27 +02:00
bergwerkgis
38cb01a30e [skip travis] make AppVeyor publish binaries again 2016-04-29 10:32:29 +02:00
Lauren Budorick
b8f7569e93 Implement arbitrary turn penalty file IO and integration (#2306)
Closes #1830
2016-04-29 00:48:13 -07:00
Moritz Kobitzsch
cf17bd38eb
Revert "Revert "switched to space separated suffix/prefix only"" 2016-04-28 14:59:17 +02:00
Patrick Niklaus
930f6df2cb
Fixes #2335, map matching was using shortest path with uturns disabled 2016-04-28 12:02:31 +02:00
Patrick Niklaus
e88106e990
Revert "switched to space separated suffix/prefix only"
This reverts commit e9e935303c.
2016-04-27 23:20:10 +02:00
Patrick Niklaus
21f64c75eb Merge pull request #2324 from oxidase/master
Fix syntax error position indicators in parameters queries
2016-04-27 23:15:16 +02:00
Michael Krasnyk
5186b9490d Fix syntax error position indicators in parameters queries
To fix #2193 prefix_length member variable has been added to ParsedURL
that is set to the length of "/service/version/profile/" prefix
when the prefix is accepted by the parser.
Also BOOST_FUSION_ADAPT_STRUCT for osrm::server::api::ParsedURL
has been moved from header to url_parser.cpp to speed up compilation
of CUs that do not use the fusion adaption.
2016-04-27 19:52:23 +02:00
Moritz Kobitzsch
e9e935303c switched to space separated suffix/prefix only 2016-04-27 19:12:24 +02:00
Moritz Kobitzsch
a154d71841 enable suppression name suffix changes 2016-04-27 18:10:56 +02:00
Moritz Kobitzsch
fddb035539 suppress name additions (xxx -> xxxbridge) 2016-04-27 12:13:42 +02:00
Moritz Kobitzsch
1544a08ea2 introduce roundabout-turns into instruction set 2016-04-27 12:13:42 +02:00
Moritz Kobitzsch
8d68d4c050
fix copy-paste errors in guidance tests 2016-04-26 13:43:22 +02:00
Moritz Kobitzsch
62a1290043
remove invalid assertion 2016-04-26 13:16:44 +02:00
Moritz Kobitzsch
c5e1742150
fix post-processing for local paths, fixes #2310 2016-04-26 13:15:46 +02:00
Moritz Kobitzsch
754bc2d274
handle combined turns at segregated roads 2016-04-26 13:13:20 +02:00
Moritz Kobitzsch
3ac061c546 fix guidance issues / improve tests 2016-04-26 10:34:39 +02:00
Moritz Kobitzsch
e59a7926a2
roundabout for segregated entry roads 2016-04-26 01:01:09 +02:00
Moritz Kobitzsch
be5b49e391
Fix local path looping, fixes #2309 2016-04-25 19:37:59 +02:00
Moritz Kobitzsch
7b32d3184c
remove unused instruction types 2016-04-25 19:24:59 +02:00
Moritz Kobitzsch
d770c35245
refactor guidance 2016-04-25 19:24:59 +02:00
Daniel J. Hofmann
e04baef3bb Do not copy geometries in loop 2016-04-25 12:12:32 +02:00
Patrick Niklaus
9d3ad22bc7
Fix path to monaco data 2016-04-25 00:46:36 +02:00
Patrick Niklaus
cc35d15b2d
More folds and reorder some build instructions 2016-04-25 00:19:48 +02:00
Patrick Niklaus
15e3928906 Merge pull request #2312 from oxidase/stateless-parameters-grammars
Stateless parameters grammars and fix for PhantomNode bitfields packing in MSVC
2016-04-24 23:45:51 +02:00
Michael Krasnyk
4363fd64c4 Fix for PhantomNode packing in MSVC
Changed bool to uint32_t in bit fields to have 4-byte packings for 32 bits:
"c++ compilers will allocate bit-fields in memory as follows:
several consecutive bit-field members of the same type will
be allocated sequentially. As soon as a new type needs to be allocated,
it will be aligned with the beginning of the next logical memory block."

References:
- https://msdn.microsoft.com/en-us/library/ewwyfdbe.aspx
- http://stackoverflow.com/questions/308364/c-bitfield-packing-with-bools/308383#308383
2016-04-24 14:06:48 +02:00
Michael Krasnyk
dac2f93383 Refactoring of parameter garammars
* signature changed from void() to void(engine::api::Parameters&)
* performance increase due to use "static const GrammarT" and avoid
  construction and destruction of grammars during parsing
* removed code duplication in inherited grammars
* rule unlimited changed to qi::lit
* added rule size_t_
* parser accepts "&geometries=" and "&overview=" and fails at "foo"
  instead of "&geometries=foo" and &overview=foo
* added expectations checks for derived grammars
* changed rules qi::list(".") to character rules '.'
2016-04-23 21:15:21 +02:00
Patrick Niklaus
82372bb2ab
Remove develop branch from appveyor 2016-04-23 17:55:18 +02:00
Patrick Niklaus
b0c67c9019
Update coverall badge 2016-04-23 14:19:58 +02:00
Patrick Niklaus
d83a34f72b
Remove develop branch from travis 2016-04-22 14:51:38 +02:00
Patrick Niklaus
a16f156203
Update README to remove develop branch 2016-04-22 14:49:27 +02:00
Patrick Niklaus
807aa71a7c
Merge branch 'develop' 2016-04-22 14:35:32 +02:00
Patrick Niklaus
14d9b67b58
Update changelog with regard to 4.9.1 2016-04-22 14:28:45 +02:00
Patrick Niklaus
82df0ca766
Fix parser tests and destinations=all / sources=all 2016-04-22 11:01:15 +02:00
bergwerkgis
a6c7529a4e
AppVeyor: new path to test executables, add server-tests.exe 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
202bb6d3e2
Fix accidental rebase issues 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
bc514926bf
Unit test for trip across component boundaries.
Daniel's mental model, with updates from Patrick and staring at the code
(plugins/trip.cpp): Trip first snaps coordinates which in the case of
phantoms that are not only in small components with the same id
switches small components to big ones. Therefore we get either only
small or only big components. Only then the Tarjan SCC decomposes this.

Result: multiple subtrips only happen for islands or continents.
2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
9fc16b6a83
Unit test for trip exclusively in big component 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
2125e0175d
Unit tests for special symbols in radiuses, sources, destination 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
6b5982d389
Table unit test, revealing position_index -> waypoint_index mismatch 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
a4a8aa63d4
Invalid route requests 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
bedf451952
Namespace aliases 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
93b8f1993c
Split off parameters I/O from unit tests 2016-04-22 10:40:03 +02:00
Daniel J. Hofmann
c693f4806b
Unit tests for routing / snapping across components 2016-04-22 10:40:03 +02:00
Patrick Niklaus
b07275694a
Add more guidance tests 2016-04-21 23:07:29 +02:00
Patrick Niklaus
82177c101b
Add changelog entry for summary 2016-04-21 22:47:05 +02:00
Patrick Niklaus
da6dbd2159
Revert "Removes summary from legs property"
This adds the summary back to the RouteLeg, it now depends on if
`steps=true`.
This reverts commit eaf9993dd9.
2016-04-21 22:39:16 +02:00
Patrick Niklaus
b3957d87b4
Add changelog entry 2016-04-21 22:14:01 +02:00
Patrick Niklaus
5f9ccadd6c
If geometry is only one point, encode as Point not as LineString 2016-04-20 20:49:54 +02:00
karenzshea
6e04da9f8f remove movable bridge refs in bike profile 2016-04-19 14:24:16 -04:00
karenzshea
58c13d2c07 remove movable bridge travel mode references 2016-04-19 12:59:33 -04:00
karenzshea
bca8593eef remove movable bridge mode from car profile 2016-04-19 10:21:46 -04:00
Patrick Niklaus
3e2e10a4c3 Add unit test for tile plugin 2016-04-15 14:48:21 +02:00
Patrick Niklaus
6979763292 Refactor the vector tile constants 2016-04-15 14:48:21 +02:00
karenzshea
324f1739e4 more table tests, break waypoint obj check into header file 2016-04-15 14:46:17 +02:00
karenzshea
1489662f57 start tests for table plugin 2016-04-15 14:46:17 +02:00
Daniel Patterson
1c1f407f67 Fix formatting. 2016-04-14 14:39:20 -07:00
Daniel Patterson
8fb631417b Abort processing if there are no snappable edges remaining. 2016-04-14 13:07:23 -07:00
Moritz Kobitzsch
ae45ad1ad2 fix r-tree abort location 2016-04-14 11:40:36 +02:00
Patrick Niklaus
6b89803534 Forgot to commit a test 2016-04-13 11:24:14 +02:00
Patrick Niklaus
d01b34f501 Forgot changelog entry 2016-04-12 23:17:47 +02:00
Patrick Niklaus
fcad2fa471 Update changelog 2016-04-12 23:16:02 +02:00
Patrick Niklaus
589767fe6d uturns -> continue_straight 2016-04-12 23:16:02 +02:00
Daniel J. Hofmann
d6407e5095 Fixes regression introduced in 8ff8dc.
References:
- 8ff8dc7200
2016-04-12 21:12:08 +02:00
Patrick Niklaus
8ff8dc7200 Try ulong_long, requires ifdef 2016-04-12 18:11:08 +02:00
Patrick Niklaus
2f7b02c96f Fix std::min 2016-04-12 18:11:08 +02:00
Patrick Niklaus
669e2a767a Another missed irange 2016-04-12 18:11:08 +02:00
Patrick Niklaus
2b4f9feeab Forgot a irange fix 2016-04-12 18:11:08 +02:00
Patrick Niklaus
1554916639 Include <iterator> for back_inserter 2016-04-12 18:11:08 +02:00
Patrick Niklaus
32a3651231 Changed windows encoded size to 104 2016-04-12 18:11:08 +02:00
Patrick Niklaus
dbd4ecf89b Remove boost::irange 2016-04-12 18:11:08 +02:00
Patrick Niklaus
7416653874 Force correct type deduction for irange on windows 2016-04-12 18:11:08 +02:00
Patrick Niklaus
621ed970da Fix assertions about hint size for windows 2016-04-12 18:11:08 +02:00
Patrick Niklaus
457ba9ac62 Adapt RC2 changelog 2016-04-12 17:15:16 +02:00
Patrick Niklaus
f9da5f2c80 Fix coverall flags 2016-04-12 16:20:45 +02:00
Patrick Niklaus
b6a793a1e2 Fix COVERAGE=ON and add SANITIZE=ON/OFF 2016-04-12 15:43:29 +02:00
Daniel J. Hofmann
bf2ab3d8af One-Definition-Rule violation in viewport 2016-04-12 12:17:52 +02:00
Daniel J. Hofmann
02f75236cb Increase the Cucumber timeout, as we're hitting it on Travis.
Our OSX Travis builds seem to hit the 2s timeout from time to time,
which is really irritating.

This increases the timeout to 5s, hoping for the best.
2016-04-12 12:17:01 +02:00
Daniel J. Hofmann
5dff83c6e9 Report progress for gennerating edge expanded edges in the edge based graph factory 2016-04-12 12:16:14 +02:00
Daniel Patterson
43725bae89 Fix Radius Calculation for points collinear in latidue 2016-04-12 11:25:59 +02:00
Patrick Niklaus
59c12506cf Update taginfo 2016-04-11 09:38:54 +02:00
Daniel J. Hofmann
be15a3b739 Add maxspeed=none tag to car profile.
maxspeed=none means there is no explicit maxspeed limit. Set to
guestimate for driving on the Autobahn.

References:

 - https://github.com/Project-OSRM/osrm-backend/issues/2145
 - http://wiki.openstreetmap.org/wiki/Key:maxspeed
 - http://taginfo.openstreetmap.org/tags/maxspeed=none
 - http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed
2016-04-11 09:38:45 +02:00
Patrick Niklaus
9f515dad09 Fix tests 2016-04-09 23:04:43 +02:00
Patrick Niklaus
5052c4ae3a Move projection function into own header and inline 2016-04-09 17:31:36 +02:00
Patrick Niklaus
9a617f5d41 Make the poly2req script work with 4.9 and 5.0 and add modes 2016-04-09 17:31:36 +02:00
Patrick Niklaus
4886d46d91 Use DouglasPeucker with squaredEuclideanDistance 2016-04-09 17:26:27 +02:00
Patrick Niklaus
67834def5f Switch to uint64 for distance measurements in StaticRTree 2016-04-09 17:26:27 +02:00
Patrick Niklaus
c51ffeb65a Switch StaticRTree leaf size to 256 elements per leaf
This increses query performance dramatically for queries with a lot of
coordinates. However it increases the internal memory usage of the
StaticRTree also 4x.
2016-04-09 17:26:27 +02:00
Patrick Niklaus
68ee4eab61 Switch squaredEuclideanDistance to uint64_t 2016-04-09 01:38:22 +02:00
Patrick Niklaus
fa6d4ac0bc Add faster version of WGS84 -> Web Mercator 2016-04-09 01:38:22 +02:00
Patrick Niklaus
3fa533d91e Okay include build again since it seems to contain the coverage files 2016-04-09 00:28:04 +02:00
Patrick Niklaus
c0db144906 Exclude build and third_party 2016-04-09 00:07:19 +02:00
Patrick Niklaus
ea2ec168b0 Cleanup .travis.yml and run coverall from root 2016-04-08 21:40:05 +02:00
Patrick Niklaus
cb18c1a54d Adapt status cucumber tests 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
45bcb22270 Fixes unit tests that relied upon wrong behavior in parsers 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
2539fd53dc Enable unit test that should pass with fixes from this branch 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
8a2bd09fd0 Adapts all grammars to use expectation parsers without backtracking.
Sequence parsers using `>>` allow for backtracking, expectation parsers
`>` do not. This allows us to properly report the position where parsing
failed, by catching the expectation_failure exception and adapting the
iterator ourselves.

References:
- https://github.com/Project-OSRM/osrm-backend/pull/2188
- https://github.com/Project-OSRM/osrm-backend/issues/2168
- http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/spirit/qi/reference/operator/expect.html
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
def89ac079 Conform to v5 spec and support "unlimited" as radiuses value.
Supersedes: https://github.com/Project-OSRM/osrm-backend/pull/2231

Thanks to Michael Krasnyk (@oxidase) for figuring out the reason for the
segfault earlier:

> https://github.com/Project-OSRM/osrm-backend/pull/2231#issuecomment-207114226
2016-04-08 21:03:50 +02:00
Michael Krasnyk
fe08726387 Fix BOOST_FUSION_ADAPT_STRUCT parameters for ParsedURL
Fix build error: macro "BOOST_FUSION_ADAPT_STRUCT" passed 5 arguments, but takes just 2
https://travis-ci.org/Project-OSRM/osrm-backend/builds/121406444
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
9bb4a68599 Fixes grammar includes and formats them 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
996a27dbd1 Report position where parsing failed; resolves #2168 2016-04-08 21:03:50 +02:00
Michael Krasnyk
58ebadd7b3 Fix #2173 with a no_trailing_dot_policy
no_trailing_dot_policy rejects parsing exp, exp_n, nan, inf
and rejects parsing a fractional part if detects ".Fmt".
For Fmt = 'j', 's', 'o', 'n':
 42.foo    rule parses 42.
 42.json   rule parses 42
 42..json  rule parses 42.

Reference:
- https://github.com/Project-OSRM/osrm-backend/pull/2222#issuecomment-206206239
2016-04-08 21:03:50 +02:00
Michael Krasnyk
cae06ba2c1 Fix type "osrm::server::api::ParsedURL ()" 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
0274afa0f7 Allow 4.json and 4.3.json format; needs -lit(".") >> -lit("json") hack^Wworkaround
Rainer Deyke's workaround without the need to do ugly backtracking.

References:
- http://lists.boost.org/boost-users/2016/03/85960.php
- https://github.com/Project-OSRM/osrm-backend/issues/2173#issuecomment-204342785
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
221f70ac7b Synthesize parser only once from DSL: static storage duration 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
d3dbca374d Do not modify the end iterator for parameter parsing, too 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
6f0b6a8158 Re-factor URL parser: make grammar stateless 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
b25cd6aaf2 Moving from references is a bad idea in parameter parsers, too 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
d27025003a Do not move from references in grammar handlers 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
66eb90d9d0 Adapts move(*optional) to *move(optional) to get rvalue operator* overload 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
6a81a9d191 Extra semicolon 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
64cb134113 Align Spirit rules for URL parser 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
891ff7dd80 Do not modify the end iterator, make const 2016-04-08 21:03:50 +02:00
Patrick Niklaus
6643e7f499 Integrate converage reporting 2016-04-08 20:37:51 +02:00
Moritz Kobitzsch
fcbf527ba5 refactor of turn analysis into turn handlers 2016-04-08 18:14:43 +02:00
Moritz Kobitzsch
dfd180a292 fixing unit tests 2016-04-08 11:21:14 +02:00
Moritz Kobitzsch
fa0a5040e5 adding tests for guidance 2016-04-08 10:43:22 +02:00
Dane Springmeyer
56ba2cb251 Add missing -lz to fix linking of server-tests 2016-04-08 01:52:35 +02:00
Patrick Niklaus
dea12779cf basename -> filename, fixes #2027 2016-04-08 01:50:25 +02:00
karenzshea
6033c05ff0 checks for waypoint index and route lengths 2016-04-07 22:11:28 +02:00
karenzshea
407da8bd15 start match test 2016-04-07 22:11:28 +02:00
Daniel J. Hofmann
43413ff980 Add license to storage and storage config exposed in public API, closes #2036 2016-04-07 10:41:32 +02:00
Moritz Kobitzsch
4d864b8267 fix warnings in compilation on clang 2016-04-06 18:44:42 +02:00
Daniel J. Hofmann
a516245c94 Modularize benchmarks subproject 2016-04-06 18:36:08 +02:00
Daniel J. Hofmann
b1ed268d0e Start modularizing the CMake buildsystem
The main reason for modularizing the unit tests was to split off
libboost_unit_test_framework from the osrm toolchain binaries.

Now only the unit test binaries link against it, unblocking
binary distribution without unit test library dependencies.

I started this on v4 a couple of weeks ago and hit a -llua5 issue on
Travis. By now v5 diverged quite a bit (especially in the code that I
have to stare at for debugging the issues).

https://github.com/Project-OSRM/osrm-backend/pull/2073

Let's bring this to v5+ only.

This is blocking:

- https://github.com/Project-OSRM/osrm-backend/issues/2065
- https://github.com/Project-OSRM/osrm-backend/issues/2197#issuecomment-204864938
2016-04-06 18:36:06 +02:00
Patrick Niklaus
83b86bf092 Fix typo .travis.yml for clang compiler name 2016-04-06 18:08:22 +02:00
Daniel J. Hofmann
954caa6804 The C compiler is used for several CMake tests, match with C++ compiler 2016-04-06 15:25:18 +02:00
Patrick Niklaus
8b6da4d2fe Enable server-tests on travis 2016-04-06 15:20:53 +02:00
Patrick Niklaus
f2d70d972d Temporarily enable travis for rewrite/new-api branch 2016-04-06 15:16:28 +02:00
Daniel J. Hofmann
b20de76037 Make verbose sections foldable on Travis 2016-04-06 10:58:49 +02:00
Patrick Niklaus
a33bd9dfe6 Adapt benchmarking script 2016-04-05 23:40:24 +02:00
Moritz Kobitzsch
f2443c64db adds distinction between rotaries/rounabouts 2016-04-05 22:59:14 +02:00
Patrick Niklaus
278ec04f5e Remove left-over summary code 2016-04-05 22:59:14 +02:00
Patrick Niklaus
95787255a1 Fix broken uturns test 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
eaf9993dd9 Removes summary from legs property 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
470d7600b8 fixes 2219 2016-04-05 22:59:14 +02:00
Patrick Niklaus
849baea544 Fix uturn detection in match plugin 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
4f1ca20dda Do not rely on alternatives being found in unit tests 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
97401ad99a Disable steps and alternatives by default 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
59f5e364c1 Suppress pedantic ISO C++ warning about argv[0] size check 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
29c2a117c0 Adapts tests to case sensitive "Ok" status code. 2016-04-05 22:59:14 +02:00
Patrick Niklaus
c209e31ce1 Fix tests for 2016-04-05 22:59:14 +02:00
Patrick Niklaus
12608889e2 Fix 'ok' -> 'Ok' 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
3343882876 Resolves issues with multiple includedirs in pkg-config file; closes #2195. 2016-04-05 22:59:14 +02:00
Patrick Niklaus
6e50b5fc60 Filter segments correctly by bounding box 2016-04-05 22:59:14 +02:00
Patrick Niklaus
c540c85cf8 Remove tests from default target until we get proper switchting in place 2016-04-05 22:59:14 +02:00
Patrick Niklaus
b17491ebe5 Bump osrm version 2016-04-05 22:59:14 +02:00
Patrick Niklaus
76b410b2ca Update changelog to 5.0.0 RC1 2016-04-05 22:59:14 +02:00
Daniel Patterson
069388eae0 Exclude new node_modules folder that might be around if test cases have been run. 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
c6c25e609b Initial libosrm API docs 2016-04-05 22:59:14 +02:00
Daniel Patterson
9b52dd8bf7 Remove leftover debug output. 2016-04-05 22:59:14 +02:00
Daniel Patterson
2cf19010e3 Fix context returned in JSON error (had null bytes).
Update status test cases to match new API.
2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
89d56e1cd1 fix duration of direct connection 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
ef1fb08723 fix cucumber tests and issues 2016-04-05 22:59:14 +02:00
Daniel Patterson
e60ebee3f2 Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Lauren Budorick
4c88fe0fb1 Add arrival instruction 2016-04-05 22:59:14 +02:00
Daniel Patterson
13338414db Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
96f49f3b53 Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
75979d7e1c Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
29a2447906 Add missing arrival instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
2f702f61a4 Add missing arrival instruction. This test was incorrect. 2016-04-05 22:59:14 +02:00
Lauren Budorick
5a71acbe3c Add missing arrival instructions 2016-04-05 22:59:14 +02:00
Daniel Patterson
ca3e8ef09e Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
8c44084af1 Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
d829a390fd Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
6b6597e453 Add missing arrive instruction. 2016-04-05 22:59:14 +02:00
Daniel Patterson
97c550d5f6 Add missing arrive instruction to distance feature. 2016-04-05 22:59:14 +02:00
Daniel Patterson
acfd6ab141 Fix missing arrive instruction on bearing tests. 2016-04-05 22:59:14 +02:00
Daniel Patterson
7e790c1aa6 Add missing arrive instructions to time tests. 2016-04-05 22:59:14 +02:00
Lauren Budorick
d1e2aa57a8 start updating testbot fixtures (TODO: the rest) 2016-04-05 22:59:14 +02:00
Lauren Budorick
2e6e3bf0b0 Update raster features to reflect not cutting off arrive instruction 2016-04-05 22:59:14 +02:00
Lauren Budorick
e5025665fc Update foot features to reflect not cutting off arrive instruction 2016-04-05 22:59:14 +02:00
Lauren Budorick
1a8097f810 Update car features to reflect not cutting off arrival instruction 2016-04-05 22:59:14 +02:00
Patrick Niklaus
f45daad6ca Fix code of InternalError 2016-04-05 22:59:14 +02:00
Patrick Niklaus
e4e85e6f7e Fix some via tests 2016-04-05 22:59:14 +02:00
Daniel Patterson
5beaf695ed Fix bearing param tests. Have not yet fixed the cause of the two failing cases. 2016-04-05 22:59:14 +02:00
Lauren Budorick
d09827b501 Update bicycle tests to reflect not cutting off arrive step 2016-04-05 22:59:14 +02:00
Daniel Patterson
97722adbfa Adjust threshold when trimming steps (needs to be bigger).
Also, when trimming the last step, we need to copy name values from the new next-to-last step, otherwise
we can still end up with an arrive step on a different road to the last maneuver.
2016-04-05 22:59:14 +02:00
Patrick Niklaus
006a8833d3 Fix some of the accidental forced loops in viaroute 2016-04-05 22:59:14 +02:00
Patrick Niklaus
8111baa8f9 Remove unused detach parameter 2016-04-05 22:59:14 +02:00
Daniel Patterson
d6e4dc0aa2 Add 'arrive' step to route descriptions. 2016-04-05 22:59:14 +02:00
Daniel Patterson
497da1d29b Colorize test result diff output. 2016-04-05 22:59:14 +02:00
Lauren Budorick
cbc8b64854 unbreak the zombiekilling 2016-04-05 22:59:14 +02:00
Lauren Budorick
c06f2a50f1 Fix routability now that we don't chop off a step 2016-04-05 22:59:14 +02:00
Patrick Niklaus
825a422721 Remove arrive filter 2016-04-05 22:59:14 +02:00
Patrick Niklaus
2c4ba90abb Remove leftover hello_world and timestamp plugins 2016-04-05 22:59:14 +02:00
Patrick Niklaus
6dda899a60 There is no timestamp service anymore 2016-04-05 22:59:14 +02:00
Lauren Budorick
8725e2f40d Remove one more compass column; update polyline encoding tests 2016-04-05 22:59:14 +02:00
Patrick Niklaus
35c501c203 .json hotfix 2016-04-05 22:59:14 +02:00
Patrick Niklaus
30a9bc3179 Fix mathematical assumptions in StaticRTree
StaticRTree now uses projected coordinates internally. That means we can
use a euclidean distance measure (squared distance) for sorting the
query queue.
2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
f9350a276c fix same segment routes 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
cd9addf0e2 Removed debug code 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
2219b6507c correctly handle roundabouts in a wide set of special cases 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
09931d7ad8 Removes server-side support for POST requests. 2016-04-05 22:59:14 +02:00
Lauren Budorick
7ce0c0ef9a Rm unnecessary io.write 2016-04-05 22:59:14 +02:00
Lauren Budorick
49e2cb6c36 Fix raster_source + tests 2016-04-05 22:59:14 +02:00
Lauren Budorick
4b60fc4747 return geometry from new API 2016-04-05 22:59:14 +02:00
Lauren Budorick
164fb09f2c Fix route/bearing param 2016-04-05 22:59:14 +02:00
Lauren Budorick
5647e6c199 Fix double shutdown 2016-04-05 22:59:14 +02:00
Lauren Budorick
a4d6544764 Fix alternatives option test, chdirs on fail, spacing 2016-04-05 22:59:14 +02:00
Lauren Budorick
e942f6e420 Update pushing test to reflect better guidance 2016-04-05 22:59:14 +02:00
Patrick Niklaus
7174baa91e Move osrm-components to BUILD_COMPONENTS flag 2016-04-05 22:59:14 +02:00
Patrick Niklaus
5c8b7542d0 Fix staticrtree benchmark 2016-04-05 22:59:14 +02:00
Lauren Budorick
e8035ced5a Fix trips + matchLocation 2016-04-05 22:59:14 +02:00
Jeff Miccolis
70a086a9e1 make eslint happy 2016-04-05 22:59:14 +02:00
Jeff Miccolis
08cb6d1f63 Fix timestamp handling, restores testbot/matching test 2016-04-05 22:59:14 +02:00
Lauren Budorick
c7f3645fe2 Status fixes 2016-04-05 22:59:14 +02:00
Lauren Budorick
4b6a85aae0 Distance matrix fixes 2016-04-05 22:59:14 +02:00
Lauren Budorick
c8a8859d2f rm console.log my bad 2016-04-05 22:59:14 +02:00
Lauren Budorick
8c0f47f06c Fix guidance/roundabout spacing 2016-04-05 22:59:14 +02:00
Lauren Budorick
926290dd9c enter_roundabout -> roundabout-exit (these are still off by one @mokob ?) 2016-04-05 22:59:14 +02:00
karenzshea
6ae3315bb9 parse for the right nearest output coordinate 2016-04-05 22:59:14 +02:00
Jeff Miccolis
8621b1890e Fix testbot turns 2016-04-05 22:59:14 +02:00
karenzshea
c726001a0e console error which files are missing for osrm-routed 2016-04-05 22:59:14 +02:00
Jeff Miccolis
eba5f7d275 Matrix times are on seconds now. Removing POST matrix tests 2016-04-05 22:59:14 +02:00
Lauren Budorick
2f793473cc head/destination -> depart/arrive to reflect guidance API changes; minor fixes for roundabout tests 2016-04-05 22:59:14 +02:00
karenzshea
91567cad9e update osrm-routed options menu 2016-04-05 22:59:14 +02:00
Jeff Miccolis
d48ee84ae7 Return first alternative in tests 2016-04-05 22:59:14 +02:00
Jeff Miccolis
fd000cad86 Remove compass direction test handling 2016-04-05 22:59:14 +02:00
Lauren Budorick
6244063073 #2155 is fixed 2016-04-05 22:59:14 +02:00
Jeff Miccolis
f34de8422e eslinting 2016-04-05 22:59:14 +02:00
Jeff Miccolis
a33edd15b4 Update alternatives flag 2016-04-05 22:59:14 +02:00
Jeff Miccolis
6a65261765 test query params are an object 2016-04-05 22:59:14 +02:00
Jeff Miccolis
07f3e2d457 Removing unneeded stopgap 2016-04-05 22:59:14 +02:00
Jeff Miccolis
958199ffef Allow for different rounding in car-maxspeed fixture 2016-04-05 22:59:14 +02:00
Jeff Miccolis
e5ebf74d76 Add stopgap for https://github.com/Project-OSRM/osrm-backend/pull/2159 2016-04-05 22:59:14 +02:00
Lauren Budorick
126d2f85ac Mode changes, guidance comments, fix turns 2016-04-05 22:59:14 +02:00
Lauren Budorick
908e3a2af6 Fixes: double callbacks and untested headers 2016-04-05 22:59:14 +02:00
Jeff Miccolis
25e40d723a Better handling of test response payloads 2016-04-05 22:59:14 +02:00
Lauren Budorick
7a764ce78b ensure all nodes are written as decimals 2016-04-05 22:59:14 +02:00
Lauren Budorick
8947c789a9 WIP: race conditions and stalling server 2016-04-05 22:59:14 +02:00
Lauren Budorick
8ac403abb9 start fixing URLs 2016-04-05 22:59:14 +02:00
Lauren Budorick
9752cb8e4d Add more files to be renamed; fix launch error 2016-04-05 22:59:14 +02:00
Lauren Budorick
e9be9dd8d0 Bind use_turn_restrictions to ProfileProperties in scripting environment 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
5e6d638c6f perform zero-length segment removal 2016-04-05 22:59:14 +02:00
Daniel Patterson
c47f6e2ca5 Use simpler coordinates for tests. 2016-04-05 22:59:14 +02:00
Daniel Patterson
cc09df1961 Use correct perpendicular distance measure when simplifying line geometries. 2016-04-05 22:59:14 +02:00
Moritz Kobitzsch
db26d2b2d7 fixes missing overrides in mock data facade 2016-04-05 22:59:14 +02:00
Daniel Patterson
5b33efeecc Fixes #2152 - weight vector needed to be reversed, and start index was wrong. 2016-04-05 22:59:14 +02:00
Patrick Niklaus
fda4656630 Implement re-enabling of PhantomNode directions after bearing filtering 2016-04-05 22:59:14 +02:00
Patrick Niklaus
5829bbe22d Move Centroid to coordinate_calculation 2016-04-05 22:59:14 +02:00
Patrick Niklaus
f4cfde719d Round integers to remove fake precision 2016-04-05 22:59:14 +02:00
Patrick Niklaus
1fd66f55c1 Fix problem with uturns=true 2016-04-05 22:59:14 +02:00
Patrick Niklaus
a964bec0f8 Add route fixture test 2016-04-05 22:59:14 +02:00
Patrick Niklaus
b65ba5c394 Adapt get_osrm to EngineConfig changes 2016-04-05 22:59:14 +02:00
Patrick Niklaus
d51eefa1c4 Make tests build by default 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
4025cbd555 Make extractor unit tests work again after global uturn changeset 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
3da27c06c3 Number of waypoints equals number of input coordinates 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
bc7824812b Make test assumption failure output violation in Route unit tests 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
baf7822340 Hook up small component locations for Nearest response test 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
82ee08fcaf Provide dummy locations from our fixed monaco dataset 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
51d153a5f7 Fixes integer overflow due to fixed / floating mismatch in coordinate interpolation 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
df608e8b43 Makes switching between floating and fixed coordinates safe wrt. overflows 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
8e477437a6 Makes viewport immune to inf and nans 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
e70f0eea02 Fix base64 test wrt. Hint no longer taking coordinate in ctor 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
8be93a0202 Adapt mock facade implementation to renamed base facade symbols 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
d4f7f19a22 Provide implementation for all pure virtual base member functions in mock facade 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
4441381042 Mismatched tag in fwd decl 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
61c9c69718 Make unit tests compile again after rebasing 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
5beaab97da Make Tile plugin validate its parameters, fixes #2109 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
843a4b8eae Make Route plugin validate its parameters 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
9ec46222e3 Makes Nearest plugin adhere to v5 spec for precondition violations, fixes #2108 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
210da11fbb Unit test for Route service; some failing where v5 spec is unclear 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
ee61ae360d Unit tests for Tile service; plugin needs improvements: see #2109 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
890e0f4995 Unit tests for Nearest service; one test failing: see #2108 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
224c66e0dc Makes table plugin adhere to v5 spec for limit violations, fixes #2100 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
88052cd194 Adapts our Travis config to continuously run the library unit tests 2016-04-05 22:59:14 +02:00
Daniel J. Hofmann
c22453f24a Tests for config level constraints; table failing: see #2100 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
099a805260 Initial unit tests setup for typed libosrm services 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
7ed474af8d Puts auto-generated monaco test files on gitignore 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
9d893d6d4d Library tests build system integration 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
e55af0c274 Add guidance assembly unit test stub 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
803fbf2541 Sentinel spelling 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
061b2b63e9 Explicitely construct coordinate and phantom node 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
1486098065 Adapts all unit tests and benchmarks to compile under v5 again 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
0f0db4c823 Provide correct Base64 implementation.
Phew, this was painful. Turns out most hints out there on how to use the
Boost serialization iterators are wrong. Here's why:

    transform_width<6, 8>

needs an input stream of length: common multiple of 6 and 8.

That is, the padding needs to happen _before_ using the provided
iterators, otherwise the behavior is undefined!

See: http://www.boost.org/doc/libs/1_60_0/boost/archive/iterators/transform_width.hpp

Thanks @mokob for pointing that out to me!

We also need to manually add as many padding chars "=" to the encoded
result as many bytes we had to append to the input to conform to the
rule above.

Decoding then knows the number of padding chars by counting for "=" and
then using it in order to split off the last bytes from the decoded
result.
2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c3e7e96dce Adds round trip tests for RFC 4648 Test Vectors and equality checks 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3c5f6bd8ac Makes hint Equatable and Printable for tests 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
b6b59e5c08 Make Hint encoding safe for passing them as GET parameter in URLs
Thanks @TheMarex for flagging this!
2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
a7aa27c87c Completely re-write base64 logic, make API suck less in doing so 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
735b325d74 RFC 4648 Test Vectors 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
f948380fa2 Object Encoder -> Base64, kill false dependencies while doing so 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
79cf1880fc Adapts Hint encoding and decoding to new fixed data facade 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
ca130e1dc4 Formats parameter parser unit tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus
d67ce81438 Fix hint size 2016-04-05 22:58:32 +02:00
Patrick Niklaus
ec1a84c57a Always safe the absolute path to .fileIndex 2016-04-05 22:58:32 +02:00
Patrick Niklaus
59163cb2fc Install storage_config.hpp 2016-04-05 22:58:32 +02:00
Aleksei Potov
419cf9e2b0 compilation error on debian jessie with boost 1.54 2016-04-05 22:58:32 +02:00
Daniel Patterson
95c78eac9c Fix boost geometry constructor.
Versions older than 1.58 don't support the initializer-list form.
2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
51a4cf5e46 syncronize geometry and steps after post-processing 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
2472c5d6a1 added list of intersections to the step-maneuver, not in api so far 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
59fbb289b9 fix initial maneuvers 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
e82bc20422 post processing moved onto route-steps, looses sync with geometry segments 2016-04-05 22:58:32 +02:00
Patrick Niklaus
1e753e98ce Simplify the timestamp handling 2016-04-05 22:58:32 +02:00
Patrick Niklaus
39b3cab1da Check all streams 2016-04-05 22:58:32 +02:00
Patrick Niklaus
87fbfc6475 std::string -> boost::filesystem::path 2016-04-05 22:58:32 +02:00
Patrick Niklaus
cb8bfa027e Only allow to specify the common base path 2016-04-05 22:58:32 +02:00
Patrick Niklaus
1b1274fd56 print -> io.write 2016-04-05 22:58:32 +02:00
Patrick Niklaus
38db495879 Address PR comments
Renamed lua_function_exists and removes unused print function
2016-04-05 22:58:32 +02:00
Patrick Niklaus
a781c36876 Use uturn default from .properties file 2016-04-05 22:58:32 +02:00
Patrick Niklaus
71c336d9dd Adds .properties file to osrm-extract ouput
This file contains global properties set by the lua
profile, such as enabling uturns at vias and penalties.
This file will be consumed by the server.
2016-04-05 22:58:32 +02:00
Patrick Niklaus
e10e8910f3 Use global uturns parameter.
Instead of previously per-via settings like uturns=true;false;true;; it
now only supports a global setting uturns=true.
2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
253496c7ee improves consistency of fork handling 2016-04-05 22:58:32 +02:00
Patrick Niklaus
30a3ab68c0 Make gcc 4.8 happy and disable protected because of lambdas 2016-04-05 22:58:32 +02:00
Daniel Patterson
663a7c52c7 Properly clip lines so that we don't get crazy coords with long linestrings (relative to tile coords) 2016-04-05 22:58:32 +02:00
Daniel Patterson
4e8ccd6f7d Include edge duration information. 2016-04-05 22:58:32 +02:00
Patrick Niklaus
879ccfc8c2 Implement viewport code to fix simplification
This fixes #2083
2016-04-05 22:58:32 +02:00
Patrick Niklaus
a77574b3d7 Add tests for coordinate transformation 2016-04-05 22:58:32 +02:00
Patrick Niklaus
50738f8ce0 Consolidate math functions 2016-04-05 22:58:32 +02:00
Patrick Niklaus
5c01878542 get_name_for_id -> GetNameForID 2016-04-05 22:58:32 +02:00
Patrick Niklaus
ea93f6f560 Simplfy name change announcement 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
7bab34eeda fix division by zero 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
0cc23dec6f restructured to only return valid turns to the outside + cleanup 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
71c0d5253d less new names, forks consider road classes, api clean-up 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
a674028c37 implement basic turn handling 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
29fff4f51b implements relative position feature based on coordinates 2016-04-05 22:58:32 +02:00
Patrick Niklaus
4309ccfa02 Don't sum up durations of merged steps since we do that in a different place now 2016-04-05 22:58:32 +02:00
Patrick Niklaus
4e8fe89faa Fix foward/backwad swap 2016-04-05 22:58:32 +02:00
Patrick Niklaus
8218d5a47e Limit zoomlevel to 18 2016-04-05 22:58:32 +02:00
Patrick Niklaus
4bbb587280 Fix shared memory 2016-04-05 22:58:32 +02:00
Patrick Niklaus
0f04fe75bd Fixup for last commit 2016-04-05 22:58:32 +02:00
Daniel Patterson
11b356e55f Enables the use of multiple segment-speed-files on the osrm-contract
command line, and exposes the file name used for each edge in the debug
tiles.
2016-04-05 22:58:32 +02:00
Patrick Niklaus
80f008684d Fix ingestion fixed duration values from UnpackPath 2016-04-05 22:58:32 +02:00
Patrick Niklaus
c9c2d8133c Fix durations in UnpackPath 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
ac9a4d1e0d fixes a broken assertion 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
d7dd6acd9d fix merging of turn instructions 2016-04-05 22:58:32 +02:00
Patrick Niklaus
b5739cb3d8 Include reverse edges again 2016-04-05 22:58:32 +02:00
Patrick Niklaus
ea93d56ca8 Formating and logging changes for turn classification 2016-04-05 22:58:32 +02:00
Patrick Niklaus
10097a946f Handle case of dead-end edges by inserting an invalid turn 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
c439594403 report depart/arrive in addition to waypoint 2016-04-05 22:58:32 +02:00
Patrick Niklaus
29cf9e05db Only install necessary headers 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
298f68c966 Adds the license preamble for all publicly installed eaders, closes #2036 2016-04-05 22:58:32 +02:00
Patrick Niklaus
0b3289ea37 Remove the encoder/decoder dependecy from Hint 2016-04-05 22:58:32 +02:00
Patrick Niklaus
5f457bff12 Rename alternative -> alternatives 2016-04-05 22:58:32 +02:00
Patrick Niklaus
6c00ccca9a Remove obsolete debug information 2016-04-05 22:58:32 +02:00
Patrick Niklaus
7e679ab252 Just return NoSegment in map matching if all candidates are empty 2016-04-05 22:58:32 +02:00
Patrick Niklaus
0ca21dbc91 Add failing test for map matching of outlier 2016-04-05 22:58:32 +02:00
Patrick Niklaus
d2590f1078 Fix missing capitalization of error codes 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
eb3f550e26 encapsulated into class 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
06aa6dedab improving fork handling on three-way turns 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
f769478abe fix comparison for ramps on three-way turns 2016-04-05 22:58:32 +02:00
Patrick Niklaus
ba5f0af5a4 Minor auto iterator cleanup 2016-04-05 22:58:32 +02:00
Patrick Niklaus
5e5f72ae57 Don't pass down unsnapped coordinates. All information is already there 2016-04-05 22:58:32 +02:00
Patrick Niklaus
f36037ebf2 Fix camMergeTrivially 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
0c276ac71e fixes roundabout counting 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
9e95d1f1fd fixes assignment for basic turn types / invalid ramp assignment 2016-04-05 22:58:32 +02:00
Patrick Niklaus
e00bda37a5 Add edge id assertions 2016-04-05 22:58:32 +02:00
Patrick Niklaus
e7ea5f500d Don't pass shared_ptr down to functions
"Don’t pass a smart pointer as a function parameter unless you want to
use or manipulate the smart pointer itself, such as to share or transfer
ownership."

Source:
http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2016-04-05 22:58:32 +02:00
Patrick Niklaus
a8fc95d4e4 Move bearing to public namespace 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3f598a5121 Properly includes needed headers in turn analysis interface 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
81c5ec0777 Const-correctnes for compressed geometry iterator 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
32bb58b272 Use stdint and using type-alias for discrete angle 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
aa4b786ab3 Hide functional road classification based on tags in implementation file 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3f5968b60c Inline initialize functional road classification hash table 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
251eeb534a 256 functional road classes should be enough 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
90add9f840 Moves route assembly into implementation file 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
770624d492 Fixes remaining engine/guidance includes 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c59758ef65 Fixes accumulate living in <numeric> and not <algorithm> 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
15752335f4 Puts step maneuver handling into implementation file 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3e4b48e206 Removes penalizing move 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
25c685527a Uses static_casts for underlying type in post processing 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
fbabd137c2 Fix asymmetry in min/max from using -max 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
6e7cf68164 Adapts MakeResponse to not pass vector by pointer 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
b47a532eb4 Fixes multi-line comment 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
7c30ea32bf Runs scripts/format.sh 2016-04-05 22:58:32 +02:00
Patrick Niklaus
bb06e044f5 Fix coodinate include and unused warnings 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
01318a08b4 start of four way turns 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
119487f1aa improved fork handling 2016-04-05 22:58:32 +02:00
Patrick Niklaus
911427a361 Fix crash on extracting Berlin in guidance 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
58628a4bfc bugfixing/classification 2016-04-05 22:58:32 +02:00
Patrick Niklaus
b08b360f38 Big Restructuring / Cleanup 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
adb8d0e845 starting on conflict resolution 2016-04-05 22:58:32 +02:00
Lauren Budorick
e0f009b3b9 Fixes for gcc compiling, temporary hacks to remove later 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
f1aa03c360 handle segregated roads (merge for turn analysis) 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
2ba417cf9f structural changes, motorway handling 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
d8af074ff6 enter and exit roundabout feature - currently not showing turn 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
daf2bbf991 migrated out of edge based graph factory 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
6605f293b4 relative waypoint locations 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
482e18ccdb handling of roundabouts (simple version) 2016-04-05 22:58:32 +02:00
Moritz Kobitzsch
ef1e0e14ec advanced guidance on 5.0 2016-04-05 22:58:32 +02:00
Patrick Niklaus
33f083b213 Fix numerical problems with polyline 2016-04-05 22:58:32 +02:00
Patrick Niklaus
bcfbc0cf6c Fix table response format to return null + double in seconds 2016-04-05 22:58:32 +02:00
Patrick Niklaus
00d75ece64 Return NoMatch 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
dc1b5d3424 Provides ctor from base path for EngineConfig, fixes #2030 2016-04-05 22:58:32 +02:00
Patrick Niklaus
58fb633df3 Add support for tile plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
36f9366f3f Preliminary integration of the tile plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
712f1ca02a sources and destinations can be empty actually 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
285b238f26 Fixes coordinate, source and destination validation by means of backporting #2041 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
70fb12b10e Fixes ownership semantics and forwarding references misplacements in the JSON factory 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
6380a6be05 Unwrap function call from identity lambda 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
548fd92c15 Uses JSON's String constructor for polyline encoding 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
86de53eb9a Passes coordinates by value 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
e1616953db Asserts on unknown TurnInstruction 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c1dbab50fe Fixes header includes in the JSON factory 2016-04-05 22:58:32 +02:00
Dane Springmeyer
b6bb6a92a9 fix compile of osrm-components 2016-04-05 22:58:32 +02:00
Patrick Niklaus
0ab80ad0a7 Fix if the last coordinate is not found 2016-04-05 22:58:32 +02:00
Patrick Niklaus
61744764da Allocate correct table size 2016-04-05 22:58:32 +02:00
Patrick Niklaus
8eb98982f3 Fix travel mode passing from profiles up to the API 2016-04-05 22:58:32 +02:00
Patrick Niklaus
1090339331 Fix geometries type in steps 2016-04-05 22:58:32 +02:00
Patrick Niklaus
804816f014 Fix table parameter parsing 2016-04-05 22:58:32 +02:00
Patrick Niklaus
51e8318224 Fix behaviour of table if sources/destinations arrays are empty 2016-04-05 22:58:32 +02:00
Patrick Niklaus
0d38a50dba Fuck. this. shit. 2016-04-05 22:58:32 +02:00
Patrick Niklaus
72094acf74 Change stream operator of strong typedef 2016-04-05 22:58:32 +02:00
Patrick Niklaus
1bd67943bb Fix stream operator for coordinate 2016-04-05 22:58:32 +02:00
Patrick Niklaus
30101e129f Add stream operator to Rectangle 2016-04-05 22:58:32 +02:00
Patrick Niklaus
9bb31678a6 Add euclideanDistance to coordinate_calculation 2016-04-05 22:58:32 +02:00
Patrick Niklaus
5e5c52ff0a Simplify static_rtree tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus
d9d4742130 First round of lat,lng -> lng,lat switcheroo 2016-04-05 22:58:32 +02:00
Patrick Niklaus
0fab6b7cab Add rectangle unit test 2016-04-05 22:58:32 +02:00
Patrick Niklaus
f10286de8c Fix match and trip API response 2016-04-05 22:58:32 +02:00
Patrick Niklaus
a0e0465704 Fix out-of-bounds write in map_matching 2016-04-05 22:58:32 +02:00
Dane Springmeyer
c8457a2619 Fix compile on OS X 2016-04-05 22:58:32 +02:00
Patrick Niklaus
14c36bc405 Finish the nearest plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
81319228bd Initialize NearestParameters correctly 2016-04-05 22:58:32 +02:00
Patrick Niklaus
fcd7b05900 Adapt to feedback in #519 2016-04-05 22:58:32 +02:00
Patrick Niklaus
8378d95588 Add trip plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
b34f9b1795 Hook up map matching 2016-04-05 22:58:32 +02:00
Patrick Niklaus
35b098e656 First compiling version of map_match plugin 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
e05a45b080 Adapts example/example.cpp to new osrm api 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
715ee66b03 Install _all_ transitively from public headers included header 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3d6e9da115 Fix missing headers in hint.hpp 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
54410988eb Adds $prefix/include/osrm to include dirs so that transitive header includes without osrm prefix can be found 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
dded2c2463 Adapt the example to include all osrm public headers 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
fcf5838019 Fixes missing public header installations 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
beafa18708 Fix forward declarations in publicly facing osrm header 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
bd371a11ad Enable all plugins with aStatus::Error return code fallback for not implemented ones 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
1895fee1c9 Adds publicly facing alias headers for parameters 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
2200d0b678 Temporarily comment out match.cpp as to not break the build process 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
f3c4a7dd16 We don't need templates at all, this is not CRTP? 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
25834b89dd Fix classes for service member function definitions 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
4d20dea271 Service skeletons for nearest, trip, match 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c59647ad2f Fix grammar constraint and enable all plugin links 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
e466cbe0ce Plugin grammar skeletons 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
a24de2d22a Enforce parameter and grammar type to catch subtle bugs 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
f452a3025d Link parameters to grammars 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3c58eaf49f Require a BaseParameters type at compile time via enable_if 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c75b497b2e Adapts Nearest plugin to new API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
d572d77b48 Fix deleting incomplete type and make Engine moveable only 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
a4074332cc Adapts publicly facing new API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c31ceb6a5b Adapts NearestParameters to new API 2016-04-05 22:58:32 +02:00
Patrick Niklaus
b0863d8628 Initial non-building match plugin 2016-04-05 22:58:32 +02:00
Lauren Budorick
c38a6d74dd Include numeric in assemble_overview.cpp (needed on OSX for std::accumulate) 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
7bec75b709 Semantic action handler requires passing optional by value and fusion::vector2 2016-04-05 22:58:32 +02:00
Patrick Niklaus
56ea24b03b Add tests for bearing parsing 2016-04-05 22:58:32 +02:00
Patrick Niklaus
277829c280 Add table service 2016-04-05 22:58:32 +02:00
Patrick Niklaus
c127aaae6b Add table API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c895848061 Optional<T> semantic action handler takes T argument 2016-04-05 22:58:32 +02:00
Patrick Niklaus
64e5ebb55f Fix parameter parsing tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus
83addd6bba Fix table plugin 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
d87a19b2f9 First take at distance table API re-write 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
b58edc980c Adapts TableParameters and its validation to new API 2016-04-05 22:58:32 +02:00
Patrick Niklaus
f3e72623e9 Add viaroute suport for new API 2016-04-05 22:58:32 +02:00
Patrick Niklaus
54ee76bcef Add benchmark target to Makefile and save timings 2016-04-05 18:57:31 +02:00
Daniel J. Hofmann
efe6faabfd Adds tests for routing over delivery ways and nodes; see #2150. 2016-04-04 14:00:54 +02:00
Daniel J. Hofmann
3ee8b655ea Prevents routing over delivery ways and nodes; closes #2150. 2016-04-04 14:00:54 +02:00
Daniel J. Hofmann
c70d138eb9 Spelling: Hierachy vs Hierarchy 2016-04-04 13:58:55 +02:00
Daniel J. Hofmann
af2a327310 Removes unused access_tag list from car profile
This is dead code. Using my time machine (which sadly can only go back
in history), I found the introducing commit here:

74cc50f52b (diff-ded22cbfae0ae88f6359ccff1c3355b0R106)

Seems like we no longer use it, and it was still left in the car profile.
2016-04-04 13:55:27 +02:00
Daniel J. Hofmann
b27e0e2807 Update CMake from 3.3 to 3.5 on Travis 2016-04-04 12:29:15 +02:00
Daniel J. Hofmann
8267ed53f0 Pins LLVM 3.8 (stable) instead of tracking the nightly repository 2016-04-04 12:27:45 +02:00
Patrick Niklaus
aa90d7b4b7 Merge pull request #2200 from oxidase/fix/uninitialised_alternative_segment
Fixes using uninitialised values in extractRouteNames
2016-04-03 22:58:04 +02:00
Michael Krasnyk
6b69946b9e Fixes using uninitialised values in extractRouteNames
Conditional jump or move depends on uninitialised value(s)
   at 0x5FEE48: osrm::engine::RouteNames osrm::engine::extractRouteNames<osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData>, osrm::engine::detail::Segment>(std::vector<osrm::engine::detail::Segment, std::allocator<osrm::engine::detail::Segment> >&, std::vector<osrm::engine::detail::Segment, std::allocator<osrm::engine::detail::Segment> >&, osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData> const*) (route_name_extraction.hpp:127)
   by 0x61A1B2: osrm::engine::ApiResponseGenerator<osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData> >::DescribeRoute(osrm::engine::RouteParameters const&, osrm::engine::InternalRouteResult const&, osrm::util::json::Object&) (api_response_generator.hpp:173)
   by 0x61AF47: osrm::engine::plugins::ViaRoutePlugin<osrm::engine::datafacade::BaseDataFacade<osrm::contractor::QueryEdge::EdgeData> >::HandleRequest(osrm::engine::RouteParameters const&, osrm::util::json::Object&) (viaroute.hpp:144)
   by 0x61EEEC: osrm::engine::Engine::RunQuery(osrm::engine::RouteParameters const&, osrm::util::json::Object&) (engine.cpp:100)
   by 0x5AE585: osrm::OSRM::RunQuery(osrm::engine::RouteParameters const&, osrm::util::json::Object&) (osrm.cpp:19)
   by 0x5A8E07: main (in /home/miha/work/foss/osrm-backend/build.example/osrm-example)
2016-04-03 19:29:35 +02:00
Daniel J. Hofmann
a1b87b5236 Handle all distances between coordinates being zero in Farthest Insertion algorithm.
Assertions for additional safety and sanity.

References:
- see https://github.com/Project-OSRM/osrm-backend/issues/2147
2016-03-31 18:57:24 +02:00
bergwerkgis
3044c5ea52 AppVeyor: remove MSBuild logs from artifacts as it interferes with deployment of binary 2016-03-31 15:55:11 +00:00
bergwerkgis
d0636a9f6d make AppVeyor work again 2016-03-31 16:49:30 +02:00
Lauren Budorick
0d291cb68e Make cucumber executable via package.json bin field 2016-03-24 17:31:18 -07:00
Lauren Budorick
c8bb50497b Rewrite cucumber test suite in JS 2016-03-24 16:01:01 -07:00
Patrick Niklaus
ea027a7cc1 Merge commit '62e8601919faca57a0fa4be1a910458390450cc9' as 'third_party/variant' 2016-03-24 21:32:27 +01:00
Patrick Niklaus
62e8601919 Squashed 'third_party/variant/' content from commit b585021
git-subtree-dir: third_party/variant
git-subtree-split: b5850212f16efeb409a112edb1e719d5f5edb604
2016-03-24 21:32:27 +01:00
Patrick Niklaus
be2cc7aed9 Remove variant 2016-03-24 21:32:12 +01:00
Patrick Niklaus
17babb22e2 mapbox/variant v1.0 -> v1.1 2016-03-24 21:26:31 +01:00
Patrick Niklaus
21245273b4 Also exclude the compressed flag from the data format 2016-03-24 21:24:08 +01:00
Patrick Niklaus
8d7821c84e Remove geometry indicator 2016-03-24 21:24:08 +01:00
Daniel J. Hofmann
c78dff9a15 Write out unsigned with a check for edge counter overflow 2016-03-19 00:27:55 +01:00
Daniel J. Hofmann
25fea558ba Fixes the edge-based-graph factory's edge counter serialization.
The counter for original edges is of type `std::size_t`, but we
serialized `sizeof(unsigned)` number of bytes out to the `.osrm.edges`
file.

We should probably check all writes (analogous for reads) and make the
count parameter dependent on `sizeof(variable)`.

    ag '\.write\((.*), sizeof\((.*)\)\);'
2016-03-19 00:27:55 +01:00
Daniel J. Hofmann
b1c84b598f Print the _local_ endpoint Boost ASIO assigns a port to, fixes #2097 2016-03-18 12:09:28 +01:00
Daniel J. Hofmann
a6aa0a4cb0 Adapts routed to always print port and ip it listens on, fixed #2097 2016-03-16 11:21:20 +01:00
Daniel J. Hofmann
8640129835 Ampersand binds to variable name 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
655dd2277c Eliminate extra semicola 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
40f95191a0 Do not copy pairs in loop 2016-03-15 11:47:57 +01:00
Daniel J. Hofmann
a013da860e Fixes unneeded includes in contractor header and self-include 2016-03-15 10:44:33 +01:00
Moritz Kobitzsch
4150c804df Improve the core search stopping criterion 2016-03-15 09:33:10 +01:00
Patrick Niklaus
0446847278 Merge pull request #2093 from arnekaiser/develop
Bugfix: set initial uturn indicators
2016-03-14 20:41:47 -04:00
akaiser
2cf8309987 Bugfix: set initial uturn indicators 2016-03-14 17:14:01 +01:00
Daniel J. Hofmann
5b30f92677 Adapts the test makefile clean target to remove monaco files.
See: https://github.com/Project-OSRM/osrm-backend/pull/2086#commitcomment-16639848
2016-03-11 12:06:34 +01:00
Patrick Niklaus
88fac0ad2b Use language: generic to use the minimal image
Since we are pulling all dependencies from PPA this just gives use the
advantage of faster boot up times.
2016-03-11 06:34:17 +01:00
Patrick Niklaus
45a9a6c4df Switch example to monaco 2016-03-11 05:58:42 +01:00
Daniel J. Hofmann
af554e7ed0 Provide uninstall target, closes #1972 2016-03-10 21:25:27 +01:00
Patrick Niklaus
8912928581 Disable alternatives by defaul fixes #2072 2016-03-10 21:01:30 +01:00
Daniel J. Hofmann
c2e49bd152 Do not install already installed deps. on OSX TraviS build, this should be made future proof 2016-03-10 20:27:46 +01:00
Daniel J. Hofmann
ac0279aa83 RAII for auto-closing file streams
Small fixes I didn't want to include in unrelated PRs.

There are a few left in `storage.cpp` but since it's a single function
in 600 lines of code, I didn't want to touch the mess. The others are
safe to remove, cucumber and test run on Finland gives 👍.
2016-03-09 17:46:02 +01:00
Patrick Niklaus
ae4161b780 Fix extraction in case of ways referencing invalid node ids 2016-03-08 20:59:11 +01:00
Patrick Niklaus
adc3bacea9 Add pruning based on @MoKob's idea in #1921 2016-03-08 00:43:45 +01:00
Patrick Niklaus
e125f3a897 Add core factor tests 2016-03-07 21:44:32 +01:00
Patrick Niklaus
f86b5a44bc Adapt shortest_path and viaroute to core search 2016-03-07 21:26:12 +01:00
Daniel J. Hofmann
0c5899b2a2 Disable ccache on Travis until we can cache the ccache cache directory, fixes #2057 2016-03-07 12:39:32 +01:00
Daniel J. Hofmann
a7d83b701f Provides a CMake variable to disable ccache usage 2016-03-07 12:37:16 +01:00
Daniel J. Hofmann
d0b591307a We're already on v4.9.1, update CMakeLists, closes #2060 2016-03-07 12:25:54 +01:00
Daniel Patterson
13378a4b55 Only attempt to return PBF if the call to the tile plugin actually returned PBF data. This may occur if bad parameters are passed (e.g. zoom level is < 12)) 2016-03-04 17:49:20 -08:00
Patrick Niklaus
ac6218eef2 Simplify EBGF code 2016-03-04 16:37:25 +01:00
Patrick Niklaus
a98cc51ac2 Fix up some PR comments 2016-03-04 16:13:30 +01:00
Patrick Niklaus
92a06c9a28 Renamed prepared -> contracted 2016-03-04 16:12:10 +01:00
Daniel Patterson
e595bdb20a More cleanup. 2016-03-03 19:28:48 -08:00
Daniel Patterson
9bd2446901 Cleanup. 2016-03-03 19:27:36 -08:00
Daniel Patterson
27babfec3d Add the uncompressible edges to the compressed edge container during the graph compressor run, rather than in the EdgeBasedGraphFactory. This keeps the logic a lot simpler to follow, although it's not quite as fast. 2016-03-03 18:48:39 -08:00
Daniel Patterson
017ff53702 Code review updates. 2016-03-03 13:25:01 -08:00
Daniel Patterson
49441fe204 Make forward/reverse weight/offset calculated at query time,
rather than being cached in the StaticRTree.  This means we
can freely apply traffic data and not have stale values lying
around.  It reduces the size of the RTree on disk, at the expense
of some additional data in RAM.
2016-03-03 10:49:12 -08:00
Daniel Patterson
03d360b7bf Enable color output when compiling with clang - makes errors a bit easier to spot. 2016-03-02 18:00:31 -08:00
Daniel Patterson
53542abbb7 Disable compression across traffic lights. Previously, we merged the traffic light penalty into the edge weight. When later considering traffic data, we need to be able to update just the edge weight, and it was impossible to extricate the traffic penalty. This increases the number of edge-based-nodes a little bit, but some quick tests show it should only be about 0.1% overall (only affects traffic signals on edges with no intersections (i.e. degree=2)) 2016-03-02 18:00:31 -08:00
Daniel Patterson
fc908d4687 Fix naming of variable so it's a lot less confusing. 2016-03-02 18:00:31 -08:00
Daniel J. Hofmann
e90b1bbead Allow no sources and no destinations for full table query 2016-03-03 02:00:39 +01:00
Daniel J. Hofmann
ce1ca1b625 Fixes critical error in table plugin accessing uninitialized memory
Although we check for valid coordinates in the table plugin via
`check_all_coordinates`, we do not check for #srcs > 0 and #dsts > 0.

This would be fine as the grammar parser combines adding coordinates and
setting their `is_source` and `is_destination` property, which makes
adding coordinates without specifying source or destination impossible.

See: route_parameters.cpp, AddSource, AddDestination, and api_grammar.hpp

In contract, the Polyline codepath does not do this! In fact, it only lets
you set coordinates, but not their `is_source` or `is_destination` property.

See: route_parameters.cpp, SetCoordinatesFromGeometry

Therefore, the following queries only set coordinates:

    http 'http://localhost:5000/table?locs=s_hhFg{arEgEfEgEfEgEfEgEfEgEfEgEfEgEfEgEfEgEfE'
    http 'http://localhost:5000/table?locs=_p~iF~ps|U_ulLnnqC_mqNvxq`@'

but fail to specify sources and targets!

The distance table plugin now assumes `is_course` and `is_destination`
is the same size as `coordinates`.

And happily accesses uninitialized memory.
2016-03-03 02:00:39 +01:00
Patrick Niklaus
0eaa393065 Limit tile zoomlevel to 12+ 2016-03-02 19:59:49 +01:00
Daniel Patterson
6d749777fc Using bind<T> in this case causes ambiguity with GCC 5.2.1 (see http://www.boost.org/doc/libs/develop/libs/bind/doc/html/bind.html#bind.faq.Q_forms). Remove template and let the type be deduced automatically. 2016-03-02 09:54:08 -08:00
Patrick Niklaus
6c20a4a874 Merge pull request #2040 from davidlowjw/develop
Minor typo fix
2016-03-02 16:40:38 +01:00
David Low
79e8d1aac3 Minor typo fix 2016-03-02 15:16:28 +08:00
Daniel J. Hofmann
becae46296 Enable decltype-based result_of type alias 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
2ce553d661 Math functions are not constexpr since they have side-effects (setting errno) :( 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
66cadac6b6 Explicitly std:: prefix fixed integral types in static rtree header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
c237c5353b Explicitly std:: prefix fixed integral types in rectangle header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
c27a7e087f Fixes rectangle header includes 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
0894590a96 Fixes default declared ctor in Buffer 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
2efef91f1c Fixes const correctnes and explicit types in tile header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
3feba9a581 Fixes Undefined Behavior in tile header from ODR-violation 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
afae896d05 Makes compile time constants properly ROM-able and deduplicates them across TUs 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
bcbaa21739 Fixes tile header includes 2016-03-01 23:51:25 +01:00
Daniel J. Hofmann
d60bc61d13 Properly constructs objects of type const RectangleInt2D in facades 2016-03-01 23:51:25 +01:00
Daniel J. Hofmann
aeee565115 Formats all the files we touch.. 2016-03-01 23:51:25 +01:00
Daniel Patterson
8126793b18 Don't need to actually create a vector, we just write out all speeds from 0-127 2016-03-01 23:51:25 +01:00
Daniel Patterson
6a2592421c Optimize encoding of speed values. Only store 0-127, so we can efficiently pack into a byte. Speed and is_tiny values are now shared, so tiles should be much smaller. 2016-03-01 23:51:25 +01:00
Daniel Patterson
36adeec220 Remove unused tests. 2016-03-01 23:51:25 +01:00
Daniel Patterson
22bf0ead18 We don't need this header. 2016-03-01 23:51:25 +01:00
Daniel Patterson
b9dd6369d4 Remove draft tiler tool, we moved everything into 2016-03-01 23:51:25 +01:00
Daniel Patterson
3d6c0ac512 Remove some commented out code that's not used any more. 2016-03-01 23:51:25 +01:00
Daniel Patterson
95bf81f528 Add a bunch of comments. 2016-03-01 23:51:25 +01:00
Daniel Patterson
56e35e8ef2 Remove GeoJSON based debugging output, we can now generate vector tiles with roughly the same data on-the-fly. 2016-03-01 23:51:25 +01:00
Daniel Patterson
ae802a8a83 No need to send a back to the client, km/h are specific enough. 2016-03-01 23:51:25 +01:00
Daniel Patterson
ee71d2fe5f Don't need to static cast. 2016-03-01 23:51:25 +01:00
Daniel Patterson
8dd2447cc5 Don't round until necessary, this keeps coordinates in much better positions. 2016-03-01 23:51:25 +01:00
Daniel Patterson
3869ab6345 Use the correct type when pulling object from variant 2016-03-01 23:51:25 +01:00
Daniel Patterson
26453af1b9 Add a distinct Buffer type for encoding binary data in JSON responses. Treated like a string, but allows other consumers (a-la node-osrm) to recognize and not break string encodings. 2016-03-01 23:51:25 +01:00
Daniel Patterson
5dc7b79bb6 Implements a vector tileserver so you can see what's going on inside
OSRM.
2016-03-01 23:51:25 +01:00
Daniel J. Hofmann
33403efc8e Use XCode 7.3 on Travis 2016-03-01 23:50:43 +01:00
Patrick Niklaus
a0b4fcc05a Remove last bits of GPX support code 2016-03-01 23:44:07 +01:00
Patrick Niklaus
82f7ab2ba5 Merge pull request #2038 from Project-OSRM/update/osmium_2.6.1
Update/osmium 2.6.1
2016-03-01 14:37:11 -05:00
Patrick Niklaus
505833a534 Remove #line checks, it seems to be dependent on the boost version 2016-03-01 19:19:31 +01:00
Patrick Niklaus
8511256779 Squashed 'third_party/libosmium/' content from commit 2282c84
git-subtree-dir: third_party/libosmium
git-subtree-split: 2282c8450bae55839372a2002db7ca754530d2fc
2016-03-01 17:56:55 +01:00
Patrick Niklaus
2557fb4f4d Merge commit '8511256779228db8d2ffed7ccced2b53c70be248' as 'third_party/libosmium' 2016-03-01 17:56:55 +01:00
Patrick Niklaus
ae85d86d8f Remove libosmium 2016-03-01 17:54:39 +01:00
Daniel J. Hofmann
042740877c Update dependency script to libosmium 2.6.1 2016-03-01 17:10:20 +01:00
Daniel J. Hofmann
b787b993b6 Adapt contract cucumber tests to new argparser output 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
51ae14ec23 Extra ; 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
152f739527 Adapts test data Makefile to no longer pass parameters to osrm-contract 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
da88cb6a43 Extractor comments wrt. osrm-contract 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
52a8bb414c Fixes Rakefile wrt. osrm-contract 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
a27902205b Fixes spelling in changelog 2016-03-01 16:43:34 +01:00
Patrick Niklaus
7fb5b9886e Fix test data prepare 2016-03-01 16:43:34 +01:00
Patrick Niklaus
8feb300d15 Add changelog entry for breakage 2016-03-01 16:43:34 +01:00
Patrick Niklaus
085bab749f osrm-prepare -> osrm-contract 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
96a5e594b3 Removes profiles from osrm-prepare, only needed in osrm-extract. Fixes #1950. 2016-03-01 16:43:34 +01:00
Daniel J. Hofmann
04765d82ba Fixes undefined behavior via One-Definition-Rule violations
Heuristic

    find . -type f -name '*.hpp' |xargs ag -B 1 '^([^inline][a-zA-Z0-9_&\*::])+ (.*)\((.*)\)$'
2016-02-26 06:39:52 +01:00
Patrick Niklaus
47a9981571 Disabling style failing the tests for now 2016-02-25 01:08:23 +01:00
Daniel J. Hofmann
0b45678ccc Adapts Travis to run the formatter script checking for violations 2016-02-25 01:07:00 +01:00
Daniel J. Hofmann
19ac465fa4 Provides a script to clang-format the repository in parallel 2016-02-25 00:53:30 +01:00
Patrick Niklaus
69bc8a8b22 Fix unpacking for self-loop nodes not in core. Fixes #1999 2016-02-21 01:38:06 +01:00
Patrick Niklaus
d0644bace9 Merge pull request #1998 from mortada/develop
fixed minor typos
2016-02-19 17:39:28 -05:00
Mortada Mehyar
aae02cd1be fixed minor typos 2016-02-18 23:05:11 -05:00
Daniel J. Hofmann
47d56676f1 Don't bounds check by default in static rtree; fixes #1988 2016-02-17 18:20:27 -08:00
Dane Springmeyer
efbaaf2f84 Merge pull request #1994 from Project-OSRM/win-lock-types
include boost/thread/lock_types.hpp
2016-02-17 16:16:27 -08:00
bergwerkgis
d38575a011 include lock_types.hpp 2016-02-17 22:54:45 +01:00
Daniel J. Hofmann
908a9e9fa1 Reorders Travis builds by most likely failing one 2016-02-16 09:49:29 -08:00
Daniel J. Hofmann
0ebabfad73 Finish Travis build as soon as a single job failed.
Manually cancelling obviously failing builds is getting cumbersome.
Hopefully this will speed things up as a side effect.

References:
- https://docs.travis-ci.com/user/customizing-the-build/#Fast-Finishing
2016-02-16 09:49:29 -08:00
karenzshea
6ac3d902c9 update help output test 2016-02-16 18:43:06 +01:00
karenzshea
3beb8c825b cf 2016-02-16 18:43:06 +01:00
karenzshea
b80e96547e remove ini parsing 2016-02-16 18:43:06 +01:00
Moritz Kobitzsch
2679c1cf0a correct handling of travel modes 2016-02-16 01:35:04 +01:00
Daniel Patterson
65183e94c6 Use \n instead of std::endl to avoid unnecessary flushing. Cleanup some newlines to avoid blank lines in debug output. 2016-02-15 14:21:18 -08:00
Daniel Patterson
6b0fe683c9 Expose the base type. Going via the operator<< leaves us with invalid geojson. 2016-02-15 13:25:55 -08:00
Moritz Kobitzsch
f14352f494 modify turn angles and instructions 2016-02-15 20:13:55 +01:00
Moritz Kobitzsch
ab9426e260 fix routing when requiring loop at a core node 2016-02-15 18:26:39 +01:00
Daniel J. Hofmann
27fe85ac8b Dividable-by-three instead of next-dividable-by-three 2016-02-12 18:10:44 -08:00
Daniel J. Hofmann
eb6f01e65a Rip out obsolete floating point header 2016-02-12 16:30:01 -08:00
Daniel J. Hofmann
a6d406d2c3 Fix headers for JSON abstractions 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
4b8c0ac143 Revert "Folds json_* utilities into json subfolder and adapts includes"
This reverts commit cd039c69c0a92a35889e3c875b8eb53cf07377bb.
2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
c9f0158fdb Ifdef is_trivially_copyable<T> behind gcc >= 5 guard 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
aac21f932b Refactors Base64 encoding and decoding, it's almost beautiful now 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
ec01c2a119 Folds json_* utilities into json subfolder and adapts includes 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
fbef77a942 Documents why not to use boost::irange in favor of our hand-written irange 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
f207d988f4 Removes floating point epsilon comparator 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
60fc486cea Prefix exception header guard with osrm prefix 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
978b70c998 Adds a comment as to why the char to typed enum class transformation is not possible 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
ef171f3acd Properly use typed math constants instead of impl. specific hacks
PI is not in the stdlib, neither is 1/pi, pi*2 and so on. Instead
of relying on implementations providing these, use properly typed
math constants.

Main benefits:
- portable and
- returns constexpr, for compile-time computation

References:
- http://www.boost.org/doc/libs/1_60_0/libs/math/doc/html/math_toolkit/constants_intro.html
- http://www.boost.org/doc/libs/1_60_0/libs/math/doc/html/math_toolkit/constants.html
2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
64b36807d3 Transforms osrm_exception to exception 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
5de8f1803c Folds mercator projections into coordinate_calculation 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
d1c4a26791 Remove .restriction reference 2016-02-11 19:19:28 -08:00
karenzshea
a647cb9836 kick 2016-02-11 17:36:49 -05:00
karenzshea
7398bed974 Include real coordinates in debug geojson mode 2016-02-11 17:09:20 -05:00
Patrick Niklaus
6077708831 Merge pull request #1964 from Project-OSRM/libosmium-2.6.0
Update libosmium to v2.6.0
2016-02-10 20:51:34 -05:00
Dane Springmeyer
6eebb1c089 Support passing OSRM_SHARED_LIBRARY_PATH env variable for cucumber tests
The need for this is that:

  - On OS X if libraries are stored in custom locations (not /usr/lib or /usr/local)
    and they do not embed an rpath (which is common to not have) then the developer
    needs to set DYLD_LIBRARY_PATH to ensure that osrm tools can find dependent libraries
    at runtime (this is normal and common).
  - But as of OS X > 10.11 DYLD_LIBRARY_PATH no longer is inherited. While it works in
    the main shell when running a command like `osrm-extract` you will find that when
    `osrm-extract` is run by cucumber (ruby child process) then DYLD_LIBRARY_PATH
    is blocked and the command cannot start.
  - So, this introduces the ability to pass in a variable that the cucumber tests will
    understand and can manually forward along to ensure that DYLD_LIBRARY_PATH is respected
    where it counts.

The intended usage of this is therefore:

    # set the environment variable
    export OSRM_SHARED_LIBRARY_PATH=${DYLD_LIBRARY_PATH}
    # then run cucumber tests
    cucumber -p verify
2016-02-11 02:43:51 +01:00
Daniel J. Hofmann
6cd55e535c Removes potentially dangerous and misleading lat, lon subscript oeprator 2016-02-11 02:37:33 +01:00
Dane Springmeyer
7d0955c0f4 Merge pull request #1960 from Project-OSRM/cucumber-exit-early
Ensure key command line programs can be run before running cucumber tests
2016-02-10 16:03:17 -08:00
Dane Springmeyer
8c9d24bd9f Merge pull request #1962 from Project-OSRM/no-static-visitor
Remove uneeded and deprecated usage of mapbox::util::static_visitor
2016-02-10 16:02:56 -08:00
Dane Springmeyer
c40375a424 update libosmium to v2.6.0 2016-02-10 13:41:22 -08:00
Dane Springmeyer
2949a52a11 remove uneeded and deprecated usage of mapbox::util::static_visitor 2016-02-10 12:58:36 -08:00
Dane Springmeyer
2e762d05f9 Ensure key command line programs can be run before running cucumber tests
- Otherwise, currently, if osrm-extract crashes at startup then
    the tests continue on and will crash many many times.
  - This also tests that --help returns an exit code of zero and will
    catch if this behavior ever changes or is inconsistent between
    the command line programs
2016-02-09 17:49:47 -08:00
Daniel J. Hofmann
bb06bfbbd7 Same undefined behavior from shifting into the sign bit in Storage 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
b8d20dfe99 Prevent undefined behavior from left shifting into sign bit when offset is 31 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
fa8529949b Make swap noexcept (as it has to be!) and fix swap misuses 2016-02-08 11:47:44 -08:00
Daniel J. Hofmann
7b37c847bd Fixes shared memory wrapper includes 2016-02-08 11:47:02 -08:00
Daniel J. Hofmann
3075f6cea7 No need for deferred, non-blocking or timeout acquisition 2016-02-08 11:26:40 -08:00
Daniel J. Hofmann
ff966490bb Fixes datafacade includes 2016-02-08 11:26:40 -08:00
Patrick Niklaus
46993b43fe Merge pull request #1954 from sebastic/edges-typo
Fix 'egdes' typo, replace with 'edges'.
2016-02-06 22:01:16 -05:00
Bas Couwenberg
5e15bceaae Fix 'egdes' typo, replace with 'edges'. 2016-02-07 02:59:44 +01:00
Patrick Niklaus
fefe5e241a Merge pull request #1946 from kerrick-lyft/develop
Add operator<< to OSRM_STRONG_TYPEDEF
2016-02-01 16:30:43 -05:00
Kerrick Staley
8804330d83 Add operator<< to OSRM_STRONG_TYPEDEF
Useful for debugging.
2016-02-01 12:32:30 -08:00
karenzshea
f5c12ec433 comments 2016-01-29 23:49:09 +01:00
karenzshea
262cdd7bc0 move tribool obj into request_parser 2016-01-29 23:49:09 +01:00
Patrick Niklaus
efee07e20b Move arrays don't copy 2016-01-29 15:58:48 +01:00
Moritz Kobitzsch
603b83e1c3 Fixes Alternative Routing when including loops 2016-01-28 16:33:07 +01:00
Daniel J. Hofmann
a48f02e0da Takes care of proper special member generation globally, fixes #1689
Phew, a lot of classes were affected by this. The rationale for the
changes are as follows:

- When a type X declares any constructor, the default constructor is
  not declared, so there is no need for X() = delete there. In fact,
  there is brutal difference between those two: deleted members
  participate in overload resolution, but not-declared members do not!

- When a type X wants to be non-copyable (e.g. to be only movable, like
  threads, unique_ptrs, and so on), you can either do it by inheriting
  from boost::noncopyable (the old way), or better declare both (!) the
  copy constructor _and_ the copy assignment operator as deleted:

      X(X const&) = delete;
      X& operator=(X const&) = delete;

  We had tons of types with deleted copy constructors that were lacking
  a corresponding deleted copy assignment operator, making them still
  copyable and you wouldn't even notice (read: scary)!

References:

- http://accu.org/content/conf2014/Howard_Hinnant_Accu_2014.pdf
- http://www.boost.org/doc/libs/master/libs/core/doc/html/core/noncopyable.html

Note: I know, I'm quoting Hinnant's extraordinary slides a lot, but
getting the sematic right here is so incredibly important.
2016-01-27 17:25:30 +01:00
Daniel J. Hofmann
d189339495 Makes the extractor no longer depend on the crc32 computation 2016-01-27 17:18:04 +01:00
Patrick Niklaus
0802804677 Fix PR comments 2016-01-26 22:57:02 +01:00
Patrick Niklaus
d9c281cd7c Remove boost fusion dependency in RouteParameters 2016-01-26 22:57:02 +01:00
Patrick Niklaus
46185fe9e8 Ptr -> auto 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
38e8a90f4e Make HilbertCode a free standing function 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
7a115e93c0 Removes check-hsgr 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
d391df52ba Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
46fc6f8da4 Collapse computeAngle into coordinate calculation 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
0fcca04150 TU-local STXXL comparator for OSMNodeIDs, needs {min,max}_value
Can not use std::less<>{} because of this.
2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
54a9173107 Make public RouteParameters header no longer depend on Spirit
And includes the optional header that was transitively included by the
spirit header before. Hopefully this will speed up compile times, as the
RouteParameters header is used in a lot of translation units.
2016-01-26 22:57:02 +01:00
Patrick Niklaus
bf455c8d20 Fix empty parameter list 2016-01-26 22:56:19 +01:00
Patrick Niklaus
c05d23a586 Fix POST request 2016-01-26 22:56:19 +01:00
Freenerd
2a882aa58d Tests: Preserve param order on POST 2016-01-26 22:56:19 +01:00
Daniel J. Hofmann
04e26ba6b8 Adds missing cstdlib header for std::llabs 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2211731c80 Alternative test depends on random order, make less random-ish 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
0fbdd57835 Quickfixes polyline encoder's undefined behavior via left-shifting negative numbers 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
312b414d8f Adapts XORFastHashStorage to XORFastHash compile time limits 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
a6e7954128 Make XORFastHash's number of hashable elements compile time constant
Still constraint by the usage of uint32_t and subsequent splitting into
two uint16_t we use for indexing into the tables.
2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
1417d43430 Cut down memory usage for tables in XORFastHash by factor of four
`pow(2, 16)` is not `2 << 16` but rather `1 << 16`.

With this change we cut memory usage in half for the XORFastHash's two
tables. Adapts XORFastHashStorage, memory usage reduction by factor two.
2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
60ef6070b0 Simplify uint32_t splitting in XORFastHash 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2f42196fca Explicitely type XORFastHash 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
f8b5e7e2c9 Removes XORMiniHash, unused 2016-01-26 17:54:08 +01:00
Daniel J. Hofmann
2c0547bb0e Make XORFastHash great again 2016-01-26 17:54:08 +01:00
Patrick Niklaus
0f9eec887f Only run script on linux 2016-01-26 07:01:11 +01:00
Patrick Niklaus
234cf2d847 Move taginfo check 2016-01-26 07:01:11 +01:00
Patrick Niklaus
9304ad125c Fix python2 2016-01-26 07:01:11 +01:00
Patrick Niklaus
752c15c230 Add taginfo checker script and update taginfo 2016-01-26 07:01:11 +01:00
Patrick Niklaus
4f792c40b7 Merge pull request #1928 from mortada/max_locations_map_matching
make it possible to disable max_locations in map_matching
2016-01-25 22:31:55 -05:00
Patrick Niklaus
0245184c18 Merge pull request #1930 from mortada/gps_precision
improve comments for gps_precision
2016-01-25 22:31:09 -05:00
Patrick Niklaus
7ddf0226c6 Merge pull request #1929 from zimathias/fix-keepalive-non-support
Send the Connection: close response header
2016-01-25 19:17:47 -05:00
Mortada Mehyar
17c3c1d66a improve comments for gps_precision 2016-01-25 15:17:44 -08:00
Mathias Gug
40a3008318 Send the Connection: close response header
so that proxy server don't try to reuse the connection. Given that
osrm-routed does *not* support keepalive the Connection: close response
header should be set.
2016-01-25 15:03:37 -08:00
Mortada Mehyar
b48022be22 make it possible to disable max_locations in map_matching 2016-01-25 14:53:44 -08:00
Daniel J. Hofmann
502aedb33e Provide a way to selectively enable assertions in release mode
- Throwing an assertion exception for proper stack unwinding, making
  sure destructors are called

- On in Debug mode, in Release, enable via:

      cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_ASSERTIONS=ON

Current problem that I'm seeing is that some code is not catching
exceptions or worse silently swallowing them. Would like to check the
whole pipeline before merging this in.
2016-01-21 15:37:25 +01:00
Patrick Niklaus
17f8e65808 Fail hard if node weights are not there 2016-01-21 06:47:34 +01:00
Patrick Niklaus
439eb9da3d Create public facing libraries for extractor, contractor and datastore
New libraries libosrm_extract, libosrm_contract, libosrm_store
2016-01-21 06:47:34 +01:00
Patrick Niklaus
f6116db957 Merge pull request #1902 from Project-OSRM/4.9.1
Bug fix release 4.9.1
2016-01-19 19:00:11 -05:00
karenzshea
b36145e3c4 add target test 2016-01-19 23:38:13 +01:00
Moritz Kobitzsch
1c1bfd7541 Fix routing when start and target are on the same segment
Fixes issue #1864. Given the simple set-up:

a --> b --> c
^-----------|

This would translate into an edge based graph (ab) -> (bc),
(bc) -> (ca), (ca) -> (ab).

Starting at the end of the one-way street (ab) and going to
the beginning, the query has to find a self-loop within the
graph (ab) -> (bc) -> (ca) -> (ab), as both nodes map to the
same segment (ab).
2016-01-19 23:26:19 +01:00
Patrick Niklaus
c824429458 Include the travel mode in the last instruction by copying it from the previous instruction. 2016-01-19 23:23:32 +01:00
Daniel Patterson
238e77d959 Include the travel mode in the last instruction by copying it from the previous instruction. 2016-01-19 21:28:56 +01:00
Daniel Patterson
23b2154d98 Adds a shared/exclusive lock around queries and CheckAndReloadFacade.
Without this, it's possible for CheckAndReloadFacade to start working
while a query is still in progress, leading to undefined behaviour.
2016-01-19 21:26:30 +01:00
Daniel J. Hofmann
25c8711aad Fix shared memory non-copyable properties 2016-01-19 20:31:14 +01:00
Daniel Patterson
cf30628d4e DataFacade should only remove shared segments if they're actually different from the last time they were checked. 2016-01-19 20:31:03 +01:00
Daniel Patterson
e21eaa4b9e Adds a shared/exclusive lock around queries and CheckAndReloadFacade.
Without this, it's possible for CheckAndReloadFacade to start working
while a query is still in progress, leading to undefined behaviour.
2016-01-19 17:44:29 +01:00
Daniel J. Hofmann
80b897d8cf Fix shared memory non-copyable properties 2016-01-19 17:44:07 +01:00
Daniel Patterson
1ed7bcfb2c DataFacade should only remove shared segments if they're actually different from the last time they were checked. 2016-01-19 17:44:07 +01:00
Daniel J. Hofmann
e20f92bbbb Anonymous namespaces in header files are bad
They duplicate the code across translation units.
2016-01-19 17:42:49 +01:00
Daniel J. Hofmann
6e717bfd30 Switch to const constexpr for header constants (3.5/3 internal linkage) 2016-01-19 17:42:49 +01:00
Daniel J. Hofmann
5d743bb0a3 Switch to explicit find in tidy script 2016-01-19 17:42:49 +01:00
Patrick Niklaus
7675c730b6 Fix wrong assertion and emplace_back bug in trip plugin 2016-01-19 17:38:02 +01:00
Patrick Niklaus
42942bb1e0 Add regression test 2016-01-19 17:36:29 +01:00
Patrick Niklaus
9d12de9bce Fix wrong assertion and emplace_back bug in trip plugin 2016-01-19 17:36:29 +01:00
Patrick Niklaus
790520e335 Enable AppVeyor only for master/develop and PRs 2016-01-18 21:23:13 +01:00
Daniel J. Hofmann
4b0e1a4b19 Run modernizer 2016-01-18 16:54:30 +01:00
Daniel J. Hofmann
a877f8abf0 Switch to explicit find in modernize script 2016-01-18 16:54:13 +01:00
Daniel J. Hofmann
491b1d9c96 Remove headers with no reverse dependencies
Found with

```
daniel@x1c /t/o/i/util> for header in *.hpp
                            echo -n $header:
                            ag -iQ $header ../../ --noheading | wc -l
                        end
...
fixed_point_number.hpp:0
range_algorithms.hpp:0
...
```

Only two. Surprises me to be honest.
But we're cleaning up for quite a bit now.
2016-01-18 16:05:39 +01:00
Patrick Niklaus
2ce74c05e1 Use a sane gps_precision multipler 2016-01-15 22:15:05 +01:00
Patrick Niklaus
88e6558da3 Fix handling unexpected errors. 2016-01-15 22:08:04 +01:00
Patrick Niklaus
f1140ec903 Fix uturns at dead-end streets 2016-01-15 21:48:14 +01:00
Moritz Kobitzsch
8a745ecdfd fixed u-turn testcase to actually emit u-turn instruction 2016-01-15 19:56:39 +01:00
Moritz Kobitzsch
b8e29f5ae3 Add a u-turn instruciton when performing a u-turn at a via-node 2016-01-15 19:56:39 +01:00
Patrick Niklaus
22e83013e3 Fix uturns at dead-end streets 2016-01-15 16:24:21 +01:00
Patrick Niklaus
cc4713d878 Add regression test for uturn before barrier 2016-01-15 00:56:31 +01:00
Patrick Niklaus
490e838c60 Add regression test for Disney Land bug 2016-01-15 00:39:49 +01:00
Patrick Niklaus
6b15f29d7c Fix handling unexpected errors. 2016-01-14 18:27:36 +01:00
Daniel J. Hofmann
e7d9e42a16 Fix race condition in osrm-routed HTTP server
We had a similar issue a few month ago. Stumbled upon this by accident.

It goes like this:

- `output_buffer` is function-local
- we pass it to async_write and leave the scope
- `output_buffers` goes out of scope
- bad things happen, sometimes

The fix is to, again, put it inside the connection that handles itself
via the enable_shared_from_this idiom.

References:

- http://www.boost.org/doc/libs/1_59_0/doc/html/boost_asio/reference/async_write/overload1.html
- https://github.com/Project-OSRM/osrm-backend/pull/1690
2016-01-13 23:21:45 +01:00
Patrick Niklaus
bd91727f49 Merge pull request #1890 from zimathias/fix-debian-package-upgrades
Fix debian package upgrades.
2016-01-13 23:19:20 +01:00
Mathias Gug
328faf3744 Fix debian package upgrades.
The postinst script fails on package upgrade given that the symlink
already exists.

Note that symlinks should *not* be handled in a postinst scripts.
Instead dh_links should be used so that symlinks are compliant with the
Debian policy.
2016-01-13 11:53:59 -08:00
Patrick Niklaus
1157cb9b95 Remove obsolete protobuf test 2016-01-13 17:57:22 +01:00
Daniel J. Hofmann
7c8626d144 No longer install osmosis in docker env 2016-01-13 17:57:22 +01:00
Daniel J. Hofmann
03faf2665b No longer install osmosis on travis 2016-01-13 17:57:22 +01:00
Daniel J. Hofmann
9959fd26bb Do not convert osm xml files to pbf for the cucumber tests 2016-01-13 17:57:22 +01:00
Daniel J. Hofmann
43dcdb21ec Revert "Build osmium_convert in order to be able to eventually replace osmosis"
This reverts commit 344588114dd5076385b35e0fbaef966de681f95f.
2016-01-13 17:57:22 +01:00
Daniel J. Hofmann
3727637145 Build osmium_convert in order to be able to eventually replace osmosis
This provides a script to build the libosmium examples such as
osmium_convert (to convert from xml to pbf).

I initially tried a CMake ExternalProject setup, but this was more
complicated than I initially thought; this is the more elegant solution.

The goal is to eventually rip out osmosis, so that we no longer depend
on java for the cucumber tests.

References:

- https://github.com/Project-OSRM/osrm-backend/issues/1788
2016-01-13 17:57:22 +01:00
Daniel J. Hofmann
466251287f Define compile-time constants for coordinate calculation only once
Closes #1327.
2016-01-12 19:59:02 +01:00
Daniel J. Hofmann
f46706843b STXXL's debug build creates stxxl_debug.{a,so}, adapts FindSTXXL
References:

- https://github.com/Project-OSRM/osrm-backend/issues/1885
2016-01-12 13:40:36 +01:00
Daniel J. Hofmann
c93ca02fb8 Rips out dead code from the container.hpp and creates for_each_pai.hpp
I added two TODOs that I would like to address in the future.
2016-01-11 20:14:35 +01:00
Daniel J. Hofmann
4813488f84 Split import_edge.hpp: node_based_edge.hpp, edge_based_edge.hpp closes #1604 2016-01-11 20:11:44 +01:00
Daniel J. Hofmann
fc292cc2d8 No need for extra translation units (for edge data structures) 2016-01-11 20:11:44 +01:00
Daniel J. Hofmann
f875e26fbf Inline mercator transformations; no need for separate translation unit 2016-01-11 20:10:45 +01:00
Patrick Niklaus
05658aeb3b Ignore .swp file 2016-01-11 20:06:12 +01:00
Patrick Niklaus
a14cb1fc06 Merge pull request #1818 from gardster/side_road_tag_support
A side_road tag support for the OSRM car profile.
2016-01-11 17:10:42 +01:00
Daniel J. Hofmann
f68247673a Make ComputeAngle a free standing function 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
f65dd63210 Make TurnInstructionsClass functions free standing functions 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
03f64a6c20 Make RouteNameExtraction a free standing function 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
0627c3443d Make PolylineFormatter's encodedAsJSON and unencodedAsJSON free standing functions 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
c65dd16460 Make PolylineCompresser's encode and decode free standing functions 2016-01-09 19:55:22 +01:00
Daniel J. Hofmann
c590596dbe Make DouglasPeucker a free standing function 2016-01-09 19:55:21 +01:00
Patrick Niklaus
23cd4d5ed2 not -> ! 2016-01-09 19:42:31 +01:00
Moritz Kobitzsch
4dc6ff9fb8 and another missed not 2016-01-09 19:42:31 +01:00
Moritz Kobitzsch
8638cbf8b2 missed a not 2016-01-09 19:42:31 +01:00
Moritz Kobitzsch
a2555983e6 replaces and/not with &&/! for windows 2016-01-09 19:42:31 +01:00
Daniel J. Hofmann
21804aecdb Prefer inline over static inline for free standing functions
When you mark free standing functions as `static inline` instead
of just `inline` they can not get merged across TUs and therefore
produce code bloat which is bad for the binaries size, the CPUs
instruction cache, and so on.

Please also see the discussion at:

- https://groups.google.com/forum/#!topic/mozilla.dev.platform/Ulw9HoZbSyQ
- http://stackoverflow.com/a/12836392

Note that non-fully specialized templates (i.e. with a kind of at
least `Template :: * -> *`) are `inline` by default.
2016-01-08 23:33:31 +01:00
Patrick Niklaus
6991a38703 Run clang-format 2016-01-08 01:31:57 +01:00
Patrick Niklaus
6b18e4f7e9 Add namespace around all files 2016-01-08 01:30:52 +01:00
Patrick Niklaus
efc9007cbf Remore start_phantom/target_phantom because they are useless here 2016-01-07 22:51:37 +01:00
Moritz Kobitzsch
efd33b295a Refactor guidance generation 2016-01-07 22:51:24 +01:00
Patrick Niklaus
fa4ba42f15 Use a sane gps_precision multipler 2016-01-07 16:30:54 +01:00
Daniel J. Hofmann
d3ef520915 Print message about ccache usage from cmake 2016-01-07 15:20:32 +01:00
Patrick Niklaus
811e29ff1b Add cmath to geospatial_query 2016-01-07 11:35:35 +01:00
Daniel Patterson
95d1efb7f8 Disable via test that fails on OSX so that we can test everything else on Travis on OSX. 2016-01-06 14:42:31 -08:00
Daniel J. Hofmann
5341cb5ff9 Merge branch 'use_libosmium_2_5_4' into develop 2016-01-06 15:08:10 +01:00
Daniel J. Hofmann
cb37c0d135 Use FindOsmium.cmake to handle libosmium's buildsystem integration 2016-01-06 12:32:19 +01:00
Patrick Niklaus
73d40ce02a Merge pull request #1858 from zimathias/fix-debian-cpack-config
Use OSRM versions for Debian package version.
2016-01-05 22:08:50 +01:00
Mathias Gug
c1709da6bf Fix typo. 2016-01-05 14:25:14 -05:00
Mathias Gug
dcfa81f983 Add debian revision. 2016-01-05 14:15:55 -05:00
Mathias Gug
42b1eaa240 Use OSRM versions for Debian package version. 2016-01-05 11:44:24 -05:00
Patrick Niklaus
1da1fa5a31 Fix naming in PhantomNode 2016-01-05 12:41:16 +01:00
Patrick Niklaus
707931125e Remove unnecceary pre-define 2016-01-05 12:06:34 +01:00
Patrick Niklaus
f4e82a879b Fix naming in static_rtree benchmark 2016-01-05 12:06:34 +01:00
Patrick Niklaus
4f7369ed02 Fix naming in FixedPointCoordinate 2016-01-05 12:06:34 +01:00
Patrick Niklaus
4312013552 Fix naming in coordinate_calculation 2016-01-05 12:06:34 +01:00
Patrick Niklaus
e8bc69aa01 Fix naming in springclean 2016-01-05 12:06:33 +01:00
Patrick Niklaus
befb667759 Fix naming of routed 2016-01-05 12:06:33 +01:00
Patrick Niklaus
b35254ec78 Fix naming in io-benchmark 2016-01-05 12:06:33 +01:00
Patrick Niklaus
9956988938 Fix naming in datstore 2016-01-05 12:06:33 +01:00
Patrick Niklaus
5b0e2e487a Fix naming in components tool 2016-01-05 12:06:33 +01:00
Patrick Niklaus
ccd3872bf1 Fix naming in ScriptingEnvironment 2016-01-05 12:06:33 +01:00
Patrick Niklaus
b209952ce0 Fix naming of methodes for RouteParameters 2016-01-05 12:06:33 +01:00
Patrick Niklaus
3568de2c6c Fix missing include 2016-01-05 12:06:33 +01:00
Patrick Niklaus
a8957d75b9 Add simple cncc file 2016-01-05 12:06:33 +01:00
Patrick Niklaus
028ca5c9d9 Apply clang-format 2016-01-05 12:04:04 +01:00
Daniel J. Hofmann
d516e1c736 Update in-tree libosmium dependency to 2.5.4
The latest releases have some critical fixes, see the changelog:
https://github.com/osmcode/libosmium/blob/v2.5.4/CHANGELOG.md

Merge commit 'afdf8e7b21fbaf597e91d9d8a7542635e60ee9a1' into use_libosmium_2_5_4
2016-01-05 12:01:06 +01:00
Daniel J. Hofmann
afdf8e7b21 Squashed 'third_party/libosmium/' changes from c43f8db..0ff2780
0ff2780 Release v2.5.4
3f1583a Remove workaround for MSVC missing constexpr support.
2a6c80b Rewrite expressions to avoid warnings on MSVC.
9b0602a Make two functions non-constexpr that can't be.
ca1e501 Make NodeRef constructor, accessors and comparison ops constexpr.
fb48312 Disable some problematic clang_tidy checks.
d2d2812 Only do clang_tidy checks on files that are configured to be built.
5af55bb Always use braces after while() and if().
aebb6e3 No else after return.
65a3bf6 Better clang-tidy config.
3a965fa Add typedef Buffer::value_type needed when using std::back_inserter.
c20ac26 Add lots of explicits to constructors.
1d12e09 Add clang-tidy make target.
052b1ee Add benchmark programs to files checked with cppcheck.
9ccbb49 Use only "final", not "override final".
0b9df1f User 'override' instead of 'virtual' in overridden functions.
1d0c1c6 Remove unnecessary get() call.
705391b Use consistent namespace closing comment.
25c1f38 Only use "final" on overridden methods, not "override".
8da2553 Setting CMAKE_EXPORT_COMPILE_COMMANDS works only after project() command.
5fec437 Use newest protozero library (v1.2.3).
a3d759b Overloaded version of add_tag() with std::pair of strings.
1b4bcf9 Add function to add tag to tag list from existing tag.
7087e62 Update gdalcpp.hpp header to v1.1.1.
0008e8c Update change log.
39fe3a5 Add conversion and comparison operators to Timestamp.
e6643a7 Update gdalcpp.
650280f Bugfix: Improved segment intersection function.
1b20597 Make operator bool explicit for (Typed)MemoryMapping.
b580b25 Merge pull request #136 from tomhughes/ruby
a7c6737 The multipolygon test only needs the ruby interpreter
4a0a9e7 Make conversion from Buffer to bool noexcept.
7cdabbe Set thread name in o5m input format.
6a17a8d Break out computation of thread pool size into function and test it.
1950853 Allow initializing a Timestamp from any integral type.
4103198 Fix link in change log.
dc2ed89 Release v2.5.3
a2816b7 Fix end_of_time() Timestamp, add constructor taking std::string&.
3f5eb8e Updated changelog.
9b75c14 Cleanup and better docs for DiffObject and related classes.
d0beead Better documentation for NodeRef and NodeRefList classes.
0192292 Cleanup/doc/test osmium::util::Options.
b3db055 Use header with forward declarations.
8b3fe16 Improved documentation.
cd2ce38 Remove unused typedef Buffer::value_type.
87c9b32 Cleanup and test Buffer::add_buffer() function.
e519278 Improved documentation for osmium::memory::Buffer.
d721d43 Deprecate set_full_callback(). Better doc for deprecated functions.
58b5fd1 Remove DataFile class which was never used anywhere.
30b806e Simplify some tests.
62958df Update change log.
a8a2e68 Merge pull request #134 from zerebubuth/buffer-size-checks
987faab Move some code belonging into there into relations::Collector.
da31175 When the buffer isn't big enough, even when empty, to reserve the space that's being requested then it shouldn't reserve it anyway.
5d2f949 Swap the growth flag and any "full" callback as well as all the other members when swapping this buffer object.
1845aa9 The assertions prior to dereference are more strict than the conversion to bool. However, conversion to bool is often used as a predicate for whether dereference is okay, so the behaviour is easier to understand if they match.
abdfee1 Remove unused m_want_types in relations collector.
95b387f "Officially" mark two constructors as deprecated.
1d0da5f Release v2.5.2
31c3eaf Copy iterator around less often.
83c93d0 Do not check the write_future for exceptions on every item.
1c805ea Add counting of push() calls on queue in debug mode.
aa869c0 Release v2.5.1
212578b Fix documentation of Writer constructor.
0445dd8 Add new header file with forward declarations of commonly used classes.
4b6baac Optionally include external library headers.
712a6d1 Update change log.
fc78d04 Update style rules.
b590fe3 Unify use of 'typename' in templates. Unify spacing of ellipsis operator.
8c450ac Move osmium/io/overwrite.hpp to writer_options.hpp.
08eed02 Move DEPRECATED macro into compatibility.hpp.
b72eb8d Release v2.5.0
5aeba6b Better formatting for invalid timestamps on debug output.
6772413 Add valid() function on Timestamp.
7549b05 Update change log.
84119b0 Add option to fsync files after they are written.
db1bd92 Make optional parameters on Writer work in any order.
3482e3e Remove boilerplate. Add explicits to constructors.
cf389c6 Rename the wrap() function to the better ensure_cleanup().
678049e Use reference instead of pointer for decompressor.
7189d28 More consistent use and naming of Function templates.
3d66deb Use const& for parameter that's not changed.
88d65fb Fix warning with a cast.
03e8c9f Fix some misc issues found by cppcheck.
4848676 Options to cppcheck to check everything (--force) and ignore assert.
5f89a8c Add lots of assert() calls to Buffer implementation.
c990b43 Use a wrapper function in Writer for error handling.
04d9e3e Refactor of writer to work properly in all error cases.
6daf2d3 Throw when reading from Reader after eof or error. Use io_error everywhere.
713a189 Rename OutputFormat::close() to write_end().
7905add Refactor Reader/Writer code.
c050a05 Make thread_handler class movable.
8e661a2 Make DeltaEncode/Decode more generic and fix signedness issues.
da712a9 Fixed a few signedness issues.
dc04e67 Avoid possible narrowing conversion.
abd44af Make a variable static that should be.
7039fa6 Avoid global variable.
9e9fc0f Add a noreturn attribute.
a681a2c Do not pass Timestamp class through forwarding.
d37b717 Clean up status handling in Reader and Writer.
3b1f0d8 Add at_end_of_data() helper function to get self-documenting code.
bf3cc8c Add add_end_of_data_to_queue() helper function.
94bdd09 Fix test.
531db80 Use valid() on future instead of an extra bool.
7f328b3 Make RVO work for pop() function.
c1d726d Add some static_cast_with_assert paranoia checks.
5a064f7 Make sure DeltaDecode/DeltaEncode classes work for all integer types.
c69a701 Fix some integer types.
2b2cfc9 Remove extra semicolons at end of function definitions.
2b74aa6 Use workaround for GCC unused variable warning for index::map, too.
f7fb94d Different way of supression unused-variable warning.
c0813e6 Better handling of threads.
963ff8e Move internal buffer from OutputIterator into Writer.
698d027 Update change log.
24270dd Remove unused variables.
64d6363 Remove unnecessarily fully-qualified name.
5ccacc7 Add support for reading o5m and o5c files.
b603904 Fix up includes.
6013a27 Remove pessimizing move.
a19e4cf Use queue_wrapper in Reader, too.
74a5174 Refactor thread creation for WriteThread.
c480b33 Fix test code.
e135597 Do not use promise in two threads at once.
6fa16ca Refactor input format code.
53fc576 More robust implementation of writer/writer_thread.
1285316 Put some queue handling into new wrapper class.
a1e6e6f Rename osmium/io/detail/util.hpp to queue_util.hpp.
f42d6fc New add_to_queue() helper functions.
3db9b49 Simplify read thread handling.
a903561 Move any exception in read thread through queue.
ee977cb Add more tests for reader code.
99aaa45 Factor out input handling in classes derived from Parser.
7afa03c Wrap access to m_read_types in InputFormat.
f6c5971 Wrap sending to output queue in InputFormat.
26f4170 Consolidate header handling in InputFormat.
a0aa3ed Remove unnecessary inline declaration.
894e84a Declare a bunch of destructors noexcept and use consistent comments.
6c49b43 Add hack to append_printf_formatted_string() so it works on Windows.
20c3f20 Remove a move that prevented copy elision.
8192a4c Pull low-level string formatting out of debug output and test it.
190aa46 Move low-level string formatting/encoding functions into own header.
3e35441 Add Option::is_not_false() helper, use and test it.
0a90339 Updated some comments.
a44066f Make naming of output format options more consistent and document them.
a59b60b Run serialization of PBF blobs in worker threads speeding up PBF writer.
18a739f Remove unused m_file attribute from OutputFormat class.
9b5d3b7 Various output option related cleanups.
36772a0 Consistent ordering of methods in *InputFormat classes.
c04a51f Factor out common code in output formats.
ebc53d4 Do not use "explicit" on constructors with more than one argument.
e1dfcfc Make all destructors in io/detail noexcept.
cfd7970 Use consistent handling of output options in all outputs.
c4e71f0 Better implementation for output_formatted() and tests for it.
899a061 Extract common code from output formats.
b226ae4 Factor out common code from *OutputBlock classes.
fe4b287 Cleanup WriteThread class.
af421df Consistent naming of queue typedefs.
e8253c4 Add missing include.
9f71cd3 Refactor management of read thread into its own class.
4c96e16 Refactor Reader/InputFormat.
fa02e6c Refactor input format code.
d14ea27 Extract common code from PBF/XMLParser into new Parser class.
fe7acd3 Better handling of failures when parsing header.
2e3b6cd Remove unnecessary include of <future>.
3bd18b8 Factor out common code in input format.
2915604 Only get promise and future once, even if header() is called multiple times.
cfc980c Make output buffer for XML parser smaller.
4c1ffa7 Orderly shutdown in io::Reader.
8c7aa32 Remember whether the input queue was exhausted.
535bb6a Function call in new thread can be void.
e0d5448 Factor out some helper function for queue cleanup.
5a4c6b5 Use std::thread directly for input instead of std::async.
c1bdf4f Move common code from InputFormat child classed into base class.
89caa6e Report failures in input_format through the queue.
8f4d300 Rename (m_)queue to (m_)output_queue.
8fc1f5b Reorder XMLParser class making check_attributes() private.
df381d7 Make sure we always send end-of-file from PBF parser.
1a178b0 Factor out construction of PBFDataBlobDecoder.
cb34f76 Factor out read_from_input_queue_with_check() method.
21b51cc Factor out parse_data_blobs() method.
dc957a8 Make some variables const.
1c2812c Make methods private that don't need to be public.
81e5625 Refactor out parse_header_blob() function.
f9e5760 Fix test: New signature of XMLParser constructor.
43746d3 Add copy constructor to PBFParser.
8524780 Rename variables and other changes for clarity.
3e9627b Removed now superfluous parameters from InputFormat class.
7eac5cf Simplify input format class.
3ea2ace Set max queue size only in one place.
77ab086 Formatting.
ceee837 Use std::async instead of "raw" std::thread for pbf input.
6cafb45 Move and rename PromiseKeeper class: Now in thread/util.hpp.
06eff29 Set thread name for xml parser thread.
bd485cd Refactoring of threading code for input.
fc03bf6 Make sure (de)compression classes clean up properly.
27af4ea Use special function to shut down pool workers instead of an atomic<bool>.
84297b3 Bugfix: auto and std::minmax() don't mix well.
597ecc4 Always use std::swap() in the idiomatic form.
10dd14f Remove threading test that fails when machine is too busy.
2072786 Use reserve() to spead up dumping indexes.
66a344b Declare some index functions noexcept, especially destructors.
a0586da Use map::find() instead of awkward try-catch block.
d38a7f1 Do not run make tasks in parallel.
cd33daa Do not use clever YAML aliases, instead copy dependencies explicitely
4ad6e43 Integrate more compiler and os versions
b2c519b Check return code of close() system call and throw.
369057b Update protozero to current 1.2.2.
d1db14b Collect debug output options into struct.
54667dd More consistent debug output of way nodes, relation members and changeset comments.
67e1513 Add some paranoia checks to xml parser.
69de191 Refactoring in xml reader: New function check_attributes().
c67f3f3 Add support for changeset discussions (comments).
9c5531c Merge pull request #121 from DerDakon/cmake-find-no-components
44be1a7 Add helper functions to make input iterator ranges and output iterators.
76e2b91 Merge pull request #130 from alex85k/master
5a4fa6b remove assertion messageboxes in tests on Windows
bac5a77 Updated change log.
7e7bba4 Updated included protozero library to 1.2.0.
1ae370d Merge pull request #122 from zerebubuth/pbf-decode-non-visible-node-locations
5897468 Merge branch 'master' of github.com:osmcode/libosmium
7f2de1b Bugfix: Delta iterator handling.
65d31e9 Try ; as cmake list separator.
3a9dbc2 Add PBF libraries, now that the test reads PBF too. Thanks @tomhughes for pointing this out.
9a22ea1 Add test case for reading deleted / non-visible nodes in history files.
36098a8 Decode lat/lon even for non-visible nodes.
8279fd1 kick off AppVeyor to test new binary deps package with gdal200
c8244f7 FindOsmium: prevent errors in list(REMOVE_DUPLICATES) when no components are requested
a02806a Use https URL to travis.
a1b7015 Fix some includes.
468e4d8 Remove pessimizing std::move.
427d2e0 Do iwyu check on header files in alphabetical order.
be9a996 Release v2.4.1
95a3bc8 Fixed CRC calculation of tags and changesets.
4e157e3 Release v2.4.0
3da68f0 Fixed setting of binary mode on Windows.
81aa057 Use binary mode for memory mapped file on Windows.
986cb7e Set stdout to binary mode on windows before writing to files.
27d02eb Bugfix: Do not dereference end iterator.
e96eeaf Updated change log.
64a55ce FindOsmium: let FPHSA handle all the additionally required things
e152057 FindOsmium: pass the proper module name to FPHSA
a4acce3 Remove restriction on master branch in appveyor config.
10c8265 FindOsmium: simplify the fallback code for sparsetable::size_type
190ed47 remove the correct include dir from OSMIUM_INCLUDE_DIRS
aaa99c1 avoid that FindOsmium finds a random include dir
6406010 Add a magic define fixing a boost problem.
2fa6674 Remove superfluous file paths from cmake config.
e081a51 Merge pull request #114 from DerDakon/do-not-cache-version
20e1a24 Use external gdalcpp wrapper for compatibility with GDAL 2.
3b7cc86 Fix initialization order in DeltaEncodeIterator.
0954b0f Fix possibly uninitialized variable.
f081942 Take byte swap functions out of CRC class.
e085aae Fix byte swap, add test cases for crc.
e648b62 Merge pull request #116 from DerDakon/yml-simplify
7912897 properly put bzip2 library in the CMake cache
e0ea72b use less variables when defining the test environment
cf8ff6c do not cache the version string
38234cd Remove pragmas disabling warnings from gdal includes.
82d8c30 Include headers of external libraries as "system libraries".
f721b86 Update protozero to version 1.1.0.
a29ef82 Add some magic to enable folding on travis output.
18b2418 Removed toogr examples. They are in their own repository now.
89c8220 AppVeyor: 1st try with VS2015
93a1626 Added recent changes to change log.
ce4b45e Bugfix: Program hanging when opening unknown file type.
06ad6ef Rename add_string() to store_in_stringtable() and use right return type.
869058d Add explicit conversion that always works.
0b28f2c Add missing check in TagListBuilder add_tag() overload.
51fa9c0 Check in builder that key/value of a tag is not too long.
9b1da20 Check that string table isn't overflowing.
2c732c6 Add some extra paranoia checks and type conversions to pbf writer.
f92096a Fix integer size.
a47ddb4 Force conversion to smaller int type, because we know it must fit.
f150ff1 Rename variable that was hiding parameter name.
ab92064 Use correct size_t as return type.
2f2bf68 Check that roles are no longer than max allowed string length.
4a7df68 Check strings for max length in PBF input.
e4b8bb0 Explicit conversion to bool.
d18352d Make conversion from double to integer explicit.

git-subtree-dir: third_party/libosmium
git-subtree-split: 0ff278001f6e0bc79040add736452bef3aa4ff06
2016-01-05 12:00:40 +01:00
Daniel J. Hofmann
9852b147f8 Bump libosmium version to 2.5.4 in update script 2016-01-05 11:56:51 +01:00
Patrick Niklaus
552cdbfe20 Apply clang-tidy 2016-01-05 11:54:31 +01:00
Daniel J. Hofmann
4ca29dd18e Default initialize (i.e. zero initialize) variables to suppress -Wuninitialized false positive 2016-01-05 11:29:25 +01:00
Daniel J. Hofmann
0d971a70cc Prevent comment splicing from backslash at end of line 2016-01-05 11:19:18 +01:00
Daniel J. Hofmann
0dda98384b Bump license year count for headers we install, too 2016-01-05 11:15:30 +01:00
Daniel J. Hofmann
685d330ee2 Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00
Daniel J. Hofmann
2d455018ae We are at 2016 for the license 2016-01-04 18:13:05 +01:00
Patrick Niklaus
fce486735b Merge pull request #1841 from mortada/use_double_not_float
use double precision calculations instead of mixing double and float
2016-01-04 11:58:07 +01:00
Patrick Niklaus
45073ce9eb Merge pull request #1840 from mortada/improve_comments
improve comments
2016-01-04 11:57:18 +01:00
Patrick Niklaus
4ba732c886 Fix AppVayor tests 2016-01-04 11:15:37 +01:00
Mortada Mehyar
a6cb786718 improve comments 2016-01-03 20:50:25 -08:00
Mortada Mehyar
93a2e66704 use double precision calculations instead of mixing double and float 2016-01-03 20:44:38 -08:00
Patrick Niklaus
facbe2c012 Fix test names for travis 2016-01-03 18:47:50 +01:00
Patrick Niklaus
02a49c8a68 Use local includes before system includes 2016-01-03 18:47:50 +01:00
Patrick Niklaus
97585bb26a Fix include paths 2016-01-03 18:47:50 +01:00
Patrick Niklaus
b618a1241f Adapt build system 2016-01-03 18:22:31 +01:00
Patrick Niklaus
d936009ea1 DOS -> UNIX file format 2016-01-03 16:37:38 +01:00
Patrick Niklaus
078f71c144 Move files in unit_tests around 2016-01-03 16:37:38 +01:00
Patrick Niklaus
bfc6c9b89d Move files in src/ include/ 2016-01-03 16:37:38 +01:00
Patrick Niklaus
758d402305 Merge pull request #1839 from sebastic/occurred-typo
Fix 'occured' typo, replace with 'occurred'.
2015-12-26 13:39:07 +01:00
Bas Couwenberg
e6789fab6c Fix 'occured' typo, replace with 'occurred'. 2015-12-25 22:26:08 +01:00
Patrick Niklaus
a2e114e852 Merge branch 'develop' 2015-12-24 11:22:16 +01:00
Patrick Niklaus
0baf90a218 Adjust error string of distance_table to other plugins 2015-12-19 01:40:55 +01:00
Patrick Niklaus
f9f3d43152 Fix min average sample time 2015-12-19 01:40:55 +01:00
Patrick Niklaus
326f2d2743 Accidentally broke the trip plugin 2015-12-18 19:22:02 +01:00
Patrick Niklaus
57f257dce5 Fix status messages and don't include 2015-12-18 18:18:48 +01:00
Patrick Niklaus
c27fc4e4d8 Add comments to profiles about uturn 2015-12-18 15:54:33 +01:00
Moritz Kobitzsch
a37192c102 alignment 2015-12-18 12:28:03 +01:00
Moritz Kobitzsch
68bd6a29b6 modified local state of u_turn_penalty_variable 2015-12-18 12:25:46 +01:00
Patrick Niklaus
da11113bf1 Fix generate options parameter 2015-12-17 17:57:39 +01:00
Patrick Niklaus
70f4cdd0ca Replace codes with enum 2015-12-17 16:45:15 +01:00
Patrick Niklaus
78ac3cffde Add max values for viaroute and trip and reorganize return code handling
"status" is now always:
 - 200 if the request was successful
 - 207 if the result is empty (no path found)
 - 400 if the request is invalid

 viaroute and trip now have a maximum of 500 and 100 locations
 respectively. Override with the --max-viaroute-size and --max-trip-size
 parameters.
2015-12-17 04:14:34 +01:00
Patrick Niklaus
7eb2af6cd3 Add snapping regression test for viaroute 2015-12-16 22:51:01 +01:00
Patrick Niklaus
0b1c9d33a5 Don't use phantom node pairs as input for distance table 2015-12-16 22:51:01 +01:00
Patrick Niklaus
648a62112e Fix snapping to small components 2015-12-16 22:51:01 +01:00
Patrick Niklaus
ff7cb91d9c Use the Koenig swap and add free swap function for DeallocationVector 2015-12-16 22:03:46 +01:00
Patrick Niklaus
fd5881670d Use std::swap 2015-12-16 22:03:46 +01:00
Patrick Niklaus
fc8768b79b Add test for car mode snapping 2015-12-16 22:03:46 +01:00
Patrick Niklaus
914570b053 Don't snap to ferries in car profile 2015-12-16 22:03:46 +01:00
Patrick Niklaus
1a8783cfa0 Fix unused variable warning 2015-12-16 22:03:46 +01:00
Patrick Niklaus
28bfefcac6 Add option to set segments as non-snapable from lua 2015-12-16 22:03:46 +01:00
Patrick Niklaus
bec56522e3 Add stxxl/vector include to range_table test 2015-12-16 22:02:34 +01:00
Patrick Niklaus
0ddd473477 Use ::min() instead of -::max() 2015-12-16 19:41:06 +01:00
Patrick Niklaus
2defc8e826 Correctly initialize the min value 2015-12-16 19:35:12 +01:00
Patrick Niklaus
c3756f6b58 Template the vector type in RangeTable 2015-12-16 18:17:04 +01:00
Patrick Niklaus
66af3d260c Merge pull request #1822 from rparanjpe-tesla/develop
name_lengths std::vector --> stxxl::vector
2015-12-16 11:49:59 -05:00
rparanjpe
5c3398c280 name_lengths std::vector --> stxxl::vector 2015-12-15 19:12:33 -08:00
Patrick Niklaus
63a59325f5 Fix SimpleClient 2015-12-16 00:26:13 +01:00
Patrick Niklaus
f1091f97fc Fix cucumber help text test 2015-12-15 23:38:12 +01:00
Patrick Niklaus
fe9bdfef79 Fix case when not specifing path or sharedmemory to osrm-routed 2015-12-15 22:27:12 +01:00
Patrick Niklaus
a8f11981e3 Include tbb in libosrm.pc 2015-12-15 21:42:32 +01:00
Patrick Niklaus
94651744af Remove assertion in farest insertion 2015-12-15 21:33:59 +01:00
Patrick Niklaus
24e7d00af5 Fix call to shortest_path from match plugin /cc @danpat 2015-12-15 21:27:03 +01:00
Patrick Niklaus
f85a35b5fc Fix map matching coordinate check 2015-12-15 21:14:43 +01:00
Patrick Niklaus
a27aad0061 Fix osrm-routed options 2015-12-15 21:08:09 +01:00
Patrick Niklaus
9a332d2f86 Fix osrm.hpp placement 2015-12-15 19:25:26 +01:00
Patrick Niklaus
1264983688 Fix build 2015-12-15 16:31:28 +01:00
Lev Dragunov
4d4a3d02ed A side_road tag support for the OSRM car profile. 2015-12-15 13:23:27 +03:00
Patrick Niklaus
53cee90933 Fix removed server_paths reference 2015-12-15 05:17:31 +01:00
Patrick Niklaus
6daa3290d4 Cleanup library setup 2015-12-14 22:00:20 +01:00
Patrick Niklaus
5a9bee0527 Don't include zero characters in empty names 2015-12-13 20:31:47 +01:00
Daniel Patterson
6914d26187 Correct data entry for the empty string.
Rename name_offsets to name_lengths, because that makes more sense.
2015-12-13 11:02:55 -08:00
Daniel Patterson
68c01d09bb Merge branch 'rparanjpe-tesla-fix_stxxl_write' into develop 2015-12-11 15:40:03 -08:00
rparanjpe
4bf1ad2566 Write out stxxl vector for names correctly 2015-12-11 15:18:55 -08:00
Patrick Niklaus
00ed526fb0 Fix return value for node snapping 2015-12-11 17:37:48 +01:00
Patrick Niklaus
9bdc58069b Adapt snapping test to viaroute behaviour 2015-12-11 16:53:10 +01:00
Daniel Patterson
4ddbd2efb6 Expose component size variable as command-line option (this allows testing of big/small components in cucumber tests).
Add ability to pass extra parameters to  during tests.
Limit distance table search so that it doesn't return any big components if they're beyond max_distance.
2015-12-11 16:53:10 +01:00
Daniel Patterson
f3f153cb38 Reduce source/targets to a single phantom node based on the small/big components that are present. 2015-12-11 16:53:10 +01:00
Patrick Niklaus
9414a8085d Fixed shortest_path when called from match plugin 2015-12-11 05:44:05 +01:00
Patrick Niklaus
33b18df1a0 Merge pull request #1809 from rparanjpe-tesla/develop
Use a std::vector in place of stxxl:vector for the names list
2015-12-10 11:13:05 -05:00
rparanjpe
da91d342f7 name_list --> name_char_data and name_offsets
-Use stxxl vectors with char and unsigned int containers
-Write out the entire character vector to fil
-Cap the names at length 255 during the parsing so we reduce
 the amount of memory used by stxxl vectors and we can do a
 direct writing of the character vector to .names
2015-12-09 17:28:34 -08:00
Patrick Niklaus
4950e044ba Remove warnings and fix tests 2015-12-09 23:37:06 +01:00
Patrick Niklaus
b41af5f580 Incoperate PR comments 2015-12-09 23:37:06 +01:00
Patrick Niklaus
24090d4642 Fix StaticRTree benchmark 2015-12-09 23:37:05 +01:00
Patrick Niklaus
cdb1918973 Refactor StaticRTree to remove application dependent code
StaticRTree now acts like a container, just returning the input data
(NodeBasedEdge) and not PhantomNodes.
2015-12-09 23:37:05 +01:00
Patrick Niklaus
a8e8f04fa3 std::vector<bool>::emplace_back -> push_back for gcc 4.8 2015-12-09 22:39:10 +01:00
Patrick Niklaus
4ec3102df2 Refactor cucumber tests 2015-12-09 21:17:18 +01:00
Patrick Niklaus
7e722db3ee Make the API grammar more strict to actually error 2015-12-09 21:17:18 +01:00
Patrick Niklaus
20c45be3b3 Address PR comments 2015-12-09 21:17:18 +01:00
Fabien Girard
f2ee0aad20 Use now 3 parameters for matrix: loc/dst/src 2015-12-09 21:17:18 +01:00
Fabien Girard
478d4a571a Support rectangular matrix with less sources than targets 2015-12-09 21:17:18 +01:00
Patrick Niklaus
4253ebf243 Fix inverted error message. 2015-12-09 21:16:53 +01:00
rparanjpe
5b782a783a Use a std::vector in place of stxxl:vector for the names list
-For large datasets with very many unique names, stxxl::vector can corrupt
 data. Technically, we should only be using stxxl:vectors with POD. Other
 types might lead to strange/unpredictable behavior as we noticed here.
-See http://algo2.iti.kit.edu/dementiev/stxxl/trunk/FAQ.html
2015-12-08 23:31:58 -08:00
Patrick Niklaus
c38183423f Move assertion to caller to save parameter 2015-12-05 01:27:01 +01:00
Patrick Niklaus
019e26dd8e Refactor direct_shortest_path and shortest_path 2015-12-04 23:34:24 +01:00
Patrick Niklaus
6d2a65b4ea Add additional uturn test 2015-12-04 20:52:21 +01:00
Patrick Niklaus
4206d98b55 Move leg search to routing base 2015-12-04 20:52:21 +01:00
Daniel Patterson
9005fe2f61 Merge pull request #1793 from Project-OSRM/fix/64bit_osm_ids
Add support for 64bit OSM node identifiers
2015-11-30 13:04:48 -08:00
Daniel Patterson
f87f18a291 Add support for 64bit OSM node id values. 2015-11-30 12:37:58 -08:00
Patrick Niklaus
c0fdcb381a Fix MVS compilation. 2015-11-25 00:27:37 +01:00
Patrick Niklaus
aeaf0e7ba8 Fix unit test compilation 2015-11-25 00:27:20 +01:00
Patrick Niklaus
6dada4e347 Fix impossible route status message 2015-11-25 00:27:20 +01:00
Patrick Niklaus
61f015eef6 Fix match plugin status codes 2015-11-25 00:27:20 +01:00
Patrick Niklaus
d843521839 Preserve information about big components
This uses a bit flag to differenciate between small and big components
and keeps the ids for both. This makes it possible to give better
error messages.
2015-11-25 00:27:20 +01:00
Patrick Niklaus
420369fe13 Fix off-by-one in via_indices 2015-11-24 21:05:18 +01:00
Daniel J. Hofmann
71bf1edc5e Run Modernizer 2015-11-21 22:17:55 +01:00
Patrick Niklaus
d06ac519ab Only build using calng 3.8, gcc 4.8 & 5.0 2015-11-20 19:52:22 +01:00
Patrick Niklaus
50512b52e1 Remove -m parameter from routed as it conflicts. Use the long names instead. 2015-11-20 18:50:14 +01:00
Patrick Niklaus
543e77b9be Add pre-turn bearing as last field to instruction 2015-11-20 16:06:33 +01:00
Patrick Niklaus
783d455bd7 Add support for advisory speed limits
This adds support for the maxspeed:advisory class of speed tags.
2015-11-19 21:25:12 +01:00
Patrick Niklaus
6c35272fe2 Remove obsolte code as we use a turn function now 2015-11-19 21:25:12 +01:00
Daniel Patterson
6955978a62 Remove commented out line in windows build script. History is what git is for. 2015-11-19 15:02:42 -05:00
Daniel Patterson
27d87dff79 Remove some accidentally merged changes. 2015-11-19 15:00:29 -05:00
Daniel Patterson
d8ca58a04e Merge pull request #1785 from Project-OSRM/feature/weight_debugging
Adds ability to dump GeoJSON with detailed edge weight info.
2015-11-19 12:01:08 -05:00
Patrick Niklaus
ce34798685 Merge pull request #1782 from Mapotempo/pkgconfig
Fix pkgconfig cmake template
2015-11-19 11:42:34 -05:00
Fabien Girard
16fd5249dd Fix pkgconfig cmake template 2015-11-19 17:38:04 +01:00
Daniel Patterson
b9a4c322a7 Add ability to debug routing graph visually by dumping
annotated GeoJSON during processing.
2015-11-19 10:41:44 -05:00
Daniel Patterson
673bf356e4 Merge pull request #1764 from Project-OSRM/edge_segment_lookup
Enable per-segment speed updates just before contraction.
2015-11-18 16:15:04 -05:00
Daniel Patterson
6228412e61 Enable just-before-contraction updates to edge weights. For small
datasets, this enables things like traffic-based updates in the
shortest possible processing turnaround time.
2015-11-18 16:14:08 -05:00
Daniel Patterson
578d947e2d Comment out failing bearing test - wontfix this problem for now 2015-11-18 14:08:12 -05:00
Daniel Patterson
72629d0081 Fix test cases for level cache command-line option. 2015-11-18 11:48:28 -05:00
Daniel Patterson
d7989f19cf Fix bug in bearing filter related to reverse edges. Fix tests to catch it. Still one outstanding test failure that looks like a problem in the viaroute results. 2015-11-18 10:57:20 -05:00
Daniel Patterson
8b11cdbf61 Merge pull request #1780 from Project-OSRM/build_shared_libs
Enable building of shared libraries on Travis.
2015-11-18 09:56:59 -05:00
Daniel Patterson
5c1f76e3cf Build shared libraries on a selection of platforms. 2015-11-18 09:54:33 -05:00
Patrick Niklaus
63ba6018f3 Cache the node priorities between runs
This speeds up processings on the same dataset significantly by creating
a .level file that saves the level in which a node was contracted.
It removes the need for expensive recomputation of priorities and such.

Use with care! Running `osrm-extract` again will invalidate .level
files.
2015-11-18 00:56:33 +01:00
Daniel Patterson
8f3482561b Rename great_circle_distance->haversine_distance, and euclidean_distance->great_circle_distance, because that's what they actually are. 2015-11-17 17:10:06 -05:00
Daniel Patterson
13ceeb191c Merge pull request #1766 from Project-OSRM/feature/bearing_selection
Add bearing support to all plugins, add optional range to bearing parameter.
2015-11-17 16:41:34 -05:00
Daniel Patterson
1536d1c044 Add bearing filter support to viaroute, trip, nearest, and distance
table plugins.
Make bearing range configurable by adding a comma-separated second part
to the bearing paramenter, like so:

    b=<bearing:0-359>(,<range:0-180>)

If no range is supplied, it defaults to +/- 10 degrees.
2015-11-17 16:35:20 -05:00
Daniel Patterson
16b6c26d6e Merge pull request #1774 from Project-OSRM/feature/match_summary
Add a route summary to each match result.
2015-11-17 15:32:00 -05:00
Daniel Patterson
c7e30e2266 Add a summary to each match result showing distance and duration.
Helpful for comparing how long the routing engine thinks the matched
trace should take to travel.
2015-11-17 15:28:21 -05:00
Daniel Patterson
d5e4495f89 Merge pull request #1723 from Project-OSRM/i_like_travis
New Travis CI integration - upgrades Linux builds to Ubuntu trusty, simplifies dependency installation because system packages are now available for most things.
2015-11-17 15:26:29 -05:00
Daniel J. Hofmann
963960a44c Switch Travis builds over to trusty for Linux (simpler dependency installs), build
with mutliple compilers, fix debug builds.

OSX builds are disabled until we fix #1778
2015-11-17 15:15:31 -05:00
Daniel Patterson
a62c10321c Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1.
Fixes  #1758
2015-11-03 21:56:26 -08:00
Patrick Niklaus
bb49e03435 Merge pull request #1743 from c0nk/wip-build
Don't generate files in source tree
2015-10-22 16:32:28 -04:00
Kal Conley
38e7b1a262 Remove non-existent git_sha.cpp from .gitignore 2015-10-19 21:33:10 +02:00
Kal Conley
a00d3dfc00 Don't generate util/version.hpp in source tree 2015-10-19 21:33:10 +02:00
Kal Conley
cd458e7a44 Don't generate util/fingerprint_impl.hpp in source tree 2015-10-19 21:33:10 +02:00
Patrick Niklaus
3f82570469 Merge pull request #1740 from c0nk/develop
Fix various bugs
2015-10-19 20:31:23 +02:00
Kal Conley
a8642bd208 Fix segmentation fault when "hsgrdata" unset 2015-10-19 20:13:02 +02:00
Kal Conley
b404c79ca4 Fix json renderer always rendering arrays empty 2015-10-19 20:13:02 +02:00
Kal Conley
29c75337f2 Fix segmentation fault when sizeof(size_t) < sizeof(int64_t) 2015-10-19 20:13:02 +02:00
Patrick Niklaus
fca4aeb50b Merge pull request #1741 from Project-OSRM/oom_messages
Catch `std::bad_alloc` at the top and translate to human readable messages
2015-10-19 19:29:53 +02:00
Daniel J. Hofmann
1dfa2d6e91 Catch bad_alloc and provide human reasable error messages 2015-10-19 18:18:11 +02:00
Daniel J. Hofmann
79650ca3fd Flatten main executable entry points by using functional try blocks 2015-10-19 18:18:11 +02:00
Patrick Niklaus
fd84827e51 Don't use stalling in core search 2015-10-19 17:11:03 +02:00
Daniel J. Hofmann
78283a0e0e Check if memory locking should be done before locking unconditionally 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
993321e971 Lock by default, set fail on error 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
f7a1e2f652 Flatten routed by using functional try-catch blocks 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
e75be68466 Only lock the virtual address space when shared memory was requested
In addition, some improvements:

- unlock only when locking succeeded
- scoped exception safe RAII locker

Reference:

- https://github.com/Project-OSRM/osrm-backend/issues/1698#issuecomment-144003177
2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
74ac283c52 We are on v4.8.1. 2015-10-09 16:53:17 +02:00
Patrick Niklaus
9ef1f8cba3 Fix fore core factors < 0.3 2015-10-08 20:58:21 +02:00
Daniel Patterson
e45656e5bf Refactor edge expansion into extract phase. New temporary file is generated - '.osrm.ebg' which is used by 2015-10-06 09:23:17 -07:00
Patrick Niklaus
cdc4fb45f2 Merge pull request #1720 from jordanmarkov/fix/invalid_nodes_left_in_data
Fixed a bug when extracting data from a file with cut streets (with m…
2015-10-06 11:44:51 +02:00
Daniel J. Hofmann
5379a555db Use ccache by default if available and a suitable compiler is used.
This checks if `ccache` is available, and if so uses it.
The user can stil disable it via the ccache env variable, quoting:

    disable (CCACHE_DISABLE) [boolean]
        When true, ccache will just call the real compiler, bypassing the cache completely. The default is false.

At least Clang required `CCACHE_CPP2`.

The user does not have to set up anything, just to install ccache.
Of course, things like the cache's max size, its location and so on can
be configured.

References:

- https://ccache.samba.org/manual.html
2015-10-06 11:18:43 +02:00
Daniel Patterson
d07c0bde80 Adds support for a new b= parameter on the viaroute and match
plugins, allowing for better nearest neighbor matching when a heading
is known.
2015-10-06 11:15:10 +02:00
Patrick Niklaus
7015ed203a Don't count ferries as public transportation 2015-10-06 11:13:39 +02:00
Johan Uhle
1ead4cbb14 osrm-components: remove unused param
We don't use restrictions anymore
2015-10-06 11:12:56 +02:00
Jordan Markov
84ebca0dd2 Fixed a bug when extracting data from a file with cut streets (with missing nodes). 2015-10-06 09:42:52 +03:00
Daniel Patterson
cf45b2cddb Properly initialize UUID used in Fingerprint class. Fixes #1721 2015-10-03 09:18:10 -07:00
Daniel J. Hofmann
8f8bd05f83 Silence warnings with GCC, LTO does not yet respect the -isystem switch 2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
b1155a202c Re-enable manual -fPIC flag from cae59c7. 2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
d4aaaf16f8 Revert "Re-enable position independent code, but in a portable way."
This reverts commit 2143dc97fa65c786c6566db1343ad270347dcfd3.
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
119fb63576 LTO is broken on GCC < 4.9.0, disable it.
References:

- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038
- https://github.com/Project-OSRM/node-osrm/pull/112
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
3f7afd47d2 Do not violate the One Definition Rule (ODR).
By linking in the coordinate object file twice, we violate the ODR,
resulting in our program to not be "well-formed" in language lawyer
speak (hint: bad, very bad).

(How come no one noticed this all the time, this was introduced
somewhere between v4.5.0 and v4.6.0 from a quick look...)

References:

- C++14 standard (N3936.pfd): 3.2 One definition rule [basic.def.odr]
- http://eel.is/c++draft/basic.def.odr
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
ca0f8ed653 Immensly increase lua/luabind detection and check in buildsystem.
Instead of including the `luabind.hpp` header that transitively includes
basically everything else, we now only include the appropriate header
for luabind's open function.

It is important that this function is declared in the header but the
definition comes from the luabind shared object (library), such that we
can detect linker errors, too.

By only including this header, we also no longer transitively include
the header for the `luaL_newstate` function, with we have to add
manually.

With these changes, detecting, compiling, linking and checking for
lua/luabind with cmake now works instantly, instead of the 3-4
seconds as it was before! Yay, progress!
2015-09-30 18:22:26 +02:00
Daniel J. Hofmann
809bdb7c1f Fixes version generation, no longer derives version on git tags.
We were stuck on the 4.5.0 tag from develop, since we searched for the
latest tag, but release tags are done on the master branch.

This commit rips out all the code for deriving the version on git tags.

Instead, we define major, minor, and patch versions in the CMakeLists
and then pass it on to:

- the `libosrm.pc` `pkg-config` file

- a `version.hpp` header that makes use of the preprocessor's string
  concatenation to provide an easy way for generating version string
  literals such as "v4.8.0".

That is, in the source code please now use the following defines:

    #define OSRM_VERSION_MAJOR "@OSRM_VERSION_MAJOR@"
    #define OSRM_VERSION_MINOR "@OSRM_VERSION_MINOR@"
    #define OSRM_VERSION_PATCH "@OSRM_VERSION_PATCH@"

    #define OSRM_VERSION "v" OSRM_VERSION_MAJOR "." OSRM_VERSION_MINOR "." OSRM_VERSION_PATCH
2015-09-30 18:22:25 +02:00
Daniel J. Hofmann
0424ff0818 Do not pass linker flags for static libraries.
Static libraries get the linker flags from the user / pkg-config.
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
9b952ff48c Improve debug build performance while keeping symbols.
- remove profiling/coverage mix from debug build, as it is useless as of
  now, re-enable this for a separate coverage build in the future

- use gcc's `-ggdb` and `-Og` flag (requires recent gcc) to provide
  better debug information targeted for gdb and optimize what we can

- use `-fno-inline` and `-fno-omit-stack-pointer`, in order to be able
  to jump around in gdb without functions being gone and keeping the
  stack reference
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
c5064710a8 Re-enable position independent code, but in a portable way.
CMake 2.8.9 introduce a `POSITION_INDEPENDENT_CODE` property.

This sets `-fPIE` on executables, giving us back optimizations such as
inlining of global variables and functions, while setting `-fPIC` on
libraries.

Although we do not need position independent code on executables, it
seems like some gcc versions (like 4.9.2) have issues in combinations
with `_FORTIFY_SOURCE`.

On shared libraries, CMake should per documentation even use position
independent code by default.

References:

- http://www.cmake.org/cmake/help/v3.0/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE
- http://public.kitware.com/pipermail/cmake-developers/2012-May/015839.html
- https://github.com/Project-OSRM/osrm-backend/pull/1647
- cae59c7395
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
57e522065a Add linker optimizations and dead code and data elimination.
Linkers also have options we can configure! The most usefull feature is
to give every function its own section. This results in some bloat at
compile time, but at link time now the linker can do dead code and data
elimination by simply discarding appropriate sections.

This works by splitting the `.text` section in a way that makes it
possible to later only pull in sections that are actually referenced.

That is, the basic idea is to keep the matching between sections and
functions intact, so we can optimize based on it in the linking stage.

Note: there's still an issue with how `libOSRM.a` gets build. CMake
currently passes the linker flags on to ar, in order to create a static
library. But ar does not understand the linker's flags.

Referenes:

- https://sourceware.org/binutils/docs/ld/Options.html#Options
- http://elinux.org/images/2/2d/ELC2010-gc-sections_Denys_Vlasenko.pdfMCþ"
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_EXE_LINKER_FLAGS.html
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_MODULE_LINKER_FLAGS.html
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_SHARED_LINKER_FLAGS.html
- http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_STATIC_LINKER_FLAGS.html
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
7143daf500 There is no CMAKE_LINKER_FLAGS variable.
There really isn't; deal with it.

Also, those are not linker flags but instead meant for the compiler.

References:

- http://www.cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
71a00fc01b Make lto detection more robust and not resetting cxx flags when lto fails.
This refines the last commit of parallelizing lto.

Discussion: this is ugly as hell, dispatching 1/ on the availability of
the `-flto` flag, then 2/ on the compiler since GCC allows `-flto=n`
whereas Clang for example does not.

I tried setting the CMake property `INTERPROCEDURAL_OPTIMIZATION`,
without any effect. All I could see was some lto related utilities in
the cmake debug output, but not in the actual compiler or linker
invocation.

This would eliminate the need for our hacks, with 1/ using an option
`WITH_LTO` setting `ON` by default, and based on this value setting the
`INTERPROCEDURAL_OPTIMIZATION` flag with CMake doing the actual work of
selecting the best LTO method on the target platform.

By the way, this also fixes a bug where we reset the `CMAKE_CXX_FLAGS`
to a variable that was never defined, resulting in setting the flags to
an empty string. Yay CMake, as usual.

References:

- http://www.cmake.org/cmake/help/v3.0/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
941483c14d Parallelize optimization and code generation for link time optimization.
This parallelizes the `-flto` feature resulting in parallel optimization
and code generation for link time optimization based on the number of
logical processors available.

Note: this has the side-effect of using more memory during linking.

References:

- https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html (see: -flto)
- http://www.cmake.org/cmake/help/v3.0/module/ProcessorCount.htmMC
2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
17d8e65c64 Silence unused variable warnings 2015-09-30 18:20:00 +02:00
Daniel J. Hofmann
72c0feb048 Silence warnings for system headers that we or third_party transitively includes.
GCC with link time optimizations does not to respect this mode
unfortunately, reuslting in warnings in release (default) build
mode from system includes such as boost, luabind and so on.
2015-09-30 18:18:36 +02:00
Daniel J. Hofmann
9e20dbe226 Remove -fPIC flag from build system.
This remove the `-fPIC` flag, indicating position independant code
generation, from the build system.

Citing GCC's official code generation docs:

> This option makes a difference on the m68k, PowerPC and SPARC.

We do not support any of these architectures, so remove the flag!

References:

- https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
2015-09-30 18:18:36 +02:00
Daniel J. Hofmann
06f2738c03 Add stricter compiler warnings to build system.
These are for standard compliance and should on by default:

    -Wall -Wextra -pedantic

The problem is that even `-Wall` and `-Wextra` does not cover all
warnings, as to not break backward compatibility. Clang therefore
has the `-Weverything` flag, that really includes everything but is
overkill for the day to day development.

Thus, we in addition add:

    -Wuninitialized -Wunreachable-code

to guard against undefined behavior from reading uninitialized variables
and warn for unreachable code.

With:

    -Wstrict-overflow=1

the compiler warns us when it's doing optimizations based on the fact
that signed integer overflows are undefined behavior.

With:

    -D_FORTIFY_SOURCE=2

we tell the compiler to replace functions like strcpy with strncpy where
it can do so, resulting in cheap and useful buffer overflow protection.

References:

- https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
- https://securityblog.redhat.com/2014/03/26/fortify-and-you/
- https://wiki.debian.org/Hardening
2015-09-30 18:18:36 +02:00
Daniel J. Hofmann
5a257416ca Completely rip out Boost's Spirit / Karma for casting.
This rips out the Bost Spirit / Karma conversion code, using the stdlib
and lightweight alternatives instead.

The main benefit is an immense decrease in compilation times, for every
translation unit that requires the `util/cast.hpp` header.

Note: compared to the version before, there is a minor change in
behavior: the double `-0` was printed as `0` before and is now printed
as `-0`. This comes from the IEE754 standard, specifying signed zeros,
that is `+0` and `-0`. Interesting for us: JavaScript uses IEE754,
resulting in no breakage if used in arithmetic.

Small test case, left hand side was before, right hand side is now:

    $ ./a.out
    -1.123457 vs -1.123457
    -1 vs -1
    -1.3 vs -1.3
    0 vs -0
    0 vs 0
    0 vs 0
    1.3 vs 1.3
    1.123457 vs 1.123457

References:

- https://en.wikipedia.org/wiki/Signed_zero
- http://www.boost.org/doc/libs/1_59_0/doc/html/boost/algorithm/trim_right_if.html
- http://www.boost.org/doc/libs/1_59_0/doc/html/boost/algorithm/is_any_of.html
2015-09-29 16:15:54 +02:00
Daniel J. Hofmann
f9f0ffb64d Remove hand written conversion code and replace with stdlib features.
With C++11 the stdlib gains:

- `std::stoi` function family to convert from `std::string` to integral type

- `std::to_string` to convert from number types to `std::string`

The only reason for hand-writing the conversion code therefore is
performance. I benchmarked an `osrm-extract` with the hand-written code
against one with the stdlib conversion features and could not find any
significant difference (we switch back and forth between C++ and Lua,
shaving off a few us in conversion doesn't gain us much).

Formatting arithmetic types in the default format with given precision
requires streams, but is doable in a few lines of idiomatic stdlib code.

For this, there is now the following function template available:

    template <Arithmetic T, int Precision = 6>
    inline std::string to_string_with_precision(const T);

that requires integral or floating point types and returns a formatted
string in the defaukt format with the given precision applied.

In addition this completely rips out Boost.Spirit from the `casts.hpp`
header, resulting in faster compile times.

Boom!

References:

- http://en.cppreference.com/w/cpp/string/basic_string/stol
- http://en.cppreference.com/w/cpp/string/basic_string/to_string
- http://www.kumobius.com/2013/08/c-string-to-int/
2015-09-29 16:15:54 +02:00
Daniel J. Hofmann
31cf8a8813 Remove Boost.Filesystem v3 fix for Boost < 1.48, refactor call sites.
We needed this for Boost < 1.48, but per our Wiki on building OSRM:

> On Ubuntu 12.04 you will be limited to OSRM tag v0.3.10 because
> later versions **require Boost v1.49+** and installing this
> causes problems with libluabind-dev package.

Thus, rip it out!

To keep the commits atomic and isolated, I also refactored all call
sites that used the functionality from the portability fix.

While doing this, I also simplified the monster of around ~100 lines of
file path checking --- lambda's are awesome' use them!

References:

- http://stackoverflow.com/a/1750710
- https://github.com/Project-OSRM/osrm-backend/wiki/Building-on-Ubuntu
2015-09-29 16:15:54 +02:00
Daniel J. Hofmann
98b7e0a407 Refactor bearing implementation.
- removes `noexcept` specifier as we can not guarantee for not throwing

- uses a namespace instead of a struct + static function combination

- asserts for heading degree in [0, 360] range (both sides inclusive!)

- header only since implementation does not hide anything

- adds `inline` specifier as compiler hint
2015-09-29 16:15:54 +02:00
Daniel J. Hofmann
7ed63d2ab5 Remove TBB usage from hot code paths 2015-09-28 20:37:09 +02:00
Daniel J. Hofmann
6e6b38e8e9 Revert the usage of TBB's iterator pair taking overloads.
This reverts the range based overload usage introduced in @6b2bf495.

Old TBB versions do not provide the range overloads.
2015-09-28 20:37:09 +02:00
Daniel J. Hofmann
829b9d96e4 Revert parallelization on algorithms that are used in the server. Let node do this.
This reverts @6b2bf49 on the server algorithms.
2015-09-28 20:26:29 +02:00
Daniel J. Hofmann
85cef7e37c Revert parallelization on util that is used in the server. Let node do this.
This reverts @6b2bf49 on the server component utils.
2015-09-28 20:26:29 +02:00
Daniel J. Hofmann
c526bec798 Revert parallelization on server part. Let node do this.
This reverts @6b2bf49 on the server components.

We do not want to parallelize there, as node should be used for
parallelizing the user requests onto multiple processes.
2015-09-28 20:26:03 +02:00
Daniel J. Hofmann
9231335eef Use Intel TBB's parallel_sort even for nested parallelism.
TBB has a global task scheduler (that's one of the reason TBB is not
linked statically but dyanmically instead). This allows control over all
running threads, enabling us to use nested parallelism and the scheduler
doing all the task allocation itself.

That is, nested parallel execution such as in

    parallel_for(seq, [](const auto& rng){
      parallel_sort(rng);
    });

is no problem at all, as the scheduler still claims control over the
global environment.

Therefore, use `parallel_sort` Range overload where possible.

References:

- https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#reference/algorithms.htm
- https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#reference/algorithms/parallel_sort_func.htm
- https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#reference/task_scheduler.htm
- https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#reference/task_scheduler/task_scheduler_init_cls.htm
- https://www.threadingbuildingblocks.org/docs/help/hh_goto.htm#tbb_userguide/Initializing_and_Terminating_the_Library.htm
2015-09-28 20:26:03 +02:00
Daniel J. Hofmann
dfac34beac Do not use an incomplete type with value semantics 2015-09-28 16:50:36 +02:00
Daniel J. Hofmann
82dd5d8ccf Use Boost.Optional instead of custom optional monad implementation.
This switches out the `<variant/optional.hpp>` implementation of the
optional monad to the one from Boost.

The following trick makes sure we keep compile times down:

- use `<boost/optional/optional_fwd.hpp>` to forward declare the
  optional type in header, then include the full blown optional header
  only in the implementation file.

- do the same for the files we touch, e.g. forward declare osmium types,
  allowing us to remove the osmium header dependency from our headers:

      `namespace osmium { class Relation; }

  and then include the appropriate osmium headers in the implementation
  file only. We should do this globally...

References:

- http://www.boost.org/doc/libs/1_59_0/libs/optional/doc/html/index.html
- https://github.com/osmcode/libosmium/issues/123
2015-09-28 15:00:21 +02:00
Daniel J. Hofmann
be506f7121 Change integer_range's .size() member function return type to size_t.
Instead of the return type being the templated `Integer` parameter.

The integer type and the size of the range are not connected.
2015-09-28 15:00:21 +02:00
Daniel J. Hofmann
2470494009 Implement saity checks for irange and its returned type iterator_range.
The implementation does not support backwards counting ranges, but fails
to assert on this condition. Fix this once and for all.
2015-09-28 15:00:21 +02:00
Daniel J. Hofmann
f95a4b9b46 Remove iterator_range dead code 2015-09-28 15:00:21 +02:00
Daniel J. Hofmann
6b444a0877 Do not include Boost.Thread is a sub-header is good enough.
`boost::thread_specific_ptr` lives in `<boost/thread/tss.hpp>`.

In addition, fix the includes in the touched header.

Reference:

- http://www.boost.org/doc/libs/1_59_0/doc/html/thread/thread_local_storage.html
2015-09-28 15:00:20 +02:00
Daniel J. Hofmann
5c4a845b55 Remove template-heavy Boost.MPL headers where not needed.
This removed mpl headers from the code base, where not needed.

This mostly affects unit tests, where mpl's type list is actually only
used once to automatically generate tests for multiple types (see ref).

In addition, this commit also fixes the includes in the touched headers.

Resulting in 1/ reduces build times and 2/ proper includes.

Reference:

- http://www.boost.org/doc/libs/1_59_0/libs/test/doc/html/boost_test/tests_organization/test_cases/test_organization_templates.html#ref_BOOST_AUTO_TEST_CASE_TEMPLATE
2015-09-28 15:00:20 +02:00
Daniel J. Hofmann
468c01056f Replace custom replace utility with the stdlib's replace algorithm.
This removes the custom `replaceAll` function, replacing it with
`std::replace` from the stdlib's `<algorithm>` header.

This also removes the respective unit test.

More importantly, this removes the dependency on the
`<boost/algorithm/string.hpp>` header in the `string_util.hpp` header.
2015-09-28 15:00:20 +02:00
Daniel J. Hofmann
397078758e Remove boost/thread from rtree, include header for hash_combine in unit test.
The `static_rtree.hpp` header included `<booost/thread.hpp>` without using
anything from this header.

Removing it showed why:

the unit test for the rtree no longer built, since it was missing symbols
for Boost's `hash_combine`, used in the unit test.

Instead of relying on `<boost/thread.hpp>` including the proper header
for `hash_combine` by chance that we only use in the unit test, do the
following:

- remove `<boost/thread.hpp>` from the rtree implementation
- add `<boost/functional/hash.hpp>` to the rtree unit test

As always, include what you use.
2015-09-28 15:00:20 +02:00
Daniel J. Hofmann
c9af06c9e0 Remove hand-written ConcurrentQueue class template.
We already rely on Intel TBB, which provides battle-tested
concurrency containers, such as:

- `concurrent_queue`,
- `concurrent_bounded_queue`,
- `concurrent_priority_queue`.

The `ConcurrentQueue` class template was never used. If the need
comes up again, we should strongly prefer those instead of writing
one ourselves.

References:

- https://www.threadingbuildingblocks.org/docs/help/reference/containers_overview/concurrent_queue_cls.htm
- https://www.threadingbuildingblocks.org/docs/help/reference/containers_overview/concurrent_bounded_queue_cls.htm
- https://www.threadingbuildingblocks.org/docs/help/reference/containers_overview/concurrent_priority_queue_cls.htm
2015-09-28 15:00:20 +02:00
Patrick Niklaus
5a7e663b1d Merge pull request #1707 from arnekaiser/develop
Bugfix: allow POST request without POST data
2015-09-27 17:57:31 +02:00
akaiser
e0550cd20b Bugfix: allow POST request without POST data 2015-09-24 14:40:35 +02:00
Daniel Patterson
5844231a37 Include (road) name of matched nodes in addition to coordinate. 2015-09-23 17:53:34 +02:00
Lauren Budorick
8d435638e1 Delete accidental/extraneous files 2015-09-23 10:33:27 -04:00
Freenerd
55cad1b3ac Refactor alternative route test 2015-09-23 15:54:23 +02:00
Daniel J. Hofmann
9deadc1371 Static analysis: integration with the Static Analyzer.
This provides a wrapper script to invoke the Static Analyzer on the code
base. The script simply wraps your commands, that is you have to do the
following:

    ..scripts/analyze cmake ..
    ..scripts/analyze cmake --build .

Note: the Static Analyzer is integrated in Xcode, so if you are on a
Mac, consider using Xcode natively instead of this wrapper script that
will only give you HTML output.

Reference:

- http://clang-analyzer.llvm.org/
2015-09-22 17:32:32 +02:00
Daniel J. Hofmann
998abf05ba Integration scripts for Clang's Modernize and Tidy tool.
New directory: `scripts/`, in which small scripts for developers reside.

- `modernize`: runs all cpp files through `clang-modernize`, respecting
  out targeted compiler versions, applying C++11 transformations, doing
  syntax checks and formatting --- in parallel.

- `tidy`: runs all cpp files through `clang-tidy`, with selected
  warnings only, since we do not want to warn on every small detail.

Please check the talk slides for `clang-tidy` linked in the references!

References:

- http://clang.llvm.org/extra/clang-tidy/
- http://llvm.org/devmtg/2014-04/PDFs/Talks/clang-tidy%20LLVM%20Euro%202014.pdf
- http://clang.llvm.org/extra/clang-tidy/checks/list.html
- https://github.com/Project-OSRM/osrm-backend/pull/1603
2015-09-22 17:32:32 +02:00
Daniel J. Hofmann
aab5092da3 Use Readme.md as mainpage untill we have something better. 2015-09-22 16:26:21 +02:00
Daniel J. Hofmann
65ee5c4bbb Exclude unit tests and benchmarks from doxygen and make it more robust.
Only specify the flags we change from the default.

    doxygen -g Doxyfile

Generates a default Doxyfile.

Also, make the docs not depend on `dot`, but conditionally create graphs
if `dot` is available, and if not still generate docs.
2015-09-22 16:26:21 +02:00
Daniel J. Hofmann
42ab938a19 No longer generate XML from Doxygen, was used for Breathe+Sphinx integration. 2015-09-22 16:26:21 +02:00
Daniel J. Hofmann
2891de2fcd Add dependency on Dot to CMakeLists for Doxygen integration.
Reference:

- http://www.cmake.org/cmake/help/v3.0/module/FindDoxygen.html
2015-09-22 16:26:21 +02:00
Daniel J. Hofmann
ed3758874d Target developers with doxygen output, more callgraphs, internals.
See the changed flags for their detailed description, in short: this
makes the doxygen output even more awesome for developers.
2015-09-22 16:26:21 +02:00
Daniel Patterson
895d8179a2 Adds basic Doxygen support. Run and docs will end up in 2015-09-22 16:26:21 +02:00
Patrick Niklaus
8f6fc0146b Merge branch 'develop' 2015-09-20 13:30:19 +02:00
Freenerd
e1ac1c4fdc Test that alternative route exists
Complement to a6b44a1470
2015-09-18 17:30:53 +02:00
Daniel Patterson
a6b44a1470 Revert alternative instructions array nesting to previous behaviour. 2015-09-17 09:06:51 -07:00
Daniel J. Hofmann
e8834a68f3 Script for fully automated test bisecting.
Automate cucumber tests bisecting by providing a `git bisect` script.

Because it is stored in source control, but bisecting changes the HEAD,
it is advised to first copy over the script to a place outside source
control, e.g. `/tmp`.

Usage:

    git bisect start HEAD HEAD~10
    bit bisect run /tmp/bisect_cucumber.sh

This automatically configures and builds OSRM, spawns the cucumber tests
and communicates with `git bisect` based on its return code.

Reference:

- man git-bisect
2015-09-16 19:13:31 +02:00
Patrick Niklaus
6ad1cd3fb5 Merge branch 'develop' 2015-09-16 18:18:54 +02:00
Daniel J. Hofmann
3279cbac24 Extend compressed output lifetime till the async write function finishes.
This extends the compressed output vector's lifetime, as we issue an
asynchronous write operation that only receives a non-owning buffer to
the compressed data.

When the compressed output vector then goes out of scope, its destructor
is called and the data gets (potentially) destroyed. If the asynchronous
write happens afterwards, it's accessing data that is no longer there.

This is the reason for race conditions --- well, for undefined behavior
in general, but it manifests in the routed _sometimes_ not responding at
all.

The fix works like this: keep the compressed output associated with a
connection. Connections inherit from `std::enable_shared_from_this` and
issues a `shared_from_this()` call, passing a `std::shared_ptr` to the
asynchronous write function, thus extending their lifetime.

Connecitons thus manage their lifetime by themselves, extending it when
needed (and of course via the `std::shared_pointers` pointing to it).

Buffer's non owning property, from the `async_write` documentation:

> One or more buffers containing the data to be written. Although
> the buffers object may be copied as necessary, ownership of the
> underlying memory blocks is retained by the caller, which must
> guarantee that they remain valid until the handler is called.

Reference:

- http://www.boost.org/doc/libs/1_59_0/doc/html/boost_asio/reference/async_write/overload1.html
2015-09-16 02:06:58 +02:00
bergwerkgis
5094bad838 kick off AppVeyor to test new binary Windows deps package, refs #1628 2015-09-15 12:23:25 +00:00
Daniel J. Hofmann
94af9b7f13 Caches iterators instead of invoking function calls on every iteration.
This caches iterators, i.e. especially the end iterator when possible.

The problem:

    for (auto it = begin(seq); it != end(seq); ++it)

this has to call `end(seq)` on every iteration, since the compiler is
not able to reason about the call's site effects (to bad, huh).

Instead do it like this:

    for (auto it = begin(seq), end = end(seq); it != end; ++it)

caching the end iterator.

Of course, still better would be:

    for (auto&& each : seq)

if all you want is value semantics.

Why `auto&&` you may ask? Because it binds to everything and never copies!

Skim the referenced proposal (that was rejected, but nevertheless) for a
detailed explanation on range-based for loops and why `auto&&` is great.

Reference:

- http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3853.htm
2015-09-15 12:09:39 +02:00
Patrick Niklaus
8e02263084 Fix off-by one error in decoder and make padding deterministic. 2015-09-14 23:01:38 +02:00
Patrick Niklaus
fe0fe1873a Add simplification reset that was accidentally removed 2015-09-11 01:34:10 +02:00
Andreas Gruß
de29574314 tests + instructions for map matching 2015-09-11 01:34:10 +02:00
Lauren Budorick
5ac024788e Parse specific restriction:* tags based on profile exceptions 2015-09-10 15:52:26 -07:00
Patrick Niklaus
a1e273e983 Add switch for handling fallback name 2015-09-10 14:11:18 +02:00
Patrick Niklaus
a95bf64ccf Fix processing for data files with incorrect node references 2015-09-10 12:22:03 +02:00
Daniel J. Hofmann
4fa9022932 Use iterator pair taking parallel_sort, old TBB versions have no range overload. 2015-09-10 11:04:50 +02:00
Daniel J. Hofmann
f10fb77a81 Ownership: vector already owns, no need for wrapping in unique_ptr.
Removes the pointless `std::unique_ptr<std::vector<T>>` usage,
as a `std::vector` already owns its resources and manages them.

Results in one indirection less (hint: good).
2015-09-09 18:53:11 +02:00
Daniel J. Hofmann
db092c828e Don't pass by const-value for a read-only view.
I can't see a reason we pass by const-value here.

Note: changes API because of the `route_parameters` header.
2015-09-08 23:34:20 +02:00
bergwerkgis
bed0598530 AppVeyor: make tests pass again 2015-09-07 19:45:54 +02:00
bergwerkgis
b734d4bbc1 [skip ci] AppVeyor: fail again, if tests fail 2015-09-07 14:43:24 +00:00
bergwerkgis
d2080808db AppVeyor: include osrm.lib in artifact. don't stick to AppVeyor directory structure in build scripts. 2015-09-07 14:26:47 +00:00
Daniel J. Hofmann
345d5e8d9e Make an exception for block barriers in bicycle and foot profile.
This adds `barrier=block` exceptions to the respective white lists.

In addition this adds tests to check for the exception in bicycle and
foot profiles and makes sure cars are still not able to cross them.

Checked with:

    cucumber --tags @barrier -p verify

References:

- https://github.com/Project-OSRM/osrm-backend/issues/1643
- http://wiki.openstreetmap.org/wiki/Tag:barrier%3Dblock
2015-09-07 12:23:21 +02:00
Daniel J. Hofmann
bcc41bf3d1 Fixes undefined behavior from shifting into signed bit; use unsigned literal instead 2015-09-06 01:11:54 +02:00
Daniel Patterson
b2d444d782 Only replace fingerprint file when MD5 changes. Avoids rebuilding several things if nothing has actually changes, as cmake is only looking at timestamps. 2015-09-04 14:07:40 +02:00
Lauren Budorick
bac6703f8e Implement raster source feature to read data from third-party sources, to be used in lua profiles.
* Adds a data structure, RasterSource, to store parsed + queryable data
* Adds bindings for that and relevant data structures as well as source_function and segment_function
* Adds relevant unit tests and cucumber tests
* Bring-your-own-data feature
2015-09-03 22:28:18 -07:00
Daniel J. Hofmann
6cbbd1e5a1 Move destination to access tag white list instead of making exception in car profile.
Tested with:

    cucumber --tags @access -p verify

References:

- https://github.com/Project-OSRM/osrm-backend/issues/1617
- https://github.com/Project-OSRM/osrm-backend/pull/1639
2015-09-03 17:46:20 +02:00
Daniel J. Hofmann
b6ef558c86 Make pedestrian roads marked as destination routable with car profile.
Check provided tests with:

    cucumber --tags @access -p verify

References:

- https://github.com/Project-OSRM/osrm-backend/issues/1617
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dpedestrian
- http://wiki.openstreetmap.org/wiki/Key:motorcar
- http://wiki.openstreetmap.org/wiki/Key:access
2015-09-03 17:46:20 +02:00
Patrick Niklaus
70bb082973 Fix endless loop 2015-09-03 17:02:34 +02:00
Patrick Niklaus
8b8a19c75d Fix failing matching tests due to gps precision 2015-09-03 17:02:34 +02:00
Patrick Niklaus
0b53242564 Move distance calculation out of loop 2015-09-03 17:02:34 +02:00
Patrick Niklaus
f11bd509b0 Also prune on MAX_DOUBLE 2015-09-03 17:02:33 +02:00
Patrick Niklaus
57608628a4 Use median sample time instead of average to harden against outliers 2015-09-03 17:02:33 +02:00
Patrick Niklaus
f167c3e12e Move heap initialization out of loop 2015-09-03 17:02:33 +02:00
Patrick Niklaus
262b380280 Candidate query for match is now only depending on gps_precision 2015-09-03 17:02:33 +02:00
Patrick Niklaus
ee0c20ae44 Fix typo 2015-09-03 17:02:33 +02:00
Patrick Niklaus
c30c144120 Move matching default in route_parameters.cpp 2015-09-03 17:02:33 +02:00
Patrick Niklaus
a5ee82b0d1 Make matching thresholds adaptable to different sample lengths 2015-09-03 17:02:33 +02:00
Patrick Niklaus
a4f558181d Add status field to match plugin response 2015-09-03 17:02:33 +02:00
Daniel Patterson
120303e6e3 Fixed test case that uses the car profile. 2015-09-03 17:01:11 +02:00
Daniel Patterson
b3822d5802 Enable turn penalties on car profile, using values tuned by comparing real-world sample routes with map-matched routes. 2015-09-03 17:01:11 +02:00
Daniel J. Hofmann
980e4ee89a Don't mix signed and unsigned in comparisons as signed is converted first to unsigned.
This is true:

    -1 > 1u

because the integer literal `-1` is first converted to a large unsigned
value and then compared to the unsigned `1`.

This patch fixes several of those isses in the farthest insertion
algorithm.

`-Wsign-compare` catches those issues.

References:

- http://stackoverflow.com/a/5416498
- C++14 standard
2015-09-02 16:33:03 +02:00
Daniel J. Hofmann
bb1428eeb1 Remove unneeded semicola from profiles.
Nothing fancy, does what it says.
2015-09-02 12:23:26 +02:00
Huyen Chau Nguyen
f6a90e9b42 add missing include and clang-format 2015-09-01 15:20:35 +02:00
Huyen Chau Nguyen
a71159667d add cucumber test for the trip plugin 2015-09-01 15:20:35 +02:00
Huyen Chau Nguyen
74e00cf652 fix some small issues:
remove empty unit test

remove compiler directives

move trip related files from routing_algorithms to algorithms

run clang-format on files

fix all std::size_t related issues

improve code by adding std::move()s

clean up includes

fixing several code stye and improvement issues

add several small code improvements

return single scc in SplitUnaccessibleLocations() when theres only one

change ComputeRoute() to return an InternalRouteResult by value

improve some code style issues
2015-09-01 15:20:35 +02:00
Huyen Chau Nguyen
e773a80b06 remove possibility to choose algorithm but only use brute force and farthest insertion 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
e6eea67eeb rename all names with round_trip, trip or tsp to trip to standardize the naming 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
8429a1e792 add assertions 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
47fbd2a2b5 fix json output such that each trip returns a json object with all information of the trip 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
93835b9b94 change input param for tsp algos from a vector to a begin and an end iterator 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
2de3fc9f6f fix GetAdjacendEdgeRange of matrix wrapper for tarjan scc and fix wrongly solved merge conflict 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
78a8cf6982 add a wrapper for the distance table for better access 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
99cf3219d4 have less redundant code for requests with one or multiple SCCs 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
7587e97d46 use typedefs from typedefs.h
return roundtrip result as a return parameter and not as an input parameter
2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
3061c8b854 solve merge conflicts 2015-09-01 15:20:34 +02:00
Huyen Chau Nguyen
77e9e95067 fix bugs
and add todos of code review session with daniel-j-h
2015-09-01 15:20:33 +02:00
Chau Nguyen
6191b6bee2 add parameter to choose algorithm for tsp calculation and remove redundant code 2015-09-01 15:20:33 +02:00
Chau Nguyen
b15f8f68e4 refactor and improve the round trip computation of multiple SCCs
Problem:
- old solution was slow
- depending on the result of TarjanSCC, new distance tables and new phantom node vectors were created to run tsp on it

Solution:
- dont create new distance tables and phantom node vectors
- pass an additional vector with the information which locations are in the same component and ignore all others

fix bug for scc split computation
2015-09-01 15:20:33 +02:00
Chau Nguyen
84c12793e8 clean up some code 2015-09-01 15:20:33 +02:00
Chau Nguyen
6eeadddd4d remove attention on unaccessible locations as we filter them beforehand 2015-09-01 15:20:33 +02:00
Chau Nguyen
a40b3a98dc split algorithms in different plugins for better evaluation
split tsp brute force algorithm for better testing

refactor and clean up
2015-09-01 15:20:33 +02:00
Chau Nguyen
f0d66ff0fb move implementation of algorithms to own hpp in routing_algorithms folder
add changes to improve readability
2015-09-01 15:20:33 +02:00
Chau Nguyen
d3ebd360b2 add brute force algorithm for tsp for small tests 2015-09-01 15:20:33 +02:00
chaupow
ebbe1692c8 add description of farthest insertion algorithm
add farthest insertion algorithm for round trip

farthest insertion: always add the node that add the biggest distance to the total route

farthest insertion: remove total distance computation and compute only diff instead
2015-09-01 15:20:33 +02:00
chaupow
ca7d406787 add timer to check runtime of round trip algorithm 2015-09-01 15:20:33 +02:00
chaupow
a2dc8378f5 rename result_table to dist_table 2015-09-01 15:20:33 +02:00
chaupow
b570e89dbd capsule tsp round trip computation in a private method 2015-09-01 15:20:32 +02:00
chaupow
108f87678a fix bugs and add comments
rename subroute to via_point

merge is_lonely_island and is_connected to make code easier to understand
2015-09-01 15:20:32 +02:00
chaupow
00146ae87c add support for locations that are not reachable as well as information about location permutaton 2015-09-01 15:20:32 +02:00
chaupow
e3757fbbfa add round trip plugin with greedy approximation 2015-09-01 15:20:32 +02:00
Daniel J. Hofmann
ac64e8b15e Remove protobuf dependencies from travis config 2015-08-31 16:57:42 +02:00
Daniel J. Hofmann
c39ca7189b Remove protobuf dependencies from build system 2015-08-31 16:54:22 +02:00
Daniel J. Hofmann
03c8fdd30a Remove protobuf dependencies from docker setup 2015-08-31 16:48:27 +02:00
Patrick Niklaus
788bc67faa Squashed 'third_party/libosmium/' changes from 8bcd4ea..c43f8db
c43f8db Release v2.3.0
44c135f Update README to show dependencies used internally.
ece54cd Add external licenses.
908cd5f Updated change log.
96dbf0e Change %-escape in OPL format.
98f6e27 Change write benchmark to interleave reading and writing.
39620ce Make writing of metadata configurable for XML and OPL output.
e5a4e5e Add debug output format.
597390f Remove superfluous include and pragmas.
ecc57b0 Update pbf reader/writer to use new protozero functions.
5d1e8d2 Update protozero from upstream.
ef8746b Fix build on Windows.
ddba46f Remove superfluous include.
098c57f Add some paranoia checks to pbf reader.
0f804c2 Try building with newer boost library on travis.
6f79d63 Use explicit return types on lambdas.
355f3b1 New PBF reader and writer based on protozero.
71d719b Add pbf writing benchmark.
f014b4c Fix iwyu.sh script: Works now if build directory doesn't exist.
a0ace49 Use utf8cpp header-only lib instead of boost for utf8 decoding.
796f18e Bugfix: Reading large XML files could block.
5a2bcbe Replace strcmp by std::string comparison in test.
bc49e2c Bugfix: XML writer was not writing whitespace correctly.
61222f8 Fix 64bit byte swap.
e56f090 Fix new CRC code on OSX and Windows.
70229aa Add low-level building blocks that allow calculating CRC of OSM data.
0968a66 Remove assert checking for unset version.
62e0261 Refactor test case.
4bfc7fc Allow instantiating osmium::geom::GEOSFactory with existing GEOS factory.
e70af0c Remove calls to protobuf cleanup function im benchmarks and examples.
718518d Bugfix in OPL output. Relation member roles were not encoded.
759d5cb Rename parameter that had the same name as a type.
7054cab Provide (Typed)MemoryMapping constructors for backwards compatibility.
d09f5d1 Fix typo.
b4e578f Make memory mapping utility class more flexible.
633fa8e Travis build without sudo.
7ff23f1 Improved code setting file format from suffix/format argument.
90ef3b9 Remove some tests that didn't test much and failed on FreeBSD.
af86273 Add some pragmas to disable warnings for GCC.
efac7fd Fix some include problems found by IWYU.
79d2f4c Changed add_user() and add_role() in builders. Add add_member().
9375d00 Add function to set tags from ptr + length. Improve TagBuilder tests.
bafca20 Test helper: Use more const and have sub-builders in their own scope.
f73c993 Simplify code.
fee1710 Disable warning only when compiling with GCC.
74402f3 Merge pull request #98 from dforsi/master
2c4b449 Update to new upstream catch.hpp version.
1318732 Release v2.2.0
1873998 Add missing test.
2e5ea1d Do not add timestamp to html doc pages.
1b2ea89 Remove debug output.
0be9599 Improved parsing of ids, versions, uids, etc. from strings.
4308d80 Add second version of split_string utility function.
f18c9e5 Move part of pbf.hpp into new pbf_type_conv.hpp.
d201152 Use new DeltaEncode class in pbf writer.
e205610 Add DeltaEncode/DeltaDecode utility classes.
32905d6 Bugfix: Actually throw the exception we are creating...
d3e86d8 Add functions to convert item_type to zero-based index.
daddf07 Bugfix: Programs writing OSM files can stall up to a second after writing.
00b0247 Add function to set the id of a relation member.
f85316a Fix error message.
19bc6cc Fix name of travis install script.
719cd33 spatialite-bin package now available on travis
cb03821 Shorten long test string (MSVC doesn't like it).
c3440a6 Add BoolVector index class.
da08073 Add min_op/max_op utility functions.
411d112 AppVeyor.yml: new links for binary deps
7d9095f add test for badly formatted timestamps
a073f73 Add helper methods to DiffObject.
3b9819a Add GeoJSON factory using the RapidJSON library.
107bca5 Use a reference instead of a copy.
a6943a4 Mark a few variables that are not changing as const.
51b7e53 Improved error message for geometry exceptions.
5c37a13 Some minor spelling fixes
8ae5723 Bugfix: Dense location store was written out only partially.
5994322 Add support for tiles.
2168bac Add has_map_type() method to map factory.
a9634bd Add more tests for mercator projection.
3c13e4d Add functionality to create simple polygons from ways in geom factories.
e8c5bb1 Use uint64_t as counter, so there can be no overflows.
07fc9b9 libsparsehash-dev now in travis package whitelist
820e112 Add coverage support to CMake config.
5e9f943 Bugfix: Use the right include to really allow any input file type.
d4b48eb CMake: Make version string a cached variable.
e6baccb Add (c)begin/end functions to TypedMemoryMapping. Removed get_addr().
3e32710 Use size() from MemoryMapping in TypedMemoryMapping.
96390db Improve MemoryMapping class documentation.
60a6217 Do not round memory mapped files to page size boundaries.
4907cbe Bugfix: function name.
cac01d8 Use _filelengthi64 on Windows instead of fstat(2).
6a25bdf Windows: Put invalid parameter handler into wrapper class. Re-enable test.
110df9b Add invalid parameter handler on Windows to test.
549ed5f Disable some tests (to find which one fails on appveyor).
a5b8873 Use resize_file() in memory mapping test instead of ftruncate directly.
40e41d3 Use _chsize_s() instead of _chsize() on Windows.
048397e Refactoring: Use low-level util functions in DataFile.
6a033f9 Remove now unused Windows implementation of mmap.
3eccdbb Move dword_hi/lo functions into osmium::util namespace.
be7351b Remove unused code.
b859b18 Make dword_hi/lo functions inline.
2e3bc37 Simplify mmap_vector_base/anon/file.
f819cf3 Always map full pages. Make sure files behind mapping are large enough.
d0c84b6 Add some low-level helper functions for file system access.
62e8d91 Make DataFile constructor explicit.
fba684c Fix memory mapping test for windows.
78a7fd5 Add constructor to DataFile to create tmp file with given size.
f911893 Bugfix: typo.
1cf2739 Add AnonymousMemoryMapping class.
56eac30 Implement MemoryMapping::resize() function.
1a73262 Bugfix: Counter variables were too small.
1ade32c Fix include position.
b03aec3 Fixed some bugs in new DataFile class/tests.
f109534 Add DataFile utility class.
9ed3c43 Fix/cleanup some code.
4f326c9 Fix bug: Copy-and-paste error.
78a5b2f Use reinterpret_cast instead of static_cast to get HANDLE on Windows.
7baa318 Fix typo.
e669069 Make huge value even huger to see if code reliable fails then.
66137ad Improved documentation of MemoryMapping and TypedMemoryMapping classes.
3121393 Add TypedMemoryMapping class.
f45335e Default for get_addr() template type.
685bbaf Remove unused code from tests.
ce65bd4 Fix some issue with new MemoryMapping class.
e7b8e15 Added MemoryMapping wrapper class for mmap() and Windows equivalent.
6b1effe typo fixed
33d479d Refactored travis build.
4348522 Fix xml data test.
769b1e8 Bugfix: Better check for invalid locations.
bba7e68 Appveyor: Disable test failing because of missing dependency.
3d40dc7 Link with /debug on MSVC, add note about LNK4099 warnings.
5ef051f Appveyor: Disable header builds, add benchmarks.
ce7485e Reformat Appveyor config.
c60e505 use shallow clones for faster git fetch
3b18bca Travis cleanups.
b8dfac0 Cleanup travis build.
5f19838 Trying to fix travis gcc build...
d4255a4 Remove -Wno-return-type from recommended options.
5f1a41b Add dump_as_array() function to maps.
ff22f76 Add constructors and begin()/end() functions to VectorBasedSparseMultimap.
c7e05dd Bugfix: Make REGISTER_MAP() macro work when called several time with same name parameter.
abdc317 Bugfix: Mark cbegin() and cend() of mmap_vector_base as const functions.
d81d439 Add close() function to mmap_vector_base class.
d74cff2 Add function on Buffer to get iterator to specific offset.

git-subtree-dir: third_party/libosmium
git-subtree-split: c43f8db50d93912a8bec5cd9fea733f7fec05549
2015-08-28 12:42:03 +02:00
Patrick Niklaus
048be2da2c Merge commit '788bc67faa7738cf7c6b2a192ecf3e3567d1c20e' into develop 2015-08-28 12:42:03 +02:00
Patrick Niklaus
8e1f70865e Use curl instead of http in update script. 2015-08-28 12:40:40 +02:00
bergwerkgis
6143f1ff5b AppVeyor: try "os:VS2015" 2015-08-28 12:15:42 +02:00
Daniel J. Hofmann
db30836b53 Add rising bollard exception to barriers for car profile.
This handles `barrier=bollard` with `bollard=rising`, by making an
exception to the barrier whitelist. Barriers tagged as such do no longer
require an explicit access tag.

This also adds corresponding tests, check this out:

    cucumber --tags @barrier

References:

- http://wiki.openstreetmap.org/wiki/Tag:barrier%3Dbollard
- http://wiki.openstreetmap.org/wiki/Key:bollard
- https://github.com/Project-OSRM/osrm-backend/issues/1616
2015-08-25 14:52:45 +02:00
Daniel J. Hofmann
3e8ef5e462 Remove unused obey_bollards from profiles, already handled via barrier_whitelist. 2015-08-25 14:24:43 +02:00
Lauren Budorick
0a53dccd4c Use .round instead of .to_i for cucumber speeds 2015-08-25 00:06:57 +02:00
Wilhelm Berg
2b5aa142fb appveyor.yml update url to binary deps 2015-08-24 23:29:30 +02:00
Wilhelm Berg
40443d1e25 appveyor.yml update url to binary deps 2015-08-24 21:23:12 +02:00
Daniel J. Hofmann
cb4e7614ee Actually do the subtree pull instead of just notifying the user 2015-08-21 12:16:19 +02:00
Daniel J. Hofmann
3d84dbc73f Check for releases and request user confirmation before updating subtrees 2015-08-21 12:16:19 +02:00
Daniel J. Hofmann
beb2ab9ad5 Add script to update subtree-ed third party dependencies more easily.
Note: this updates the subtrees immediately.

Discussion: would it make sense to do something along the lines of:

    $ http --body https://api.github.com/repos/mapbox/variant/releases/latest | jq ".tag_name"
    "v1.0"

And warn the user if the latest release tag is not the tag the update
script was called with. Or at least ask for confirmation?
2015-08-21 12:16:19 +02:00
Daniel J. Hofmann
9a0877379c Remove dead code. 2015-08-20 16:15:20 +02:00
Patrick Niklaus
bbd0239ece Fix Coverity warning in EBGF 2015-08-20 12:28:14 +02:00
Patrick Niklaus
92956f2b45 Also support loading core information into shared memory 2015-08-19 12:27:44 +02:00
Patrick Niklaus
48d1a5ec5d Make sure to terminate when the core heaps are empty 2015-08-19 12:27:44 +02:00
Patrick Niklaus
2ff2ce460c Add .core to cucumber renaming 2015-08-19 12:27:44 +02:00
Patrick Niklaus
7cc875b8db Initial version of core based search 2015-08-19 12:27:44 +02:00
Patrick Niklaus
9387f583fa Add loading of .core file to InternalDataFacade 2015-08-19 12:27:44 +02:00
Patrick Niklaus
707dd700b0 Write number of markers to .core file 2015-08-19 12:27:44 +02:00
Patrick Niklaus
ddff9b612f Serialize out .core file containing core node markers 2015-08-19 12:27:44 +02:00
Patrick Niklaus
338ac5d4a3 Rename map to describe what it actually does 2015-08-19 12:27:44 +02:00
Patrick Niklaus
ca7abd727a Merge pull request #1603 from Project-OSRM/refactor/clang_modernize
Modernize the code base to C++11 standards and beyond.
2015-08-19 12:26:58 +02:00
Daniel J. Hofmann
62b20769ee Modernize the code base to C++11 standards and beyond.
Apply `clang-modernize` (based on Clang 3.6) transformations to the
codebase while making sure to support Clang>=3.4 and GCC>=4.8.

We apply the transformations in parallel to speed up the quite
time consuming process, and use our `clang-format` style file
to automatically format the code respecting our coding conventions.

We use the following self-explanatory transformations:

* AddOverride
* LoopConvert
* PassByValue
* ReplaceAutoPtr
* UseAuto
* UseNullptr

This required a `compile_commands.json` compilation database, e.g.

    ccmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1

for CMake or check Bear for a Makefile based solution (or even Ninja).

    git ls-files -x '*.cpp|*.h' | \
      xargs -I{} -P $(nproc) clang-modernize -p build -final-syntax-check -format -style=file -summary -for-compilers=clang-3.4,gcc-4.8 -include . -exclude third_party {}

Boom!

References:

* http://clang.llvm.org/extra/clang-modernize.html
* http://clang.llvm.org/extra/ModernizerUsage.html
2015-08-18 12:56:34 +02:00
Patrick Niklaus
4ec323c5cc Merge commit '9958937fd1c1f9dd60126a56e1c4f25ceefaf70e' 2015-08-15 00:11:31 +02:00
Patrick Niklaus
84e72ede72 Warn if an edge references a missing node 2015-08-14 23:57:01 +02:00
Patrick Niklaus
bd37c48596 Add test for mode change 2015-08-12 13:02:18 +02:00
Patrick Niklaus
e30f0e8e11 Always announce a turn on mode change
Fixes #1558
2015-08-12 13:02:18 +02:00
Patrick Niklaus
c43a2513a8 Rename tiny_components.hpp to tarjan_scc.hpp
Fixes #1561
2015-08-12 13:02:18 +02:00
Patrick Niklaus
4b4bc0dde2 Fix postgis lua example
Fixes #1573.
2015-08-12 13:02:18 +02:00
Patrick Niklaus
49adf2192a Move calculate_coordinate to algorithms/
Fixes #1367
2015-08-12 13:02:18 +02:00
Andreas Gruß
a7eabeb73f gps_precision and matching_beta can be used as a float value 2015-08-11 11:06:11 +02:00
Patrick Niklaus
f838f3427b Fix static graph test 2015-08-06 15:09:28 +02:00
Patrick Niklaus
1cc75ca636 Only swap nodes if it contains a big component 2015-08-06 13:20:29 +02:00
Patrick Niklaus
d4356b0453 Move comparators to struct 2015-08-06 11:13:25 +02:00
Patrick Niklaus
35542e5823 Change interface of Tarjan get_component_size to take component id 2015-08-06 11:13:25 +02:00
Patrick Niklaus
c80c2233c5 Find components on edge-expanded graph 2015-08-06 11:13:25 +02:00
Patrick Niklaus
c2f0e4f683 Implement correct const iterator for DeallocatingVector 2015-08-06 11:13:25 +02:00
Patrick Niklaus
2621f4a2fa Allow any input format for StaticGraph and check if edge list is sorted 2015-08-06 11:13:25 +02:00
Patrick Niklaus
3c055642d5 Remove reference to restrictions and bollard nodes because it does not work 2015-08-06 11:13:25 +02:00
Patrick Niklaus
43b881d0cd Simplify test.sh 2015-08-02 14:45:27 +02:00
Patrick Niklaus
8b7b32e225 Added ccmake to docker image 2015-08-02 14:45:27 +02:00
Patrick Niklaus
00b0ff50f3 Add clang and README 2015-08-02 14:45:27 +02:00
Patrick Niklaus
1acde593b5 Fix docker run step 2015-08-02 14:45:27 +02:00
Patrick Niklaus
c43c043521 Add docker port of build instructions 2015-08-02 14:45:26 +02:00
MoKob
b526cadebd Initial version of core ch
This improves preprocessing times in favour of worse query performance.
Core size can be set over the --core parameater, default is the old
behaviour to fully contract the graph.
2015-08-01 18:00:48 +02:00
Patrick Niklaus
94f44e1d5d Make sure to capture floating point return values from lua 2015-08-01 17:46:47 +02:00
bergwerkgis
0352d9c99e AppVeyor: wrong paths when creating artifacts 2015-07-13 14:49:30 +00:00
bergwerkgis
0cd3f37e1b AppVeyor: create artifacts 2015-07-13 16:03:18 +02:00
Patrick Niklaus
486d7b6d62 Fix typo in foot profile that removed traffic lights 2015-07-09 21:24:07 +02:00
Patrick Niklaus
8f4e332409 Link restrictions to datastore test 2015-07-08 20:26:54 +02:00
Patrick Niklaus
f0389c0b2f Restructure CMakeFile to fix shared library linking errors 2015-07-08 18:26:25 +02:00
Patrick Niklaus
922e8a4912 Return the correct size 2015-07-01 18:07:29 +02:00
Patrick Niklaus
021a1c7a39 Restructure the construction of the undirected graph 2015-07-01 18:07:29 +02:00
Patrick Niklaus
4a7451682b Fix data_structure test thanks to new assertion 2015-07-01 18:07:29 +02:00
Patrick Niklaus
faa880d60a Remove unused memebers and rename to currrent style convention 2015-07-01 18:07:29 +02:00
Patrick Niklaus
fd30e82836 Add graph compressor unit tests 2015-07-01 18:07:29 +02:00
Patrick Niklaus
3ef34fbb56 Rename GeometryCompressor and add unit tests 2015-07-01 18:07:29 +02:00
Patrick Niklaus
7345dc6861 Move graph compression code outside of EBGF 2015-07-01 18:07:29 +02:00
Patrick Niklaus
9958937fd1 At least check 4*LEAF_SIZE edges before returning none. 2015-07-01 17:57:03 +02:00
Patrick Niklaus
f19c57200d Fix endless loop 2015-06-30 00:22:40 +02:00
Patrick Niklaus
8a2652f53d Only penaltize bidirectional ways if they have 1 lane 2015-06-27 16:26:18 +02:00
Patrick Niklaus
dddde4ddab Fix backwards speed on oneway=-1 streets 2015-06-27 16:26:18 +02:00
Patrick Niklaus
300d901618 Merge branch 'develop' 2015-06-22 13:06:50 +02:00
Patrick Niklaus
1cb72acd27 Remove unused header 2015-06-22 08:36:21 +02:00
Patrick Niklaus
a17776cb5f Check if FingerPrint is trivial. TODO: Add this for all other data that is going to be serialized 2015-06-19 18:10:49 +02:00
Patrick Niklaus
94b749ab00 Fix magic number check for fingerprint 2015-06-19 17:51:35 +02:00
Patrick Niklaus
5fc0d284cb Revert "Simplify offeset calculation logic a little bit"
This reverts commit 8ade26b4a4.
One of the assertions triggers when run on an extract of Serok. Since
this code does not fix any bugs, I'll just revert this for now.
This definetly needs investigation.
2015-06-19 16:50:48 +02:00
Patrick Niklaus
bbe1211451 Merge pull request #1534 from Project-OSRM/profile/lane-penalty
Profile/lane penalty
2015-06-19 00:25:32 +02:00
Patrick Niklaus
ce152b205f Merge pull request #1535 from Project-OSRM/develop-vs2015
make AppVeyor green again
2015-06-19 00:25:11 +02:00
bergwerkgis
a5fd7cf4e9 make AppVeyor green again 2015-06-18 18:16:51 +02:00
Dane Springmeyer
da38a1367a try building with vs2015 as CTP_Nov2013 appears broken now on appveyor 2015-06-18 18:15:34 +02:00
Patrick Niklaus
1445f11c19 Add test for lane penalty 2015-06-18 17:35:39 +02:00
Patrick Niklaus
86df55f5cc Add penalty if there is only one lane for both directions 2015-06-18 17:31:49 +02:00
Patrick Niklaus
cf294c938e Merge pull request #1508 from agruss/geometry_string
Polyline string as parameter
2015-06-18 16:29:29 +02:00
Patrick Niklaus
ebff45f803 Add new regression test for looping bugs 2015-06-18 00:18:54 +02:00
Patrick Niklaus
7b8021a36e Merge pull request #1531 from Project-OSRM/fix/poland-motorway-bug
Fix/poland motorway bug
2015-06-17 23:25:41 +02:00
Patrick Niklaus
5c77bb7c67 Fix inversion of sign 2015-06-17 23:25:16 +02:00
Patrick Niklaus
8ade26b4a4 Simplify offeset calculation logic a little bit 2015-06-17 23:25:16 +02:00
Patrick Niklaus
bdbc60b4f7 Fix comments in edge based graph factory 2015-06-17 23:25:16 +02:00
Patrick Niklaus
373fa7a7d9 Merge pull request #1502 from agruss/develop
Accepting HTTP Post Request
2015-06-17 23:24:41 +02:00
Lauren Budorick
eec4f173a7 Fix tag misspellings in profiles + tests: forestry, pebblestone 2015-06-09 20:16:58 -07:00
Andreas Gruß
d726ce6340 removed send_simple_request 2015-06-07 12:20:03 +02:00
Andreas Gruß
b406844c96 rearranged send_request parameters 2015-06-07 11:06:37 +02:00
Andreas Gruß
153d38f10c post/get handler added, background section for HTTP request 2015-06-05 13:26:27 +02:00
Andreas Gruß
dce917eb74 post tests via query options available 2015-06-04 17:39:54 +02:00
Andreas Gruß
eb711787ae tests added 2015-06-03 15:31:20 +02:00
Patrick Niklaus
9967dbbaa9 Don't remove small segments at start/begin if they are vias 2015-06-02 17:51:17 +02:00
Patrick Niklaus
71dc10ebea Add failing test case 2015-06-02 16:59:30 +02:00
Andreas Gruß
782fba2ce7 updated to 1E6 based polyline format 2015-06-02 13:15:31 +02:00
Andreas Gruß
4d73f98050 made geometry_string a const reference 2015-06-02 13:06:06 +02:00
Andreas Gruß
79d2083a00 changed parameter from geometry_string to locs 2015-06-02 12:10:28 +02:00
Andreas Gruß
ee3b296a99 fixed values of test 2015-06-02 12:10:13 +02:00
Andreas Gruß
8b62d04453 test added 2015-06-02 12:09:59 +02:00
Andreas Gruß
9b0d3dfaeb polyline string as parameter added 2015-06-02 12:09:46 +02:00
Patrick Niklaus
b1ef4cfee9 Remove debugging code 2015-06-01 17:22:12 +02:00
Patrick Niklaus
f12f6a56ba Fix debug message 2015-06-01 17:22:12 +02:00
Patrick Niklaus
2777d53a12 Direct edges in contractor correctly and add better graph validation. 2015-06-01 17:22:12 +02:00
Patrick Niklaus
aba3ec692f Verify graph before compression 2015-06-01 17:22:12 +02:00
Patrick Niklaus
b7c8fcd062 Also print edge source/target for suspicious edge weights 2015-06-01 17:22:12 +02:00
Patrick Niklaus
3065de63dd Move renumbering and edge deduplication in extractor 2015-06-01 17:22:12 +02:00
Patrick Niklaus
a57fb4f1ab First step into overhauling the edge storage 2015-06-01 17:22:12 +02:00
Patrick Niklaus
c493a22765 Add test case for leisure=track 2015-06-01 11:20:17 +02:00
Patrick Niklaus
d85e5def5d Add running tracks to foot profile 2015-06-01 11:20:17 +02:00
Patrick Niklaus
0aba499c8e Use spaces instead of tabs 2015-06-01 11:20:17 +02:00
Patrick Niklaus
4146695f34 Add test to check new way naming convention 2015-06-01 11:19:27 +02:00
Patrick Niklaus
4e57e10ba8 Use 'name (ref)' if both are present 2015-06-01 11:19:27 +02:00
Andreas Gruß
daa6d02887 Content Type validation added 2015-06-01 09:42:22 +02:00
Daniel Patterson
a87d89302f Handle POST request when spanning multiple packets 2015-05-31 21:34:38 +02:00
Patrick Niklaus
2a9b1311d3 Add test for ignoring crossing nodes 2015-05-30 19:30:33 +02:00
Patrick Niklaus
7d73501b87 Update bicycle profile to ignore crossing nodes 2015-05-30 19:26:56 +02:00
Daniel Patterson
039d6acd3e Fix test case, it was missing 'via' instructions 2015-05-29 16:52:08 +02:00
Daniel Patterson
405fcdc483 We really need to run these tests. 2015-05-29 16:52:08 +02:00
Daniel Patterson
f52abc1a62 When replacing packed_path1/2, also need to replace distance1/2 to properly track. 2015-05-29 16:52:08 +02:00
Daniel Patterson
e763953562 Address #1424 by using the original fix 2015-05-29 16:52:08 +02:00
Patrick Niklaus
4cab617c25 Fix Coverity issue by initializing member 2015-05-29 09:13:28 +02:00
Patrick Niklaus
0190b5e5af Merge pull request #1501 from Project-OSRM/refactor/contractor
First part of the contractor refactor
2015-05-29 01:08:55 +02:00
Patrick Niklaus
abc0952247 Fix accessing DeallocatingVector 2015-05-28 22:22:02 +02:00
Patrick Niklaus
6ce2726a87 Fix return codes for osrm-prepare 2015-05-28 15:18:48 +02:00
Patrick Niklaus
17a4463f59 More assertions 2015-05-28 15:18:48 +02:00
Patrick Niklaus
e76d8df246 Fix tools to build with new graph reader interface 2015-05-28 15:18:48 +02:00
Patrick Niklaus
a46bcf45d5 Move option parsing to own class 2015-05-28 15:18:48 +02:00
Patrick Niklaus
1f985d04a2 Move writing graph to an own function 2015-05-28 15:18:48 +02:00
Patrick Niklaus
d64e6e6c1f Move more function from Run in subfunctions 2015-05-28 15:18:48 +02:00
Patrick Niklaus
1164a65df8 Refactor processing_chain by splitting into sub functions 2015-05-28 15:18:48 +02:00
Patrick Niklaus
d57f07d57e Merge pull request #1500 from Project-OSRM/fix/scc-only-barrier
Enable barrier check for TarjanSCC
2015-05-28 15:17:36 +02:00
Patrick Niklaus
5c0a964321 Remove unused code SimpleNodeBasedDynamicGraph 2015-05-28 12:43:55 +02:00
Patrick Niklaus
cf3b8d09d9 Also run the algorithm tests on travis 2015-05-28 12:43:27 +02:00
Patrick Niklaus
1c7397fb21 Enable barrier check for TarjanSCC
Re-enabling turn restrictions as well requires some further work to
extend the algorithm.
2015-05-28 12:31:59 +02:00
Andreas Gruß
6a08d93e2c http post requests implemented 2015-05-27 15:40:10 +02:00
Patrick Niklaus
4c03ace9eb Remove pruning in IncrementalFindPhantomNode 2015-05-25 02:07:01 +02:00
Patrick Niklaus
2cd616dd30 Merge pull request #1485 from danpat/fix/lua_err_display
Return error message when lua error occurs.
2015-05-22 09:45:26 +02:00
Daniel Patterson
eab87c0827 Return error message when lua error occurs.
The error may not be the first item in the stack while we're inside the error handler.  ::from_stack() works OK outside the error callback, but not inside.
2015-05-21 15:39:23 -07:00
Patrick Niklaus
8b8188710e Merge pull request #1481 from Project-OSRM/fix/no-big-cc-pruning
Only activate pruning for big cc after one was found
2015-05-18 16:18:17 +02:00
Patrick Niklaus
fd9bb3ac43 Only activate pruning for big cc after one was found 2015-05-18 09:41:41 +02:00
Patrick Niklaus
6d9c3bca33 Merge pull request #1478 from Project-OSRM/fix/profiles-cleanup
Cleanup the profiles
2015-05-18 00:09:45 +02:00
Patrick Niklaus
dd33a45644 Revert "fix incorrect behavior when via point was on same one-way street as destination but should have been reached before, closes #1424"
This reopens #1424 but potentially fixes #1429.

This reverts commit 11c671354b.
2015-05-17 23:35:31 +02:00
Patrick Niklaus
074c7a9c40 Fix access module 2015-05-17 17:26:10 +02:00
Patrick Niklaus
de2f06970d Fix missing values and activate fallback names by default 2015-05-16 14:39:49 +02:00
Patrick Niklaus
6166d946f7 Fix access tag check 2015-05-16 14:39:49 +02:00
Patrick Niklaus
c778ab9622 Make bicycle profile backwards compatible 2015-05-16 14:39:49 +02:00
Patrick Niklaus
aad846b968 Fix call to function and transportation if clause 2015-05-16 14:39:49 +02:00
Patrick Niklaus
f04a3e3d2e Fix bicycle profile syntax 2015-05-16 14:39:49 +02:00
Patrick Niklaus
7ad52de2b1 Cleanup the profiles 2015-05-16 14:39:49 +02:00
Patrick Niklaus
0706ba9bec Merge pull request #1457 from Project-OSRM/develop-lua52
Modify profiles to use Lua 5.2+ without needing compatibility flags
2015-05-16 14:29:32 +02:00
Patrick Niklaus
ed53888fce Follow symlinks 2015-05-15 15:30:41 +02:00
Lauren Budorick
fd76fba235 Keep apt-get 5.1 for now 2015-05-15 15:02:23 +02:00
Patrick Niklaus
95088a785a Make using profile.lua work again.
Symbolic links are a _bad_ idea with lua script. Lua will search at the
place of the symbolic link for modules _not_ at the actual location of
the script.
2015-05-15 15:02:23 +02:00
Lauren Budorick
f46b600ec0 Upgrade lua to 5.2 on travis 2015-05-15 15:02:23 +02:00
Lauren Budorick
566ab993df Use lua 5.2+ without needing compatibility flags. 2015-05-15 15:02:23 +02:00
Patrick Niklaus
407036e215 Merge pull request #1476 from Project-OSRM/fix/distance-based-radius
Use distance based search radius
2015-05-15 10:49:19 +02:00
Patrick Niklaus
7b1a5566fb Move nodes inside the search radius 2015-05-15 00:34:53 +02:00
Patrick Niklaus
1b0d8739c1 Increase max distance to 1100 to fix unrelated test cases 2015-05-15 00:34:34 +02:00
Patrick Niklaus
266feea397 Merge pull request #1465 from alex85k/develop
fix cucumber tests running on Windows
2015-05-14 22:25:52 +02:00
Patrick Niklaus
c4c6ab2494 Use distance based search radius
This limits the nearest neighbour search to a maximum distance
of 1000 meters, but will also work in dense areas.
2015-05-14 22:24:07 +02:00
Emil Tin
079eea3f2b add test for route duration formats 2015-05-10 20:09:09 +02:00
alex85k
a457d69034 fix cucumber tests running on Windows 2015-05-09 19:22:16 +05:00
Patrick Niklaus
d0175798bf Add link to documentation in the wiki 2015-05-02 15:18:13 +02:00
Patrick Niklaus
80e07943ee Make README more meaningful 2015-05-02 01:30:44 +02:00
Will White
e2954211ec Fix travis links. 2015-05-01 20:04:05 +02:00
Patrick Niklaus
337bed8176 Merge pull request #1455 from Project-OSRM/fix/cucumber2.0
upgrade to cucumber 2.0
2015-05-01 18:32:26 +02:00
Emil Tin
71197e1c89 remove last use of routing_diff 2015-04-30 18:29:56 +02:00
Emil Tin
e1a13f5ce8 remove obsolete cucumber patch 2015-04-30 18:15:46 +02:00
Emil Tin
1ed2c16a51 upgrade to cucumber 2.0 2015-04-30 18:15:46 +02:00
Patrick Niklaus
12e1bd80b3 Send travis mails to me 2015-04-29 14:00:17 +02:00
Patrick Niklaus
fd6daa580a Merge branch 'develop' 2015-04-22 10:34:56 +02:00
Patrick Niklaus
d2a19ec8ec Merge pull request #1446 from Project-OSRM/fix/sharedmemory-default
Fix/sharedmemory default
2015-04-22 09:50:46 +02:00
Patrick Niklaus
8f3feac916 Ensure routed is backwards compatible 2015-04-22 09:49:08 +02:00
Patrick Niklaus
c0e066440c Use shared memory if no server paths are provided.
This caused a bug in the node bindings that would invoke the constructor
without parameters.
2015-04-22 09:49:08 +02:00
Patrick Niklaus
fbb4e9078a Updated restriction parser doc 2015-04-21 20:00:58 +02:00
Patrick Niklaus
d96e90c6f4 Add documentation to ExtractionContainer 2015-04-21 20:00:58 +02:00
Patrick Niklaus
3b435d8956 Add documentation to ScriptingEnvironment 2015-04-21 20:00:58 +02:00
Patrick Niklaus
345dd2481b Add documentation to InputRestrictionContainer 2015-04-21 20:00:58 +02:00
Patrick Niklaus
006bcc0fc8 Add some documentation to the restriction parser 2015-04-21 20:00:58 +02:00
Patrick Niklaus
c25d14e454 Remove unnecessary header include 2015-04-21 20:00:58 +02:00
Patrick Niklaus
5ff95dc32d Move string_map inside external_callbacks
It is not referenced outside this calls, thus the lifetime
can be safely handled by it.
2015-04-21 20:00:58 +02:00
Patrick Niklaus
34031aab1b Add further documentation to ExtractorCallbacks 2015-04-21 20:00:57 +02:00
Patrick Niklaus
3035219212 Add further documentation 2015-04-21 20:00:57 +02:00
Patrick Niklaus
8a608eb930 Add some doc to the extractor 2015-04-21 20:00:57 +02:00
Patrick Niklaus
c2fc47df34 Merge branch 'develop' 2015-04-17 22:51:40 +02:00
Dennis Luxen
d4065774ce Merge pull request #1440 from Project-OSRM/feature/check_graph_implementations
fix incorrect SCC generation
2015-04-17 09:50:46 +02:00
Patrick Niklaus
6d43d9f2b6 Add unit test for dynamic graph
Also simplify the unit tests.
2015-04-17 00:38:09 +02:00
Patrick Niklaus
94d7fd9112 Adapt osrm-components to new FindEdge interface 2015-04-17 00:25:01 +02:00
Patrick Niklaus
04b5833e98 Adapt EdgeBasedGraphFactory to new FindEdge behaviour 2015-04-17 00:23:58 +02:00
Patrick Niklaus
52592b84fd Add functions to find reverse edge to DynamicGraph 2015-04-17 00:22:51 +02:00
Patrick Niklaus
f2cd68e3ec Return SPECIAL_EDGEID if no edge was found 2015-04-17 00:21:57 +02:00
Dennis Luxen
aff590a44d make implementation of FindEdge consistent among graph implementations, introduce FindSmallestEdge() function to return the edge with smallest weight if there are multiple, fixes #1427 2015-04-16 16:12:08 +02:00
Dennis Luxen
0d432f6377 fix comparison to recognize small components in a static graph 2015-04-16 16:11:06 +02:00
Dennis Luxen
59bceee258 make sure GetNumberOfNodes() is only called once 2015-04-16 16:08:10 +02:00
Dennis Luxen
4a0a0bac1d clear right edge list after graph instantiation 2015-04-16 14:38:42 +02:00
Dennis Luxen
c7bd96ea8b fix unintended signed/unsigned comparison 2015-04-16 14:31:13 +02:00
Dennis Luxen
0eb2106067 reorder includes, add tuple include 2015-04-16 14:30:52 +02:00
Dennis Luxen
c03aec364c add comparison tool for graph classes 2015-04-16 11:25:43 +02:00
Patrick Niklaus
f2cdb97867 Change max distance delta to 200m 2015-04-13 22:39:55 +02:00
Patrick Niklaus
727e284ed0 Reduce map beta, as it fits better to the intended sample rate 2015-04-13 22:39:55 +02:00
Patrick Niklaus
3248977e02 Update classifier parameters 2015-04-13 22:39:55 +02:00
Patrick Niklaus
7ee8776165 Remove second stage classifier: obsolete with trace splitting 2015-04-13 22:39:55 +02:00
Patrick Niklaus
f89f4bd20b Add option to enable json logging 2015-04-13 22:39:55 +02:00
Patrick Niklaus
a372ade7ce Mark suspicious transitions 2015-04-13 22:39:55 +02:00
Patrick Niklaus
61dca4a35e Merge pull request #1433 from Project-OSRM/feature/node-location
Make node location accessible
2015-04-13 16:53:02 +02:00
Dennis Luxen
c0402345f7 Squashed 'third_party/libosmium/' changes from f074d94..8bcd4ea
8bcd4ea Add explicit cast operator from osmium::Timestamp to uint32_t.
0b24814 Fixed the full_queue_sleep_duration const (again).
5e19dd2 Try different workaround for windows...
df5d6c9 Fix build error on Windows.
1553adf Workaround for missing support for u8 string literals on Windows.
aa5e44a Do not build benchmarks in Appveyor to speed up build.
2b22b31 Remove warning generated by assert by casting to largest type.
148c5e3 Fix inclusion of our own css file into doxygen documentation.
13bce6f Split out test thats fails on Windows and do not run it on appveyor.
ca04757 Make CMake add_unit_test() function more flexible.
6c04a63 Tell CMake to output json file with compile commands.
c0dd848 Fix indentation in some tests.
dfa7e4b Formatting: Consistently use spaces around equal signs.
08fe6db Add change log, release version 2.1.0.
667192e Add XML tests.
28acfc7 Make sorting the PBF stringtables optional.
8184781 Fix PBFInputFormat. Use member variable instead of static variable.
2b48945 Fix comment.
6d37054 Rename m_done to m_quit_input_thread to clarify what it is for.
bc23083 Fix race condition in PBF reader.
7fc380e Add various docs, noexcepts, asserts, and tests.
aeaf4d7 Not a good idea to how overbroad patterns in .gitignore.
c1ef2f9 Bugfix: Multipolygon collector was accessing non-existent NodeRef.
0ef9a13 Add noexcept and docs to some functions in NodeRefList class.
da4d764 Workaround for Doxygen bug.
e67d5d9 use absolute paths to osmium in YouCompleteMe configuration
38abeac remove template parameter from NodeRefList
c47adf0 Add check that osm xml file has <osm> or <osmChange> as top-level element.
5e4af90 Updated version number to 2.0.0.
5b2bc3e Workaround in cmake test for sparsehash size.

git-subtree-dir: third_party/libosmium
git-subtree-split: 8bcd4ea771696812bbb08ebc58e3ee22d0538070
2015-04-13 15:44:38 +02:00
Dennis Luxen
9cc68b26e2 pull in latest osmcode/libosmium changes 2015-04-13 15:44:38 +02:00
Dennis Luxen
27c9230a82 pull latest mapbox/variant changes in 2015-04-13 15:37:43 +02:00
Dennis Luxen
e985c9714b Squashed 'third_party/variant/' changes from 3b02ca0..bf485df
bf485df Revert "pass F (functor) by ref/const ref"
e031c53 Revert "pass by const ref in 'apply_const'"
a3014f5 pass by const ref in 'apply_const'
2e0ce4a pass F (functor) by ref/const ref
5875195 add support for 'unwrapping' std::reference_wrapper<T> and accessing std::reference_wrapper<T>::type through get<T>() + update test
c53422f remove boost variant header
5a2d5c5 add reference_wrapper test

git-subtree-dir: third_party/variant
git-subtree-split: bf485dfb59aef26f3ef2183d7c8c1111ad97062b
2015-04-13 15:37:43 +02:00
Dennis Luxen
6c5015811e do not build concurrently on Travis, also build (but not run) benchmarks 2015-04-13 14:43:35 +02:00
Dennis Luxen
86e7de4d62 Merge branch 'revert-1375-master' into develop 2015-04-13 10:07:29 +02:00
Dennis Luxen
147d35e40d Revert "added lua binding for osmium::Way::id()" 2015-04-13 10:04:23 +02:00
Dennis Luxen
b76fc724fd make node id available thru Lua bindings 2015-04-13 09:58:59 +02:00
Dennis Luxen
1bfab4e279 Merge pull request #1375 from bjtaylor1/master
added lua binding for osmium::Way::id()
2015-04-13 09:52:56 +02:00
Dennis Luxen
11bdfba37e traffic signal penalty ignored on white-listed barriers, cf. #1365 2015-04-13 09:47:12 +02:00
Patrick Niklaus
405f08b807 Make node location accessible 2015-04-10 11:45:24 +02:00
Dennis Luxen
592211cecd activate __get_cpuid on all non X64 platform, fixes #1193 2015-04-07 14:45:21 +02:00
Dennis Luxen
a4f31001e8 MSVC doesnt properly support the noexcept operator 2015-04-02 15:11:23 +02:00
Dennis Luxen
c2deedac8b sprinkle a number of noexcepts into the code 2015-04-02 11:36:04 +02:00
Dennis Luxen
9a61f8b894 add more const keywords, avoid implicit type conversions 2015-04-02 11:27:51 +02:00
Dennis Luxen
3a291f5c8e fix escaping of double quote in JSON response, fixes #1410 and also adds a unit test for that case. 2015-04-02 10:34:40 +02:00
Dennis Luxen
559a2dcec7 move shared lib testing to distinct port on travis 2015-03-31 17:33:56 +02:00
Dennis Luxen
b7f003c4aa Merge branch 'opengisch-sharedlib' into develop 2015-03-31 17:33:36 +02:00
Matthias Kuhn
d11c0bbd5c Do not compile Coordinate sources directly into the OSRM library
It is already included in the COORDINATES "OBJECT" target to which the OSRM
library is linked.
This fixes the possibility to build OSRM as a shared library.
2015-03-31 16:57:41 +02:00
Matthias Kuhn
c2f775fcaa Add test for building as shared library 2015-03-31 16:57:41 +02:00
Dennis Luxen
19ac831c2e remove another quoted compare 2015-03-31 12:59:56 +02:00
Dennis Luxen
23b413a398 remove quotes from string compares against variable in CMakeLists 2015-03-31 12:35:20 +02:00
Dennis Luxen
098de196e2 reactivate profiling flags for debug build 2015-03-31 11:21:36 +02:00
Dennis Luxen
27d2c31f28 add (new) fingerprint.cpp that includes the generated headers 2015-03-31 10:47:21 +02:00
Dennis Luxen
c9c9edeb23 deleted: util/fingerprint.cpp.in 2015-03-31 10:46:55 +02:00
Dennis Luxen
5adf792fad fix build issue where cmake does not pick up generated output of a custom target
renamed:    ../util/fingerprint.cpp.in -> ../util/fingerprint_impl.hpp.in
2015-03-31 10:45:35 +02:00
Dennis Luxen
81af7d73a6 make FINGERPRINT a global dependency 2015-03-30 15:55:23 +02:00
Dennis Luxen
23e4e0786d also enable C as a project language 2015-03-30 13:26:06 +02:00
Dennis Luxen
0640ce9632 set project and fingerprint target language to CXX explicitly, fixes AppVeyor build. Potentially Travis, too. 2015-03-30 13:21:03 +02:00
Dennis Luxen
3e49bf4f42 add const keywords where possible 2015-03-30 13:16:22 +02:00
Dennis Luxen
66b038a010 reorder includes 2015-03-30 13:14:13 +02:00
Dennis Luxen
9bbbebf31d use empty() instead of 1>size() to make intent more clear 2015-03-30 13:13:13 +02:00
Dennis Luxen
19765cfa14 remove unneeded include 2015-03-30 13:10:03 +02:00
Dennis Luxen
d6badca610 use lamda function to do complex initialization with a (wanted) side-effect 2015-03-30 13:09:10 +02:00
Dennis Luxen
6933804aa4 remove unused html en/decoding entities, we use JSON now 2015-03-30 12:40:54 +02:00
Dennis Luxen
5bed7f292f add test for printInt() sign correctness 2015-03-30 12:37:39 +02:00
Dennis Luxen
f553896e2d printInt(): fix sign issue when outputting 0, use postfix in/decrement 2015-03-30 12:36:39 +02:00
Dennis Luxen
60663b5433 reorder build dependencies 2015-03-30 11:09:41 +02:00
Dennis Luxen
1851a31e66 add unit tests for functions escape_JSON, printInt and replaceAll in string_util.hpp 2015-03-27 18:15:58 +01:00
Dennis Luxen
d853310bee use range-based for in escape_JSON() function 2015-03-27 18:15:13 +01:00
Dennis Luxen
11c671354b fix incorrect behavior when via point was on same one-way street as destination but should have been reached before, closes #1424 2015-03-27 12:29:29 +01:00
Dennis Luxen
b15599f01e simplify logic to compute edge offset 2015-03-27 12:28:01 +01:00
Dennis Luxen
4b957abc0c fix rounding error/uncertainty on some systems 2015-03-27 12:27:15 +01:00
Dennis Luxen
8ee82d1e03 replace old-style typefs with using 2015-03-23 17:06:10 +01:00
Dennis Luxen
5565662d87 fix compilation with CMake 3.2, closes #1422
CMake 3.2 changed the behavior of add_custom_command and ungenerated dependencies. Replaced with add_custom_target that works on version 2.8+
2015-03-23 16:14:24 +01:00
Patrick Niklaus
78735fae6b Fix match test by using the new threshold 2015-03-18 00:21:04 +01:00
Patrick Niklaus
d3b9911445 Fix match geometry output 2015-03-17 23:50:59 +01:00
Patrick Niklaus
7813dafc96 Increase the time split threshold to a more reasonable value 2015-03-17 23:50:47 +01:00
Patrick Niklaus
02b561edd2 Pass route leg by reference, not by value 2015-03-17 23:24:31 +01:00
Dennis Luxen
272a1fda54 Merge pull request #1407 from Project-OSRM/feature/matching
Map Matching
2015-03-10 06:08:11 -07:00
Patrick Niklaus
bc8666df83 Add tests for matching 2015-03-08 01:32:13 +01:00
Patrick Niklaus
028fad94af Fix overflows when handling size_t 2015-03-08 00:53:15 +01:00
Patrick Niklaus
0c735953c9 Make uturn detection a little less sensitive. 2015-03-08 00:51:07 +01:00
Patrick Niklaus
736bc87480 Fix inverted operator in maximum check 2015-03-07 23:02:14 +01:00
Dennis Luxen
dd94a64048 remove lint from #1409
- fix copyright header
- remove dead code
2015-03-05 14:03:35 +01:00
Dennis Luxen
cf9f88f8ce Merge pull request #1409 from RockLobster/develop
FIX: Moved the GeometryCompressor's free_list_maximum into a member variable of the class.
2015-03-05 14:02:34 +01:00
RockLobster
5694aeda5f FIX:
Moved the GeometryCompressor's free_list_maximum into a member variable of the class.
(+UniqueNumber() commented out since it is not being used anywhere in all of OSRM)

There was absolutely no need for free_list_maximum to be a static variable and it caused major issues in my code.
Short description:
- I ran osrm-prepare's Prepare().Process(..) function in my own code multiple times for multiple files
	=> After the first file is done, free_list_maximum is still on the same size, but a new GeometryCompressor will start at a size of 100 again.
	=> Indices broken.
2015-03-05 11:30:52 +01:00
Patrick Niklaus
7829e3c132 Add step definition and support code for matching 2015-03-05 00:12:26 +01:00
Dennis Luxen
2ce0d60db1 Squashed 'third_party/libosmium/' changes from 6522da5..f074d94
f074d94 Use shorter path names in Doxygen doc.
5117d5a Make Doxygen-generated HTML docs work better on small screens.
41607ac Appveyor config: Use lowercase command names everywhere. Filter 7z output.
9e77a39 Remove debug output.
3416c4b Revert "Comment out test to see if there are dependencies between tests."
fa49dde Comment out test to see if there are dependencies between tests.
5add75d Fix typo in appveyor conf: nul.
53b3778 Use different file names for tests.
1091c0b Fix Windows munmap() to return the same as the posix one.
14fdc4e Revert "CMake: Remove unneeded build type setting."
0270087 Workaround for MSVC.
56c2120 Another try...
8e96a6f Trying to fix test on Windows...
11a64c2 CMake workaround: Set CMAKE_CONFIGURATION_TYPES before project(). As per http://www.cmake.org/pipermail/cmake/2012-January/048856.html
3847e7a CMake: Remove unneeded build type setting.
a1bcaf1 CMake: Make CMAKE_CONFIGURATION_TYPES a cache variable.
ddab3e3 Create test file in test_typed_mmap in current dir instead of tmp.
ce1d3bd Build "RelWithDebInfo" on appveyor instead of "Release".
b6db34f Add README showing source of FindGem.cmake.
2c86c55 Better error message and some comments in CMake for sparsetable check.
b16a5a3 Fix ctest on Windows.
2203bc8 Fix FindGem.cmake.
5d1f81d Another try to fix travis build.
ddd3f5e Hopefully fix problem where travis doesn't find osm-testdata.
0e673ea More debug output to find travis problem.
eb01107 Updated data-tests README.
8a971c8 Remove special case of the multipolygon test in travis/appveyor config.
dce792c CMake: Check dependencies of multipolygon test and run as CMake script.
b967677 Add tests for thread pool.
400e9b3 Bugfix: Handle exception in one pool threads properly.
a1ba489 More detailed error reporting from zlib.
95cf621 Disable SparseMemTable if sparsetable size_type is smaller than 8.
7b601b5 Add missing overload to cast_with_assert() function.
60a7d86 Giving up on trying to remove LNK4221 warning.
35ed5df Try another way to get rid of MSV warning...
f9c7d92 Disable a warning about changed behaviour on MSVC.
c3c6b2d CTest: Only output failed tests.
9c99996 Try setting option in a different way for getting rid of LNK4221 on MSVC.
4ac563c Another ssize_t fix for Windows.
11db84f Fix mmap for windows. Convert macro to function.
95d8f75 Fix test on Windows (which doesn't have ssize_t).
df51aa4 Do not write huge files in one system call.
9c4f772 Change mmap() implementation for Windows.
5be817c Rewrote function to work on Windows without warnings.
ea84f73 Fix warnings on Windows.
572d692 Fixed the static_cast_with_assert function and added tests.
89ef86b Use SparseMemArray instead of SparseMemTable in examples.

git-subtree-dir: third_party/libosmium
git-subtree-split: f074d949a5585a81578d682035f2163de971beb3
2015-03-04 12:50:42 +01:00
Dennis Luxen
68e66dad06 upgrade libosmium dependency 2015-03-04 12:50:42 +01:00
Dennis Luxen
80db907857 upgrade variant dependency 2015-03-04 12:48:19 +01:00
Dennis Luxen
76674a3594 Squashed 'third_party/variant/' changes from 24dcab2..3b02ca0
3b02ca0 add which() method returning zero based index of stored T in Types... for boost::variant() compatibility
c117592 update unit test to match c64c74775a80474f2012c1a49ab2865e3666107a
36f1e12 add get<T>() overloads for when T is stored in recursive_wrapper<T> also makes get<T>() a compile time error where T is not in Types... (ref #24)
7dfdfa2 clean up coverage files in test directory too [skip ci]
89f8a41 add coverage report

git-subtree-dir: third_party/variant
git-subtree-split: 3b02ca0e3ab1a36dd6ec9138e7f93eb3176ae5f7
2015-03-04 12:48:18 +01:00
Patrick Niklaus
98dba11c5e Address some of the remaining issues of the code review 2015-03-04 01:34:45 +01:00
Dennis Luxen
de261d28ef add override specifier 2015-03-03 18:26:38 +01:00
Dennis Luxen
d43716612b several copyedits to brush up code
- remove unneeded includes
- replace size() <==> 0 comparisions with calls to empty()
- use fp instead of integer literals
- use range-based for loops with integer ranges
- add a couple of consts
2015-03-03 18:17:12 +01:00
Dennis Luxen
cfaacf7cb2 put util/compute_angle.cpp into OBJECT library to avoid repetetive compiles 2015-03-03 17:58:17 +01:00
Dennis Luxen
b9922bc90b replace C-style comments 2015-03-03 17:43:37 +01:00
Dennis Luxen
31cae8f05f several copy edits to brush up the code
- fix copyright header
- rename probabilityDensityFunction -> density_function
- use double-precision fp literal to indicate intent
- remove redundant enum class start value
- replace C-style comments with C++ style
- make functions const
2015-03-03 17:42:07 +01:00
Dennis Luxen
133e382aae remove constexpr qualifier as numeric_limits is not yet constexpr on MSVC compiler 2015-03-03 14:43:38 +01:00
Dennis Luxen
e02c721c2b further untangle model from functionality and put classes into seperate headers
- move get_network_distance() into routing base class
- don't reallocate queues every time but clear them. Should be cheaper
2015-03-03 14:22:52 +01:00
Dennis Luxen
5af0ceb2d2 use range based for loop 2015-03-03 14:22:27 +01:00
Dennis Luxen
6460fdc62b use std::size_t for timestamps to avoid implicit casts, use range-based for loops 2015-03-03 13:03:00 +01:00
Dennis Luxen
402ca780bf fix test expectation osrm-routed help output 2015-03-03 12:56:37 +01:00
Dennis Luxen
643ab92cd2 fix default value for max_locations_map_matching 2015-03-03 12:55:42 +01:00
Dennis Luxen
a9c3b343fc separate model and computation in HMM matching 2015-03-03 12:48:33 +01:00
Dennis Luxen
592bebaf29 renamed: plugins/map_matching.hpp -> plugins/match.hpp to avoid confusion with routing_algorithms/map_matching.hpp 2015-03-03 12:01:40 +01:00
Dennis Luxen
4df215e674 replace -std::numeric_limits<T>::max() with ::lowest() 2015-03-03 11:53:31 +01:00
Dennis Luxen
91792f45ea fix compilation
- missing new 10th parameter to GenerateServerProgramOptions
2015-03-03 11:50:37 +01:00
Dennis Luxen
20091e94c8 fix compilation
- remove wrong comments
- fix include guard footer
- add curly braces
- add template specialization for std::vector<bool> in make_array
- reformat
2015-03-03 11:50:02 +01:00
Dennis Luxen
76aa494be4 fix compilation
- std::log and M_PI are not constexpr's by the standard. replace by a constant
- reformat
2015-03-03 11:48:15 +01:00
Dennis Luxen
6fb8fdc2bd fix compilation
- define max_number_of_candidates where its used
- add curly braces
- reformat
2015-03-03 11:46:24 +01:00
Patrick Niklaus
0d879ed290 Split trace if timestamp delta is over threshold
Even when matching is not broken we split the trace, if the
sampling frequency goes below 2 samples/minute.
2015-03-03 00:48:57 +01:00
Patrick Niklaus
d8d46e0f3e Add routed parameter to limit matching size 2015-03-03 00:48:57 +01:00
Patrick Niklaus
e5830b0116 Add parameters for map matching 2015-03-03 00:48:57 +01:00
Patrick Niklaus
d89b171f49 Simplify json code in map matching plugin 2015-03-03 00:48:57 +01:00
Patrick Niklaus
a760aec791 Add json logger to map_matching
This adds additional data to the json response, when OSRM is compiled
in debug mode.
2015-03-03 00:48:57 +01:00
Patrick Niklaus
34d5d353af Apply clang-format and split out json_util 2015-03-03 00:48:57 +01:00
Patrick Niklaus
e8e637c4f2 Replace descriptor code with code that generates only geometry 2015-03-03 00:48:57 +01:00
Patrick Niklaus
adbca39fef Fix include guard 2015-03-03 00:48:57 +01:00
Dennis Luxen
a2c88b607f lint corrections
- fix license header
- let shared_ptr autodestruct as it's shared
- rename fences to resemble file names
- reorder includes into lexicographic order
2015-03-03 00:48:57 +01:00
Patrick Niklaus
2115a67d24 Link libOSRM with compute_angle 2015-03-03 00:48:57 +01:00
Patrick Niklaus
dec73b02e9 Rename traces to matchings in response 2015-03-03 00:48:57 +01:00
Patrick Niklaus
0e6ed53cee Adapt to JSON container rename 2015-03-03 00:48:57 +01:00
Patrick Niklaus
fd6c70afe1 Fix regression in sub-matching length check 2015-03-03 00:48:57 +01:00
Patrick Niklaus
c4f193b13e Fix comment 2015-03-03 00:48:57 +01:00
Patrick Niklaus
70703c39f3 Add timestamp parameters and reset to beginning of breakage 2015-03-03 00:48:57 +01:00
Patrick Niklaus
d429485f0c Fix stupid error in backtracking 2015-03-03 00:48:57 +01:00
Patrick Niklaus
89460dd39c Return indices instead of points 2015-03-03 00:48:57 +01:00
Patrick Niklaus
f46b259384 Fix splitting traces 2015-03-03 00:48:56 +01:00
Patrick Niklaus
fb0ce48f2f Simplify matching response 2015-03-03 00:48:56 +01:00
Patrick Niklaus
cb4a81008c Split traces into subtraces 2015-03-03 00:48:56 +01:00
Patrick Niklaus
d620da365e Implement more general pruning 2015-03-03 00:48:56 +01:00
Patrick Niklaus
0c3102721c Make number of candidates a parameter 2015-03-03 00:48:56 +01:00
Patrick Niklaus
b3fa03043d Calculate the real route length for classification 2015-03-03 00:48:56 +01:00
Patrick Niklaus
38d7db49c8 Add state position to debug output 2015-03-03 00:48:56 +01:00
Patrick Niklaus
1a8c832039 Update format of debug json ouput 2015-03-03 00:48:56 +01:00
Patrick Niklaus
6e54f8cfa6 Tighter threshold on low probability transistions 2015-03-03 00:48:56 +01:00
Patrick Niklaus
4838ffb82d Fix nan values if matched to single point 2015-03-03 00:48:56 +01:00
Patrick Niklaus
1bcf41d382 Prune low probability transitions 2015-03-03 00:48:56 +01:00
Patrick Niklaus
e381566494 Eliminate branch 2015-03-03 00:48:56 +01:00
Patrick Niklaus
66d7a073d3 Move splitting candidates to plugin 2015-03-03 00:48:56 +01:00
Patrick Niklaus
0637215b85 Skip computing viterbi if viterbi of previous state is lower than lower bound
This causes a speedup of 300%.
2015-03-03 00:48:56 +01:00
Patrick Niklaus
dc1405ffa8 Fix typo in debugging code 2015-03-03 00:48:56 +01:00
Patrick Niklaus
0fce20c503 Directly compute log probabilities 2015-03-03 00:48:56 +01:00
Patrick Niklaus
1b16dd126b Actually compute and transmit confidence in the response 2015-03-03 00:48:56 +01:00
Patrick Niklaus
fe07f9208c Add bayes classifier 2015-03-03 00:48:56 +01:00
Patrick Niklaus
f092fc3fc6 Fix minimum number of candidates 2015-03-03 00:48:56 +01:00
Patrick Niklaus
b5228dcda0 Detect possible uturns in the data.
To make them work, we have to disable PhantomNode splitting
for this coordinates.
2015-03-03 00:48:56 +01:00
Patrick Niklaus
a5db3ea25b Print warning when more than 10 points are removed 2015-03-03 00:48:56 +01:00
Patrick Niklaus
173fad2362 Return error when less than 2 points left. 2015-03-03 00:48:55 +01:00
Patrick Niklaus
496338d84d Implemented pruning and breakage detection 2015-03-03 00:48:55 +01:00
Patrick Niklaus
59727a6967 Get all nodes in dense areas but make sure we don't underflow in sparse ones 2015-03-03 00:48:55 +01:00
Patrick Niklaus
3a5e41ed91 Implement missing matching pieces 2015-03-03 00:48:55 +01:00
Dennis Luxen
2259bce05f Add skeleton code for matching 2015-03-03 00:48:55 +01:00
Dennis Luxen
7e00a86bb4 implement ISO 8601 durations parsing, cf. #1399 2015-03-02 17:18:52 +01:00
Dennis Luxen
73a2a938b4 use CRTP instead of virtual functions in routing plugins 2015-03-02 11:55:55 +01:00
Dennis Luxen
c2098938f5 add convenience variadic template function to append elements to a container 2015-02-27 13:52:58 +01:00
Dennis Luxen
773ff182ee fix license header 2015-02-26 18:54:13 +01:00
Dennis Luxen
878c49e4e1 fix incomplete implementation of movable bridges in bike profiles, plenty of regressions 2015-02-26 17:17:43 +01:00
Dennis Luxen
023dd3e880 fix regression in bike profile 2015-02-26 16:44:26 +01:00
Dennis Luxen
6b88856c16 add support for movable bridges in the biking profile, cf #1399 2015-02-26 16:28:04 +01:00
Dennis Luxen
dd5f926077 respect capacity:car for movable bridges in car profile 2015-02-26 16:22:18 +01:00
Dennis Luxen
845020b0e2 remove debug output 2015-02-26 16:17:42 +01:00
Dennis Luxen
7cf363eb06 reorder includes, fixes style regression from commit fdf2e59. 2015-02-26 16:09:48 +01:00
Dennis Luxen
f67e670621 Merge pull request #1400 from Project-OSRM/feature/bridge_movable
add movable bridge support to the car profile. Implements #1399
2015-02-26 15:58:30 +01:00
Dennis Luxen
645e3ccbb3 add movable bridge support to the car profile. Implements #1399 2015-02-26 14:56:01 +01:00
Dennis Luxen
ab385f2bf5 Merge pull request #1396 from RockLobster/develop
Small change in order to be able to use OSRM as submodule in other projects
2015-02-26 11:07:24 +01:00
Dennis Luxen
5080b9a82b Merge pull request #1397 from Project-OSRM/escape-fix
JSON string escape fix
2015-02-26 11:05:59 +01:00
Dennis Luxen
51e42ded44 - output only get escaped when actually output. Better seperation of functionality
- refactor facade::GetEscapeName() into get_name_for_id() call that is implemented in subclasses
- remove dead code
- fix failing tests where names got double-escaped
- fixes https://github.com/Project-OSRM/node-osrm/issues/83
2015-02-26 10:11:33 +01:00
Dennis Luxen
37fb89c691 add size() call to integer range 2015-02-26 10:10:19 +01:00
Patrick Niklaus
440eda3807 Escape string in json renderer 2015-02-25 21:11:02 +01:00
RockLobster
bad2576397 Replaced CMAKE_SOURCE_DIR in osrm root dir's cmake file with CMAKE_CURRENT_SOURCE_DIR
=> Allows osrm to be used as a subproject aswell
2015-02-25 18:25:03 +01:00
Patrick Niklaus
fdf2e5934d Add algorithm include for any_of 2015-02-24 20:29:43 +01:00
Dennis Luxen
3da1e8598b fix copyright year 2015-02-24 14:36:38 +01:00
Dennis Luxen
0296c767bf fix code-format regression 2015-02-24 09:08:59 +01:00
Dennis Luxen
c215c42289 Merge pull request #1390 from Project-OSRM/feature/width_penalty
implements a penalty for very narrow roads
2015-02-24 08:56:11 +01:00
Dennis Luxen
8adab95973 refactor iterator range utility class 2015-02-20 11:59:03 +01:00
Dennis Luxen
b89c7580e6 implement scaling for narrow roads as an alternative expected speed and take the minimum. Follows @emiltin's idea. 2015-02-20 10:33:14 +01:00
Dennis Luxen
a85fe2cb08 remove debug output, thx @emiltin 2015-02-20 10:33:14 +01:00
Dennis Luxen
4c4c126361 implements a penalty for very narrow road:
- implements discussion of #1388
- implements basic test cases
2015-02-20 10:33:14 +01:00
Patrick Niklaus
e9e12b88f8 Add CORS Content-Type HTTP header flag
Firefox needs this for JSON.
2015-02-20 00:36:36 +01:00
Dennis Luxen
dc08c516bf use std::tie() to simplify lexicographic comparisons 2015-02-19 19:15:16 +01:00
Patrick Niklaus
9b1f108051 Allow CORS requests in osrm-routed. 2015-02-19 10:42:45 +01:00
Dennis Luxen
b0f9a0feb4 rename variable name to be a little more telling 2015-02-19 10:11:49 +01:00
Dennis Luxen
3bd27ae8c5 change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
Dennis Luxen
79b9bdf7ce rename JSON namespace to osrm::json to avoid namespace clash with V8 2015-02-18 17:27:31 +01:00
Dennis Luxen
9e09168597 un-lint CMakeLists.txt 2015-02-16 14:18:04 +01:00
Dennis Luxen
e5f12347bd simplify code by using new phantom node ctor 2015-02-13 14:26:19 +01:00
Dennis Luxen
86d3556c6d add ctor that converts from rtree segment to phantom node 2015-02-13 14:24:05 +01:00
Dennis Luxen
45838b33b7 avoid implicit conversion to int 2015-02-12 15:40:55 +01:00
Dennis Luxen
a1d4798ded refactor AlternativePathRouting step to have the same interface semantics regardless of search direction 2015-02-12 15:03:53 +01:00
Dennis Luxen
25c52b7482 rewrite sort/unique function to be more generic 2015-02-12 15:02:16 +01:00
Dennis Luxen
fcf9f266ad Merge pull request #1381 from neilbu/develop
Made the request parser a member of the Connection
2015-02-12 14:26:48 +01:00
Neil Buckman
fa638ae3a0 Removed debug logging 2015-02-12 09:55:13 +00:00
Neil Buckman
6d9cd504a0 Made the request parser a member of the Connection
Previously, the request parser was created on demand...but this could
cause requests to be flagged as bad requests if the string length was
large enough to cause the string to be split up into chunks by boost's
read_some method.
2015-02-12 08:01:46 +00:00
Dennis Luxen
f9e9bb8870 update slack channel 2015-02-11 13:22:18 +01:00
Dennis Luxen
85ab2425a8 move travis notifications to slack 2015-02-11 11:47:25 +01:00
Dennis Luxen
9931155c68 port make_unique from libcxx 2015-02-10 18:02:23 +01:00
Dennis Luxen
56b6d928b6 add include to be self-sufficient 2015-02-10 12:34:13 +01:00
Dennis Luxen
b865bea482 fix floating point comparison, remove superflous inline keywords 2015-02-10 12:29:52 +01:00
Dennis Luxen
b6314e0c73 remove unnecessary casts in debug build 2015-02-10 12:27:27 +01:00
Dennis Luxen
2c773750c7 fix const correctness 2015-02-10 12:26:57 +01:00
Dennis Luxen
539b9be1d3 fix warning: use of old-style cast 2015-02-10 12:12:05 +01:00
Dennis Luxen
00e8caa0e3 fix signed/unsigned comparisons and casts 2015-02-10 12:08:17 +01:00
Dennis Luxen
1ff8b62bf5 fix warning: extra ';' after member function definition 2015-02-10 12:03:23 +01:00
Dennis Luxen
25fb985af8 fix warning: use of old-style cast 2015-02-10 12:02:13 +01:00
Dennis Luxen
858245db7d fix warning: implicit signed/unsigned warning 2015-02-10 11:58:56 +01:00
Dennis Luxen
09bea2ad5b fix warning: implicit float/double cast 2015-02-10 11:32:39 +01:00
Dennis Luxen
adb520ec2a fix old-style casts 2015-02-10 11:31:36 +01:00
Dennis Luxen
5a1ff4b50d fix warning: implicit conversion changes signedness: 'int' to 'unsigned int' 2015-02-10 11:09:51 +01:00
Dennis Luxen
e0f8acf733 make constant a float to avoid implicit cast 2015-02-10 11:04:49 +01:00
Dennis Luxen
a81542eeee add virtual keyword to functions with override final specifiers 2015-02-10 10:07:35 +01:00
Dennis Luxen
f67eeb66aa untangle includes using iwyu 2015-02-09 17:38:40 +01:00
Dennis Luxen
884c998622 Squashed 'third_party/variant/' content from commit 24dcab2
git-subtree-dir: third_party/variant
git-subtree-split: 24dcab23c4f70e54838e4a32a228aba8045ae17b
2015-02-09 15:19:35 +01:00
Dennis Luxen
88c8d73a94 Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
Dennis Luxen
86576768d1 remove manually add variant dir 2015-02-09 15:19:19 +01:00
Dennis Luxen
3327c32b20 remove useless parantheses 2015-02-09 14:09:09 +01:00
Dennis Luxen
97ed6a3a4e remove method stubs 2015-02-09 14:06:14 +01:00
Dennis Luxen
85d8e0ac2c minor reformat 2015-02-09 09:21:44 +01:00
Dennis Luxen
2a68f9f532 rename variable name 2015-02-06 11:58:41 +01:00
Dennis Luxen
b55d35c7bb remove a number of useless parentheses 2015-02-06 09:54:34 +01:00
Dennis Luxen
98f85d7728 remove some lint in variable names 2015-02-05 18:33:21 +01:00
Dennis Luxen
328a7caf61 rename short variable names to be more telling 2015-02-05 17:54:32 +01:00
Dennis Luxen
275ea9b0bb mark GetTravelModeForEdgeID as override final 2015-02-05 15:20:15 +01:00
Dennis Luxen
bb78bc8fe3 Squashed 'third_party/libosmium/' changes from 910f8f1..6522da5
6522da5 Merge pull request #79 from DennisOSRM/master
7c8d8dc add override keyword to close(), overridden function in include/osmium/io/detail/input_format.hpp
d24841e Changes copyright dates in all files to a consistent "2013-2015".
3adc7d7 Another try to make it compile on Windows.
20dad8e Use auto instead of hard-coded types, hopefully fixes Windows build.
b73ab3f Set build config in appveyor ctest call.
3e33857 Merge pull request #76 from BergWerkGIS/master
c78ca6e Merge remote-tracking branch 'upstream/master'
cf42013 enable test again
69e4a91 include compatibility.h
6f79b5c CMake: Remove Dart include, it seems to be superfluous.
4d40a18 Explicitly set copy constructors etc. for OutputIterator and test it.
69ee34c Run tests in build directory instead of source directory.
11c44c8 Fix typo.
675cc11 Fix formatting CMake config.
7aa3cb0 Add a benchmark counting amenity=post_box tags.
89fd942 Make it more evident that we handling constant tag lists.
c72bbdf Add count() and empty() functions to Filter class.
88b9543 Disable annoying warnings from YouCompleteMe.
6cec403 Benchmarks: Only find files, not directories etc. in data dir.
09c4630 Follow redirects in benchmark download script.
a8a552e Use Approx() function from Catch framework for floating point comparisons.
7db5086 Reorder data tests so fast tests run first.
24ce403 Fix #includes.
ad9515c Add some comments in different config files to explain what they are.
987aa9c Some README updates.
3c18de7 Add configuration for YouCompleteMe Vim plugin.
433148e Explicit comparison against 0 to avoid warning with MSVC.
e64a459 Small updates in benchmarks README.
e4aff7f Add benchmark to compare static vs. dynamic index maps.
f702634 Add missing include.
95a8c3b Merge branch 'master' of github.com:osmcode/libosmium
560a2ae Merge pull request #73 from osmcode/travis-fix
f41e4ca remove incorrect cd
f826107 Add some helper functions for working with entity_bits.
8fec1c1 Updated README: Lots of documentation is now on wiki.
6110cc8 Make cmake config work if no components are given.
8136557 Use 'Libosmium' instead of 'Osmium' as project name in doc.
10e631a Improved documenation: Dependencies to link with.
41d0ca4 Merge remote-tracking branch 'upstream/master'
6768026 SLN configuration is always 'Release'
5d985cf av: show env vars.
272ac88 don't use '%CONFIGURATION%' expands to e.g. 'Dev|x86'
59b15eb use cmake 3.1.0 again. old cmake on AppVeyor doesn't know yet about VS2014 SLN
0d0d71a try building with VS, Dev works only with VS at least locally
2fe6d02 name of geos.lib changed
fc4662e test latest binary package
d4a265f Add more labels to tests.
8722a3d Only check for valgrind if testing is enabled.
cf7dc56 README improvements.
13a426e Fix cpack configuration.
ae649c8 travis build: fix double install of make package
c102040 Move cmake config for documentation into doc directory.
6064d55 Also list advanced cmake variables in travis build.
c299bfa constexprt workaround for MSVC.
afcf7a1 Cleanup/formatting of cmake config.
a536720 Fix travis build by cloning osm-testdata in the right place.
2bdbf7f cmake: Don't clone osm-testdata repository any more.
5bdbb28 Rename test/osm-testdata to test/data-tests.
0ad0020 cmake: build data tests only by default on Dev builds
2cefa50 Add some benchmarks.
3fdb6e1 Remove outdated make_osmium_project.sh script.
aca58ac Fix cmake config: overwriting of variables.
152e318 Fix compilation of examples that need wingetopt on Windows.
ae17cd0 Remove superfluous warning on Windows for header test builds.
f88d4c2 Switch to /W3 on Windows.
8edeba5 Remove duplicate copy constructor.
cdb474e Cleanup examples cmake config
ca9045a Cmake cleanup.
501eb61 Update to new version of catch unit test framework.
0646d6c Parenthesize expression to make test clearer and avoid warnings.
dfdaeae Disable a warning that gdal throws on Windows.
eacfe4f Explicitly test int !=0 to convert to bool.
b3ba693 Cleanup of cmake config (mostly warning options Linux vs. Win)
3f5cb81 Appveyor: Also show advanced cmake variables.
b544bd9 Never return valid but empty buffer from Reader.read() call.
a34bb5d Declare var in a more local scope.
b83e5f1 Merge pull request #66 from BergWerkGIS/master
04ef1b2 Last try for today, should solve geos test failures
a749d6c hey AppVeyor: what's going on?
73131fb av: boost not found?? show directory tree
5e02886 av: should solve most "***Exception: Other" except for geos.dll related problem. should solve projection test fails.
a7ae560 FlexReader now takes location handler as parameter.
6f1bd8d Disable non-existing Debian build in Makefile.
3d75178 Change warning level on MSVC.
3f0abc0 Appveyor: List cached variables from cmake.
d1e1e9f Travis/Appveyor build in Dev and Release mode. Call ctest on Appveyor.
116bcc9 Fix default node location store.
dedfe0e Make classes we submit to queue properly copyable.
8a432c9 Try the same ugly hack on OPLOutputBlock.
9c5b314 Try a hack to see whether it works on MSVC.
9592132 Give XMLOutputBlock a copy constructor.
991f91a Disable warning C4715: "not all control paths return a value"
340a4d7 Fix copy constructor.
7ceae00 Give OPLOutputBlock a copy constructor which basically does a move.
e82951a Use rvalue as paremeter for queue submit function.
54a9cec Use explicit cast to double to silence warning.
7c5d04c Simplified use of ogr includes.
43fd388 Use appveyor supplied cmake.
ce4311e cmake cleanup.
1108517 Disable warnings from MSVC in OGR headers.
2fe820c Harmonize signature of virtual member function dump_as_list().
93c31b4 Parenthesize string in pragma message.
54ae1a0 Explicitly int to bool conversion to silence warning on MSVC.
4bde9b7 Formatting: Use spaces instead of tabs.
7224d84 cmake: Don't try to set C++ version with -std= with MSVC.
53fbcfd Remove trailing semikolon (which gcc doesn't like).
3b0c9ed Removed command that doesn't work on older cmakes.
de6cc78 Merge pull request #62 from BergWerkGIS/master
9126530 Use less warning options on Windows.
6ec79fb Silence unknown pragma warning on Windows.
b611589 Add static_cast to silence warning on windows.
18e54e9 remove call to build2.bat
b0d9d28 try again with -DCMAKE_BUILD_TYPE=Release
b495018 usage installed cmake, -DCMAKE_BUILD_TYPE=Dev
5bac95d Merge remote-tracking branch 'upstream/master'
d41ea31 cmake: Do not use -Werror when using MSVC compiler
04cfe00 Provide convenience include file to include all index maps.
72fbaa7 Rename multimap indexes according to new schema.
af49a27 Make registering index map types easier.
0a35701 av: remove debug echo calls
886c15f av: ditch -DCMAKE_BUILD_TYPE=Dev
ad0a629 The great renaming of map index classes.
97b4d34 av: try again
bf243b2 Move some hpp files into detail directory and fix include guards.
64e4841 av: try again calling cmake directly
1700789 Add way to dynamically choose node location index.
da49b7f av: try again with build2.bat
4bf55f5 is appveyor working again?
5e63433 delete ws_32.lib patch. generate makefile instead of VS
1054016 Merge remote-tracking branch 'upstream/master'
8c198fc av: try even newer cmake
7cccb06 av: maybe newer cmake helps
d04967a av: no existing env var was still there
80763c6 av: no build.bat, call cmake directly
3b58fc6 av: no cmds over spanning serveral lines?
33c09a0 CALL bat
34639c6 maybe double quotes?
72572de explicitly call VS2014 cmd prompt
6955e87 1st try on AppVeyor

git-subtree-dir: third_party/libosmium
git-subtree-split: 6522da53748e12379bbfaf70ad29ee7bd98ef02d
2015-02-05 15:13:48 +01:00
Dennis Luxen
10224a692b Merge commit 'bb78bc8fe305eef39ca0a5d5e9dedc466f803dfb' into develop 2015-02-05 15:13:48 +01:00
Dennis Luxen
3eb83d0737 add override final specifier to GetTravelMode function in facades 2015-02-05 14:58:07 +01:00
Dennis Luxen
f35fa0049c reformat cherry-picked commit 2015-02-05 11:54:30 +01:00
Ben
d77a88c21e added lua binding for osmium::Way::id()
Conflicts:
	extractor/scripting_environment.cpp
2015-02-05 11:54:07 +01:00
Dennis Luxen
3d55622237 search quietly for OpenMP 2015-02-05 11:37:55 +01:00
Dennis Luxen
bf76465029 use C++11s std::hypot() instead of hand-rolled code 2015-02-05 11:22:46 +01:00
Ben
129a6ed99e added lua binding for osmium::Way::id() 2015-02-04 19:36:39 +00:00
Dennis Luxen
9f5fc4ab0c reorder includes 2015-01-31 21:17:16 +01:00
Dennis Luxen
97f6468663 yet another try to unhack libgomp linking: use OpenMP binding if and only if present 2015-01-29 17:29:03 +01:00
Dennis Luxen
a883b73981 add explicit cmake checking step for libgomp 2015-01-29 17:01:08 +01:00
Dennis Luxen
36aadc21a7 fix names of fwd declarations 2015-01-29 16:48:59 +01:00
Dennis Luxen
da469911d3 always link against libgomp 2015-01-29 16:23:04 +01:00
Dennis Luxen
4195b0d0e6 Merge pull request #1364 from Project-OSRM/feature/check_libgomp
check if stxxl compiles with or without libgomp, fixes #1361
2015-01-29 12:54:27 +01:00
Dennis Luxen
d241aef502 fix checking for successful compilation of stxxl with OpenMP 2015-01-29 12:52:54 +01:00
Dennis Luxen
8b2ca6b13d check if stxxl compiles with or without libgomp, fixes #1361 2015-01-29 12:52:54 +01:00
Dennis Luxen
ade94c87b5 remove constexpr keyword that MSVC2013CTP isnt able to handle 2015-01-29 12:50:06 +01:00
Dennis Luxen
46f3426c35 remove Http dir 2015-01-28 12:40:42 +01:00
Dennis Luxen
3503cd9b71 remove another windows directory from ignored files/dirs 2015-01-28 12:35:52 +01:00
Dennis Luxen
73cc040792 add new lower case files and directories to .gitignore 2015-01-28 12:32:09 +01:00
Dennis Luxen
6c6029618a remove left-over directories from the renaming spree 2015-01-28 12:30:14 +01:00
Dennis Luxen
2a8084b6c6 clean up derived classed and their functions to correctly use final keyword:
functions marked as final need to be marked virtual. use override specifier to do so
2015-01-28 12:03:21 +01:00
Dennis Luxen
86ca9bd0f9 mark simple logger write function as noexcept. 2015-01-28 10:09:46 +01:00
Dennis Luxen
b192678abf add dummy case to switch statement. reflects all cases are covered and should shut up compiler warnings 2015-01-27 18:44:06 +01:00
Dennis Luxen
9a998d7b41 rename short variable name to be more telling 2015-01-27 18:40:01 +01:00
Dennis Luxen
64a6859753 reduce number of old-style casts 2015-01-27 18:37:52 +01:00
Dennis Luxen
b20b7e65bf renamed: Util/* -> util/* 2015-01-27 17:47:23 +01:00
Dennis Luxen
203e3ef077 fix test after header file rename 2015-01-27 17:16:50 +01:00
Dennis Luxen
7be5502a12 renamed: Util/BoostFileSystemFix.h -> Util/boost_filesystem_2_fix.hpp
renamed:    Util/TrigonometryTables.h -> Util/trigonometry_table.hpp
2015-01-27 17:14:03 +01:00
Dennis Luxen
0de6e4ccbb renamed: Util/DataStoreOptions.h -> Util/datastore_options.hpp
renamed:    Util/ProgramOptions.h -> Util/routed_options.hpp
2015-01-27 17:06:10 +01:00
Dennis Luxen
c8041bacd6 renamed: Util/IniFileUtil.h -> Util/ini_file.hpp 2015-01-27 16:57:50 +01:00
Dennis Luxen
1187f83ffd renamed: Library/*.h -> library/*.hpp 2015-01-27 16:35:19 +01:00
Dennis Luxen
dd3b8469dd renamed: Include/* include/* 2015-01-27 13:17:18 +01:00
Dennis Luxen
34bbd7dcaa renaming yet another variable to fix gcc name lookup 2015-01-27 13:11:04 +01:00
Dennis Luxen
8318b3ba83 rename variable to be more telling that it's not a type but a variable 2015-01-27 13:01:33 +01:00
Dennis Luxen
6768ecc3fc rename variable to make name lookup not fail on gcc 2015-01-27 12:52:55 +01:00
Dennis Luxen
9672f00ec3 renamed: Server/*/*.h -> server/*/*.hpp 2015-01-27 12:35:29 +01:00
Dennis Luxen
0c1101739d renamed: Server/DataStructures/*.h -> Server/data_structures/*.hpp 2015-01-27 12:14:08 +01:00
Dennis Luxen
872cb2d9c8 rename string literal names to replace odd camel case 2015-01-27 11:52:56 +01:00
Dennis Luxen
3e47fe54fa refactor Server/Http to remove camel case 2015-01-27 11:45:33 +01:00
Dennis Luxen
f0d3d23b5f make http header parsing case insensitive, and remove some dead code (reset function) 2015-01-27 09:58:26 +01:00
Dennis Luxen
69e59b0ced rename clear() function to reduce camel case noise 2015-01-27 09:57:14 +01:00
Dennis Luxen
ad4fb5afe3 revert previous commit that replace boost::array by std::array. not compatible with clang-3.5/boost1.54 2015-01-26 17:37:37 +01:00
Dennis Luxen
dd6dd63798 rename iterator variable to be more telling 2015-01-26 16:35:16 +01:00
Dennis Luxen
7a3748b8f6 remove redundant c'tor call 2015-01-26 16:34:05 +01:00
Dennis Luxen
06a08a874f fix performance regression in output generation, use copy elision and return result char array 2015-01-26 13:49:07 +01:00
Dennis Luxen
37a9813482 replace boost::array by std::array 2015-01-26 13:26:21 +01:00
Dennis Luxen
fe7b436a8c refactor request parser to use C++11 idioms, plus a couple of consts 2015-01-26 13:20:22 +01:00
Dennis Luxen
601eff1af6 initialize compression type to be no compression 2015-01-26 11:25:10 +01:00
Dennis Luxen
29949eae1b remove unneeded include to boost/tribool 2015-01-23 18:55:58 +01:00
Dennis Luxen
9dfe6d1e85 use std::tuple to return multiple return values, hope for copy elision. Also, removes two cases of parameter reassignment 2015-01-23 18:53:37 +01:00
Dennis Luxen
fb3bc22c64 replace boost::tribool with enum based implementation 2015-01-23 18:18:29 +01:00
Dennis Luxen
b89304a24b add enum class based tribool implementation 2015-01-23 17:46:23 +01:00
Dennis Luxen
69b3457e83 replace boost::tuple by std::tuple 2015-01-23 17:14:12 +01:00
Dennis Luxen
cf21074f10 use enum as return code instead of boolean logic in extractor 2015-01-23 16:59:13 +01:00
Dennis Luxen
dc7f21513a move initialization of extractor config into main method and out out extraction logic 2015-01-23 16:30:14 +01:00
Dennis Luxen
a15450af91 manually revert previous change as g++ doesnt convert bitfields properly 2015-01-23 14:24:02 +01:00
Dennis Luxen
efbcce0ffe use bitfields to reduce struct size of segment information. size goes down from 28->24 bytes 2015-01-23 13:53:02 +01:00
Dennis Luxen
1c2c87e03d fix boundary edge case 2015-01-23 13:52:44 +01:00
Dennis Luxen
93b33c0518 fix cast to be explicit 2015-01-23 13:52:28 +01:00
Dennis Luxen
53e01952be replace for loops with counters by range-based for loops 2015-01-23 12:19:01 +01:00
Dennis Luxen
1c12b468a8 replace for loop with hand-rolled pair-wise traverse of container with call to for_each_pair; fix target type of cast 2015-01-23 12:11:51 +01:00
Dennis Luxen
ccd803416e fix unintended float/epsilon<double> comparison 2015-01-23 11:49:02 +01:00
Dennis Luxen
62f2a42f28 reduce cyclomatic complexity in double->string bearing conversion 2015-01-23 11:44:35 +01:00
Dennis Luxen
d6e76fd1c0 add whitespace 2015-01-23 11:38:47 +01:00
Dennis Luxen
9135c56ac6 fix implicit float/double conversion, use casts 2015-01-23 11:26:47 +01:00
Dennis Luxen
0e7eff3963 rename short variable names in mercator to be more telling 2015-01-23 11:14:29 +01:00
Dennis Luxen
bd1928e445 rename short variable names to be more telling 2015-01-23 09:47:44 +01:00
Dennis Luxen
8e105af232 remove redundant code from switch statement in restriction parser 2015-01-23 09:25:05 +01:00
Dennis Luxen
796cbafde4 add missing include in release build 2015-01-22 17:57:38 +01:00
Dennis Luxen
29354a1586 fix bearing computation 2015-01-22 17:07:04 +01:00
Dennis Luxen
bcd73e604c reformat coordinate and rtree test code 2015-01-22 17:00:48 +01:00
Dennis Luxen
e80ca6553d use new coordinate interface in unit tests 2015-01-22 16:58:45 +01:00
Dennis Luxen
90f17c2140 remove is_set() and reset() functions from coordinate 2015-01-22 16:55:34 +01:00
Dennis Luxen
2e5cc1e6ae remove redundant code and streamline coordinate interface 2015-01-22 16:48:53 +01:00
Dennis Luxen
0ea7fd9c3d remove more dead/unused functions 2015-01-22 16:41:04 +01:00
Dennis Luxen
814d9aa01b reformat code source file 2015-01-22 16:33:27 +01:00
Dennis Luxen
3fa12445a5 rename coordinate calculation functions, remove code clutter 2015-01-22 16:28:40 +01:00
Dennis Luxen
547a2aec09 remove dead/redundant code 2015-01-22 15:50:04 +01:00
Dennis Luxen
9175fb7da8 remove unused debug code 2015-01-22 15:19:43 +01:00
Dennis Luxen
887032881a use std::any_of() algorithm instead of hand-rolled logic 2015-01-22 15:09:24 +01:00
Dennis Luxen
e67f82283f replace temporary variable with short name by atomic<>.load call 2015-01-22 13:47:31 +01:00
Dennis Luxen
cfa83658dc Use early exit/continue to simplify code and reduce indentation 2015-01-22 12:39:41 +01:00
Dennis Luxen
c881aa7b32 Use early exit/continue to simplify code and reduce indentation, move increase/decrease query count into functions 2015-01-22 12:38:48 +01:00
Dennis Luxen
a8db29399f remove unneeded else block in if statement 2015-01-22 12:28:00 +01:00
Dennis Luxen
baacd0e50c reformat source files 2015-01-22 12:24:54 +01:00
Dennis Luxen
0f8c3b1960 fix copyright year 2015-01-22 12:18:48 +01:00
Dennis Luxen
cd523cc934 conflate collapsable if statements 2015-01-22 12:14:14 +01:00
Dennis Luxen
044271a55c specialize insert function to pass by reference for non-fundamental types by using type traits 2015-01-22 11:02:49 +01:00
Dennis Luxen
f662b9a081 install libgdal-dev on Travis 2015-01-20 18:45:49 +01:00
Dennis Luxen
ba10f97420 add third_party directory node to the include dirs 2015-01-20 18:23:10 +01:00
Dennis Luxen
50c460ebd5 install mapbox/variant headers from third_party directory 2015-01-20 18:07:45 +01:00
Dennis Luxen
501863a0eb move external dependence mapbox/variant into third_party directory 2015-01-20 18:06:26 +01:00
Dennis Luxen
ec9b2dbe42 remove debug info from binaries 2015-01-20 17:57:47 +01:00
Dennis Luxen
db2ba22bd6 fix tests to run with new header coordinate_calculations 2015-01-20 17:56:50 +01:00
Dennis Luxen
087f08dad2 also build tests on travis CI 2015-01-20 17:56:30 +01:00
Dennis Luxen
bf7b146dfc Merge pull request #1350 from Project-OSRM/feature/prune_incremental_search
speed up nearest neighbor query by pruning
2015-01-20 17:36:23 +01:00
Dennis Luxen
01f3237416 speed up nearest neighbor query by pruning, move coordinate calculations away from library interface 2015-01-20 16:24:49 +01:00
Dennis Luxen
8f813fbc67 clear result nodes/way in parser for each parsed element 2015-01-20 11:25:21 +01:00
Dennis Luxen
f4ff695080 replace conditional operator by explicit serialization 2015-01-20 10:50:33 +01:00
Dennis Luxen
08cc2bbd70 move thread local variables out of parsing scope 2015-01-16 18:22:37 +01:00
Dennis Luxen
46a7e46068 serialize lvalues as MSVC barfs out on serializing the return value of the conditional operator 2015-01-16 18:12:21 +01:00
Dennis Luxen
472a567f42 add cmath include to fix call to std::abs() on clang compiler, reorder includes 2015-01-16 17:23:29 +01:00
Dennis Luxen
f3bc1ed3a9 make floating point number literal a float 2015-01-16 17:21:02 +01:00
Dennis Luxen
7ba9b97afc reorder members of internal extractor edge. 56->40 bytes 2015-01-16 17:11:30 +01:00
Dennis Luxen
061d281d2a serialize bitfields thru local member mockups 2015-01-16 17:10:31 +01:00
Dennis Luxen
2835508292 fixes #1346:
- use const_iterator where it makes sense
- fix renumbering of turn restriction members
- remove redundant code
- fix counting of usable turn restrictions
2015-01-16 15:56:49 +01:00
Dennis Luxen
959d9a3ad9 explicitly implement check if is_only turn is restricted 2015-01-16 15:52:41 +01:00
Dennis Luxen
7cf34a6d6f make debug output more verbose during renumbering of turn restriction members 2015-01-16 15:47:01 +01:00
Dennis Luxen
8d6d7d1f20 remove superflous inline keywords 2015-01-16 11:27:46 +01:00
Dennis Luxen
b115764d9c Merge pull request #1347 from Project-OSRM/perpendicular-fix
Fix ComputePerpendicularDistance convinience function
2015-01-16 09:53:49 +01:00
Patrick Niklaus
1b5d332e93 Add regression test for FixedpointCoordinate 2015-01-16 00:49:43 +01:00
Patrick Niklaus
356dfc806d Fix ComputePerpendicularDistance convinience function
This function is used by StaticRTree and returns wrong results.
The other variation is correct. To reduce code duplication
the correct version is used instead, as the implementation is nearly
identical.
2015-01-16 00:34:07 +01:00
Dennis Luxen
f2b556adfd umbenannt: UnitTests/* -> unit_tests/* 2015-01-15 18:39:26 +01:00
Dennis Luxen
1bbfced61a reorder includes 2015-01-15 18:10:22 +01:00
Dennis Luxen
800cb8c6dd renamed: ../UnitTests/data_structures/BinaryHeapTest.cpp -> ../UnitTests/data_structures/binary_heap.cpp
renamed:    ../UnitTests/data_structures/RangeTableTest.cpp -> ../UnitTests/data_structures/range_table.cpp
renamed:    ../UnitTests/data_structures/StaticGraphTest.cpp -> ../UnitTests/data_structures/static_graph.cpp
renamed:    ../UnitTests/data_structures/StaticRTreeTest.cpp -> ../UnitTests/data_structures/static_rtree.cpp
2015-01-15 18:07:47 +01:00
Dennis Luxen
6b1d672dc1 fix signed/unsigned comparison 2015-01-15 13:11:25 +01:00
Dennis Luxen
6e138bbf54 fixes data structure tests:
- MapStorage: fix returned index in peek_index() on fail
- UnorderedMapStorage: fix returned index in peek_index() on fail
- BinaryHeap: auto-deduce Index type
- ArrayStorage: replace raw array with std::vector
2015-01-15 12:59:08 +01:00
Dennis Luxen
6dabf4507a implement peek_index() functions for all binary heap storage classes 2015-01-15 11:15:48 +01:00
Dennis Luxen
527e6cbc72 xor fast hash storage: reorder initialization of elements, delete default c'tor, resetting of table may be expensive as it is rare 2015-01-14 18:14:55 +01:00
Dennis Luxen
39edbcbabd after profiling with intel vtune, mitigate some performance hotspots. may give a 10-20% performance boost during preprocessing 2015-01-14 17:26:59 +01:00
Dennis Luxen
0077856d2f Merge commit 'b65f1d7df0b997eac085da7f5a3344a86b812916' as 'Include/variant' 2015-01-14 09:36:20 +01:00
Dennis Luxen
b65f1d7df0 Squashed 'Include/variant/' content from commit 00ab881
git-subtree-dir: Include/variant
git-subtree-split: 00ab88117ed25f78cdca2faa00beea0061271e85
2015-01-14 09:36:20 +01:00
Dennis Luxen
201afbbeec rm hard copy of variant. 2015-01-14 09:32:43 +01:00
Dennis Luxen
f5caf96d2e add new include dir of libosmium 2015-01-13 17:14:54 +01:00
Dennis Luxen
73efcc6b0c Squashed 'third_party/libosmium/' content from commit 910f8f1
git-subtree-dir: third_party/libosmium
git-subtree-split: 910f8f1e992402e0f1acd0132eaffa7539ca83d2
2015-01-13 16:54:25 +01:00
Dennis Luxen
d69510f997 Merge commit '73efcc6b0ccedf8c1b6d95abdba8340cc9adf100' as 'third_party/libosmium' 2015-01-13 16:54:25 +01:00
Dennis Luxen
d6946a8aae remove copy of libosmium, to be replaced by a subtree 2015-01-13 16:50:31 +01:00
Dennis Luxen
ebbc168f3f fix implicit integer cast, reorder includes 2015-01-13 16:46:44 +01:00
Dennis Luxen
347cbd37ca fix include guard naming in plugin base 2015-01-13 16:15:51 +01:00
Dennis Luxen
d190e0b771 Merge pull request #1343 from Project-OSRM/feature/static_graph_components
use static graph for component exploration, closes #1288
2015-01-13 16:06:48 +01:00
Dennis Luxen
5f28a7db0d add some whitespace 2015-01-13 15:52:24 +01:00
Dennis Luxen
d0c99f1999 fix linking of benchmarks and tests 2015-01-13 15:45:27 +01:00
Dennis Luxen
bf71781ee9 new file: Util/mercator.cpp
renamed:    Util/MercatorUtil.h -> Util/mercator.hpp
2015-01-13 14:57:23 +01:00
Dennis Luxen
fbce104f3b use static graph for component exploration, closes #1288 2015-01-13 14:24:56 +01:00
Dennis Luxen
ef9074f8e4 renamed: Util/finger_print.* -> Util/fingerprint.*
thx @emiltin
2015-01-13 11:16:13 +01:00
Dennis Luxen
67f3111cc0 renamed: Util/FingerPrint.h -> Util/finger_print.hpp 2015-01-13 11:05:22 +01:00
Dennis Luxen
56d2101b1a Merge pull request #1339 from Project-OSRM/test_appveyor_default_os
remove explicit appveyor os spec to get scheduled on hyper-v
2015-01-12 16:28:27 +01:00
Emil Tin
a28395b116 remove accidentally added files 2015-01-12 13:58:32 +01:00
Emil Tin
eebf3a54e2 cuke: abort if bins are missing, closes #1341 2015-01-12 13:56:43 +01:00
Dennis Luxen
7e70fa63d7 Merge pull request #1338 from frodrigo/develop
Black list access=psv for car profile
2015-01-09 23:39:49 +01:00
Dennis Luxen
bea4b520c0 Revert "Revert "fix #1255 assume lift gates are passable""
This reverts commit cec3d1488a.

*sigh*
2015-01-09 19:15:00 +01:00
Dennis Luxen
64c17c4ecd remove explicit appveyor os spec to get scheduled on hyper-v 2015-01-09 18:53:15 +01:00
Frederic Rodrigo
26f7ac9ca1 Black list access=psv for car profile 2015-01-09 17:14:16 +00:00
Dennis Luxen
b1a12768e1 fix parameter name for maximum number of location in distance table plugin 2015-01-08 17:41:19 +01:00
Dennis Luxen
0e5a448d04 Merge pull request #1335 from Project-OSRM/feature/frodrigo-max_locations_distance_table
Feature/frodrigo max locations distance table
2015-01-08 16:07:17 +01:00
Dennis Luxen
91a89399f8 fix copyright year 2015-01-08 15:07:01 +01:00
Dennis Luxen
c6bb7c5993 renamed: Include/osrm/ServerConfig.h -> Include/osrm/libosrm_config.hpp
pass lib config object by reference
2015-01-08 15:05:54 +01:00
Dennis Luxen
48b131eb5c Merge branch 'max_locations_distance_table' of https://github.com/frodrigo/osrm-backend into frodrigo-max_locations_distance_table
Conflicts:
	Library/OSRM.h
	Library/OSRM_impl.cpp
	Library/OSRM_impl.h
2015-01-08 14:49:10 +01:00
Dennis Luxen
1328be2b61 move structs into anon namespace, move containers in function scope 2015-01-07 12:30:01 +01:00
Dennis Luxen
88c1e622dd fix copyright year 2015-01-07 12:29:13 +01:00
Dennis Luxen
10672786a1 fix copyright year and include guard 2015-01-07 12:28:26 +01:00
Dennis Luxen
d896a9efec remove superflous inline keywords as this DeallocatingVector is header-defined, also remove ignored const keywords 2015-01-07 12:26:49 +01:00
Dennis Luxen
0ccdd4b6ad fix implicit conversion that _may_ lose integer precision 2015-01-07 12:26:09 +01:00
Dennis Luxen
66fc676858 remove unused parameter, move previously templated function into compile unit 2015-01-06 20:05:33 +01:00
Frederic Rodrigo
12f2acc9ff Order ServerPaths members by memory size, pass ServerPaths by ref 2015-01-06 15:33:57 +00:00
Dennis Luxen
b53e8bf501 remove implicit conversion 2015-01-06 15:31:55 +01:00
Dennis Luxen
e296264ea6 Merge pull request #1292 from Project-OSRM/feature/json_lib_interface
Feature/json lib interface
2015-01-06 15:27:40 +01:00
Frédéric Rodrigo
598f5519d1 Remove setters from structures server_config 2015-01-06 14:11:09 +00:00
Frédéric Rodrigo
ced64d7a09 Move server configuration from method parameter to a struct 2015-01-06 14:11:09 +00:00
Frédéric Rodrigo
7075a8a8ef Fix tests for new option --max_locations_distance_table 2015-01-06 14:11:09 +00:00
Frédéric Rodrigo
e2605c2838 Add a commande line option to osrm-routed for max locations supported in distance table query 2015-01-06 14:11:09 +00:00
Dennis Luxen
be63939441 fix includes 2015-01-06 13:35:36 +01:00
Dennis Luxen
dea9c37d99 fix bad request error message 2015-01-06 13:27:51 +01:00
Dennis Luxen
4d27366ead fix compilation of benchmark tests 2015-01-06 13:27:51 +01:00
Dennis Luxen
a11a8429bb remove unneeded header file 2015-01-06 13:27:51 +01:00
Dennis Luxen
6da33cafe5 rebase branch onto latest develop, report changes. hurt a little 2015-01-06 13:27:50 +01:00
Dennis Luxen
06f82d5e8a install variant by default 2015-01-06 13:22:12 +01:00
Dennis Luxen
89dd0c4a40 install headers with .hpp suffix 2015-01-06 13:22:12 +01:00
Dennis Luxen
1b10f53eff DataStructures/RawRouteData.h -> DataStructures/internal_route_result.hpp, implements #1238 2015-01-06 13:22:12 +01:00
Dennis Luxen
8bd7d57dd8 fixed compilation of simple client
- adapted to new lib interface
- fixed return codes of command line parsing
- reformatted code
2015-01-06 13:20:56 +01:00
Dennis Luxen
4a6325696e change library interface to expose json container as structure to exchange data 2015-01-06 13:19:21 +01:00
Dennis Luxen
b50a907ca3 fix changed include paths 2015-01-06 13:17:12 +01:00
Dennis Luxen
59e9a67abd rename and remove include header files for stabilized lib API 2015-01-06 13:09:44 +01:00
Liu Jiaming
1d2f06df6d Fix std::list splice usage error 2015-01-06 13:02:05 +01:00
Dennis Luxen
725b93a961 Merge branch 'develop' 2015-01-06 11:03:29 +01:00
Dennis Luxen
a21e4c5a0b link library against exception lib 2015-01-06 11:00:44 +01:00
Dennis Luxen
433db17083 fix initialization of simple client 2015-01-05 18:14:49 +01:00
Dennis Luxen
f8753fb9f1 fix overly long line 2015-01-05 16:32:11 +01:00
Dennis Luxen
25d5653f66 rename a number of overly long variable names 2015-01-05 16:29:33 +01:00
Dennis Luxen
703a88a639 remove empty d'tor from osrm::exception 2015-01-05 15:53:28 +01:00
Dennis Luxen
25326b571b renamed: Util/OSRMException.h -> Util/osrm_exception.hpp 2015-01-05 15:40:05 +01:00
Dennis Luxen
5e2f4c9d2d fix header include 2015-01-05 14:47:05 +01:00
Dennis Luxen
f43d380fe2 remove unneeded method 2015-01-05 14:46:38 +01:00
Dennis Luxen
2240d3d0d1 add new header file 2015-01-05 14:39:17 +01:00
Dennis Luxen
b6eea9a880 fix unintended implicit cast from unsigned to signed 2015-01-05 14:38:24 +01:00
Dennis Luxen
6bbd7c0c0b update ignore list in git 2015-01-05 14:37:35 +01:00
Dennis Luxen
2caeb4008c renamed: Util/GitDescription.cpp.in -> Util/git_sha.cpp.in
renamed:    Util/GitDescription.h -> Util/git_sha.h
2015-01-05 14:32:04 +01:00
Dennis Luxen
a4919ffb45 re-enable hintin mechanism 2015-01-05 12:59:29 +01:00
Dennis Luxen
b384340cbb Revert "remove remnants of hinting mechanism"
This reverts commit 7de428233e.
2015-01-05 12:57:34 +01:00
Dennis Luxen
061f46306f remove unneeded lvalue parameter 2015-01-05 12:00:11 +01:00
Dennis Luxen
fe1f11b071 renamed: Util/StringUtil.h -> Util/string_util.hpp 2015-01-05 10:22:11 +01:00
Patrick Niklaus
d3f5db576a Enable gcc color output when available 2015-01-04 23:13:15 +01:00
Emil Tin
0ca586e1c8 cuke: remove unneeded @x tag 2015-01-03 16:53:01 +01:00
Emil Tin
a0b55f9df3 table tests: use empty string to mean no route 2015-01-03 11:12:47 +01:00
Dennis Luxen
24943ccee6 fix use of old-style cast 2015-01-02 17:43:46 +01:00
Dennis Luxen
bcaaf34fa7 implicit conversion loses integer precision 2015-01-02 17:41:11 +01:00
Dennis Luxen
ea17d1f6c7 dynamic exception specifications are deprecated, use 'noexcept' instead 2015-01-02 17:39:11 +01:00
Dennis Luxen
3be734010c fix warning: 'const' type qualifier on return type has no effect 2015-01-02 17:34:21 +01:00
Dennis Luxen
e79787cc77 reorder members to avoid padding class 'SimpleLogger' with 4 bytes to align 'os' 2015-01-02 17:32:52 +01:00
Dennis Luxen
7de428233e remove remnants of hinting mechanism 2015-01-02 17:10:47 +01:00
Dennis Luxen
9722f56be8 remove more debug code 2015-01-02 16:41:36 +01:00
Dennis Luxen
e766d206f1 remove debug code 2015-01-02 16:06:09 +01:00
Dennis Luxen
1fa9091239 retire json hinting mechanism 2015-01-02 15:46:43 +01:00
Dennis Luxen
04e1e5e3a2 reformat code 2015-01-02 15:17:15 +01:00
Dennis Luxen
fa5c0560fa use tiny cc id if all phantoms have such an id, and if and only if all ids are equal 2015-01-02 09:36:27 +01:00
Dennis Luxen
55d47b3e31 reimplement incremental nearest neighbor query 2015-01-02 09:36:27 +01:00
Dennis Luxen
5bb96fd477 reformat code of phantom node c'tor for legibility 2015-01-02 09:36:27 +01:00
Dennis Luxen
22b404a1b4 add is_in_tiny_cc() util function 2015-01-02 09:36:27 +01:00
Dennis Luxen
03dcf82602 use first phantom node of second pair 2015-01-02 09:36:26 +01:00
Dennis Luxen
95d1e8a4f1 adapt viaroute plugin to query NN search for vector of phantom nodes 2015-01-02 09:36:26 +01:00
Emil Tin
67f68b47db add fuzzy match to table tests, add more tests 2015-01-01 20:19:41 +01:00
Emil Tin
593808f24d initial support for testing distance matrices 2015-01-01 15:12:45 +01:00
Dennis Luxen
0a884cc64a don't stop traversing at bollard node 2014-12-31 16:04:53 +01:00
Dennis Luxen
a54d4b98b1 add const keyword in range based for loop 2014-12-31 16:04:53 +01:00
Patrick Niklaus
23132e5292 Use >= 0 to include routes where start/end is the same 2014-12-31 15:59:42 +01:00
Dennis Luxen
d741b624be pass component class by ref (not value) in edge-based graph factory 2014-12-30 11:44:11 +01:00
Patrick Niklaus
00bc394bdb Fix off-by-one in distance table plugin.
Should fix #1320.
2014-12-28 17:45:55 +01:00
Dennis Luxen
d7215ad185 fix tests, temporarily disable one test case 2014-12-24 13:03:05 +01:00
Dennis Luxen
2b63eb8243 remove zoom level from nearest neighbor calls 2014-12-24 10:40:03 +01:00
Dennis Luxen
1bb3da0332 expose component_id in phantom node 2014-12-24 10:25:27 +01:00
Dennis Luxen
c7d3d635f6 fix test compile 2014-12-23 17:18:32 +01:00
Dennis Luxen
f4c8db6105 - serialize component_id
- remove calls to deprecated NN function in facades
2014-12-23 16:14:28 +01:00
Dennis Luxen
b2637b9a43 compute component id for each SCC 2014-12-23 15:26:06 +01:00
Dennis Luxen
09d0ac3838 add aux. function to get component id for a given node 2014-12-23 15:17:38 +01:00
Dennis Luxen
f42cc848d5 - correct number of components in compressed graph by number of removed nodes
- replace integer for loops by integer range-based loop
2014-12-23 14:51:25 +01:00
Dennis Luxen
4b1224f874 fix copyright year 2014-12-23 14:38:04 +01:00
Dennis Luxen
10bb2cce8e count number of removed nodes as a private member variable in EdgeBasedGraphFactory 2014-12-23 14:37:01 +01:00
Dennis Luxen
8174b3b85a output total number of compoments and those of size one 2014-12-23 14:33:38 +01:00
Dennis Luxen
71e2f2ed61 move SCC stats output out of algo implementation 2014-12-23 14:31:55 +01:00
Dennis Luxen
8d8724b3e1 use SCC code for exploration of components 2014-12-23 12:27:04 +01:00
Dennis Luxen
47f65ccba6 use restriction map in tiny components 2014-12-23 11:47:19 +01:00
Dennis Luxen
df0c1106ce compile and link restriction map object to components and routes 2014-12-23 11:46:25 +01:00
Dennis Luxen
47a2271e27 copy edits: 2014-12-23 11:30:45 +01:00
Dennis Luxen
ea367a7f37 add better checks for forbidden routes 2014-12-22 18:12:47 +01:00
Dennis Luxen
f4b192e33c simplify code 2014-12-22 18:12:18 +01:00
Dennis Luxen
a5c824f694 adapt tiny_components.hpp to have the same interface as bfs_components.hpp 2014-12-22 16:43:57 +01:00
Dennis Luxen
ccc4607d6d renamed: Util/GraphLoader.h -> Util/graph_loader.hpp 2014-12-22 16:09:01 +01:00
Dennis Luxen
4ec41392f7 code cleanup in graph loading function 2014-12-22 16:03:22 +01:00
Dennis Luxen
5f2b2cd0f7 remove dead code 2014-12-22 15:53:11 +01:00
Dennis Luxen
361e3ca356 fix a copy&paste oversight, fixes #1319
remove UINT_MAX
2014-12-22 15:11:37 +01:00
Dennis Luxen
13bf4fab32 make implementation of restriction map independent of graph type 2014-12-19 16:46:12 +01:00
Dennis Luxen
4b583e8ce9 replace insecure std::rand by C++11's random number generation
fixes coverity issue 1248916 Don't call
2014-12-19 10:59:12 +01:00
Dennis Luxen
d31c6fe286 fix coverity issue 1258907 Division or modulo by float zero 2014-12-19 10:49:33 +01:00
Dennis Luxen
79de97d814 move application logic, i.e. shape file generation, from SCC traversal class to calling tool code 2014-12-18 18:14:14 +01:00
Dennis Luxen
1c5d093b59 Revert "catch uncaught exception"
This reverts commit ecff2beafa.
2014-12-18 16:42:14 +01:00
Dennis Luxen
ecff2beafa catch uncaught exception 2014-12-18 16:11:49 +01:00
Dennis Luxen
7e0b19c43d renamed Util/StdHashExtensions.h -> Util/std_hash.hpp 2014-12-18 10:09:31 +01:00
Dennis Luxen
2ebe2faa74 renamed Util/TimingUtil.h -> Util/timing_util.hpp 2014-12-17 17:33:31 +01:00
Dennis Luxen
aec1451168 add workaround for Windows build issues. 2014-12-17 16:24:43 +01:00
Dennis Luxen
38251aa513 construct RequestParser object on demand
pass CompressionType refs instead of ptrs to parser
2014-12-17 15:48:33 +01:00
Dennis Luxen
d92e8ca8d2 remove unneeded function 2014-12-17 15:09:07 +01:00
Dennis Luxen
2e5876d488 add lock_guard to protect against data races in initialization of scripting environment
rename function names to reduce camel case noise
2014-12-17 14:34:23 +01:00
Dennis Luxen
3dddd16ec7 bump osmium version 2014-12-17 11:19:08 +01:00
Dennis Luxen
40ff7ad999 update speed profile from external calibration data 2014-12-17 11:02:04 +01:00
Dennis Luxen
cb79f769c9 Merge pull request #1312 from joto/const
Some cleanups in the extractor code.
2014-12-12 17:10:47 -08:00
Jochen Topf
e95feff016 Use 'const' where possible in extractor and simplify iterator loop. 2014-12-13 00:23:41 +01:00
Jochen Topf
f65b32c1af Use atomics for counters. 2014-12-13 00:16:32 +01:00
Dennis Luxen
46dd9b9887 remove duplicated paths 2014-12-13 00:09:25 +01:00
Dennis Luxen
4445f21e8a renamed: Tools/* -> tools/* 2014-11-28 15:36:40 +01:00
Dennis Luxen
00d3676a20 renamed: RoutingAlgorithms/* routing_algorithms/ 2014-11-28 15:33:41 +01:00
Dennis Luxen
0f7cb12e97 renamed: ThirdParty/* -> third_party/* 2014-11-28 15:22:26 +01:00
Dennis Luxen
8485e02c00 renamed: Plugins/* -> plugins/* 2014-11-28 15:14:13 +01:00
Dennis Luxen
ae7300f9b4 renamed: extractor.cpp -> extract.cpp
renamed:    Extractor/* -> extractor/
2014-11-28 15:00:48 +01:00
Dennis Luxen
fc796539e8 deleted: Docs/webclient.txt 2014-11-28 14:39:28 +01:00
Dennis Luxen
1d8c43b445 renamed: Descriptors/* -> descriptors/* 2014-11-28 14:36:38 +01:00
Dennis Luxen
58de37e822 renamed: DataStructures/* -> data_structures/* 2014-11-28 12:15:31 +01:00
Dennis Luxen
7b3a0c5105 renamed: Contractor/* -> contractor/* 2014-11-28 10:30:21 +01:00
Dennis Luxen
592034653c renamed: Benchmarks/* -> benchmarks/*s 2014-11-28 10:15:27 +01:00
Dennis Luxen
8d9f830c53 change includes to lower case algorithms/ 2014-11-28 10:12:08 +01:00
Dennis Luxen
d8eea0ce0e renamed: Algorithms/* -> algorithms/* 2014-11-28 10:07:06 +01:00
Dennis Luxen
c28c441e77 renamed: Contractor.h -> contractor.hpp 2014-11-27 19:07:59 +01:00
Dennis Luxen
1391420699 renamed: ../Benchmarks/StaticRTreeBench.cpp -> ../Benchmarks/static_rtree.cpp 2014-11-27 19:04:30 +01:00
Dennis Luxen
c0be751ef4 renamed: DataStructures/SegmentInformation.h -> DataStructures/segment_information.hpp 2014-11-27 18:54:20 +01:00
Dennis Luxen
5e2462e061 renamed: DataStructures/RestrictionMap.cpp -> DataStructures/restriction_map.cpp
renamed:    DataStructures/RestrictionMap.h -> DataStructures/restriction_map.hpp
2014-11-27 18:38:21 +01:00
Dennis Luxen
5c0eb4772d renamed: Util/LuaUtil.h -> Util/lua_util.hpp 2014-11-27 18:31:01 +01:00
Dennis Luxen
ef8706b4e1 fix inconsistencies with integer and iterator range header files, closes #1296 2014-11-27 09:54:57 +01:00
Dennis Luxen
acd1919e8d renamed: Util/Azimuth.h -> Util/bearing.hpp 2014-11-26 16:55:18 +01:00
Dennis Luxen
459e2a322b cast computed way in a proper way, add a static assertion to check for file types via traits 2014-11-26 12:05:55 +01:00
Dennis Luxen
e62caf33aa Merge pull request #1294 from alex85k/appveyor
update appveyor.yml (newer libraries, algorithm-tests)
2014-11-26 09:46:05 +01:00
alex85k
72fd0f3d41 update appveyor.yml (newer libraries, algorithm-tests) 2014-11-26 12:38:04 +03:00
Dennis Luxen
032c21c545 fix mixed up include header <numeric> <-> <cmath> 2014-11-25 14:52:21 +01:00
Dennis Luxen
b391daac6d use C++11's std::round from <numeric> instead of C-style round from cstdlib 2014-11-25 14:49:33 +01:00
Dennis Luxen
8cb6959e3f untangle includes 2014-11-24 15:51:52 +01:00
Dennis Luxen
49c817a60e remove redundant clear() calls in Extractor.cpp 2014-11-24 15:42:55 +01:00
Dennis Luxen
6859b53155 use JSON container to hold all intermediate results:
- no hand-rolled GPX generation anymore
- render gpx thru a JSONContainer visitor pattern
- precursor to expose JSON containter as result from OSRM lib interface, cf. #1261
2014-11-24 15:15:57 +01:00
Dennis Luxen
c581563230 fix setting of restriction end nodes, fixes #1286, and potentially #1287 2014-11-24 11:29:25 +01:00
Patrick Niklaus
fc1db35f27 Add missing json dependency to cucumber 2014-11-23 13:29:22 +01:00
Patrick Niklaus
2734a4aee4 Merge pull request #1284 from Project-OSRM/algo-test-fix
Fix DP unit test
2014-11-22 16:22:07 +01:00
Patrick Niklaus
172f65969c Fix DP unit test 2014-11-22 13:47:20 +01:00
Dennis Luxen
f0dbe0deb9 fix compilation 2014-11-21 09:35:20 +01:00
Dennis Luxen
8f8d81f90c renamed: Algorithms/StronglyConnectedComponents.h -> Algorithms/tiny_components.hpp 2014-11-20 17:21:35 +01:00
Dennis Luxen
665523bc7e add springclean tool to ignore list 2014-11-20 17:05:55 +01:00
Dennis Luxen
99e8fa70ba renamed: Algorithms/DouglasPeucker.cpp -> Algorithms/douglas_peucker.cpp
renamed:    Algorithms/DouglasPeucker.h -> Algorithms/douglas_peucker.hpp
2014-11-20 17:04:52 +01:00
Dennis Luxen
4c1d7c9d73 renamed: Algorithms/ExtractRouteNames.h -> Algorithms/route_name_extraction.hpp 2014-11-20 17:01:36 +01:00
Dennis Luxen
d1cc8e7ad7 renamed: Algorithms/BFSComponentExplorer.h -> Algorithms/bfs_components.hpp 2014-11-20 16:58:35 +01:00
Dennis Luxen
7629e44e4c renamed: Algorithms/IteratorBasedCRC32.h -> Algorithms/crc32_processor.hpp 2014-11-20 16:17:49 +01:00
Dennis Luxen
b62f6a6141 renamed: Algorithms/ObjectToBase64.h -> Algorithms/object_encoder.hpp 2014-11-20 16:10:11 +01:00
Dennis Luxen
10d7a2396c move JSON rendering code out of container header file. prerequesite to #1261 2014-11-20 15:26:30 +01:00
Dennis Luxen
007eced326 fix variant include 2014-11-20 15:14:19 +01:00
Dennis Luxen
1128270d4b fix short variable names 2014-11-20 15:06:48 +01:00
Dennis Luxen
c7d889bf9e add missing break 2014-11-20 15:02:02 +01:00
Dennis Luxen
7cb585c1a1 remove constant conditional operator 2014-11-20 15:00:49 +01:00
Dennis Luxen
75157221b2 commit another if statement 2014-11-20 14:59:27 +01:00
Dennis Luxen
9807520ef0 collapse if statement 2014-11-20 14:58:32 +01:00
Dennis Luxen
c658ee5c78 fix OCLint warning: short variable name, unused parameter 2014-11-20 14:55:43 +01:00
Dennis Luxen
cbfbcdcff5 reformat RestrictionParser 2014-11-20 10:46:14 +01:00
Dennis Luxen
9a0581ea7f Merge pull request #1159 from Project-OSRM/feature/libosmium
parallelizing profile calls and porting lib osmium to Windows
2014-11-20 10:20:09 +01:00
Dennis Luxen
60c268ddd6 reorder some of the code 2014-11-19 11:02:38 +01:00
Dennis Luxen
0361e0204a rename Clear() method to clear() 2014-11-19 10:53:28 +01:00
Dennis Luxen
2da427134b use push_back to insert into tbb::concurrent_vector as emplace_back is not generally available 2014-11-19 10:12:08 +01:00
Dennis Luxen
4fce0dadcf remove further debug output from profiles 2014-11-19 09:58:41 +01:00
Dennis Luxen
288c241fb4 move initialization of Lua error callback into scripting environment 2014-11-19 09:49:39 +01:00
Dennis Luxen
f3e3eda69e remove debug output from bike profile 2014-11-19 09:47:23 +01:00
Dennis Luxen
0f4dd8103d add cast.hpp from osmium 2014-11-19 09:44:02 +01:00
Dennis Luxen
86ee05ee5e add missing include 2014-11-19 09:22:31 +01:00
Dennis Luxen
3b9c6a6465 reformat Extractor 2014-11-18 19:03:44 +01:00
Dennis Luxen
8e73a4a19d enable relation parsing with libosmium 2014-11-18 18:53:19 +01:00
Dennis Luxen
428bb36ec6 parallelize with a vector of iterators 2014-11-18 16:54:48 +01:00
Dennis Luxen
0a24df6bd0 Merge pull request #1279 from Project-OSRM/config-parsing-fix
Fix ignored config file. Fixes issue #1276.
2014-11-18 14:09:03 +01:00
Patrick Niklaus
d3ca080729 Fix windows build. 2014-11-18 11:52:39 +01:00
Patrick Niklaus
7658031784 Fix ignored config file. Fixes issue #1276. 2014-11-18 00:43:38 +01:00
Dennis Luxen
710e74219a libosmium version bump 2014-11-17 14:58:39 +01:00
Dennis Luxen
0249bed53a bump variant dependency 2014-11-17 14:58:39 +01:00
Dennis Luxen
9d14f81b79 set default timestamp for tests 2014-11-17 14:58:39 +01:00
Dennis Luxen
a7c683a83c forward way ID information properly in turn restrictions parsing 2014-11-17 14:58:38 +01:00
Dennis Luxen
16631bf454 port track smoothness to new parsing 2014-11-17 14:58:38 +01:00
Dennis Luxen
3c563f7073 rebase branch onto most recent changes from develop branch 2014-11-17 14:58:38 +01:00
Dennis Luxen
344bdbb707 basic parallelization infrastructure 2014-11-17 14:58:38 +01:00
Dennis Luxen
a0256dfc60 add error callback when calling get_exceptions 2014-11-17 14:58:38 +01:00
Dennis Luxen
b131f27eb9 use_turn_restrictions as global in car profile 2014-11-17 14:58:38 +01:00
Dennis Luxen
0d9b70552e refactor FirstAndLastSegmentOfWay 2014-11-17 14:58:38 +01:00
Dennis Luxen
ea1a89290a uncouple configuration of Extractor into compile unit 2014-11-17 14:58:38 +01:00
Dennis Luxen
59f1679d37 move LUA error callback function into anonymous namespace 2014-11-17 14:58:37 +01:00
Dennis Luxen
5121983218 Rename NodeInfo -> QueryNode 2014-11-17 14:58:37 +01:00
Dennis Luxen
0d7141ce5b Rename NodeInfo -> QueryNode 2014-11-17 14:58:37 +01:00
Dennis Luxen
b4b753ce2e rename variables in ExternalMemoryNode to be more telling and consistent 2014-11-17 14:58:37 +01:00
Dennis Luxen
4f666e4d53 remove dead code 2014-11-17 14:58:37 +01:00
Dennis Luxen
874a988527 add dummy NodeID.h (to move into include) 2014-11-17 14:58:37 +01:00
Dennis Luxen
51c79f9784 rename ExtractorStructs into a more telling name 2014-11-17 14:58:37 +01:00
Dennis Luxen
4d19811026 apply reformatting 2014-11-17 14:58:37 +01:00
Dennis Luxen
d1454075ab untangle function object code for stxxl comperators 2014-11-17 14:58:37 +01:00
Dennis Luxen
becb6cf5bf compile renamed object file 2014-11-17 14:58:36 +01:00
Dennis Luxen
a6f34d2044 rename ImportNode.h/cpp -> ExternalMemoryNode.h/cpp 2014-11-17 14:58:36 +01:00
Dennis Luxen
7300024e13 remove unneeded code: HashTable 2014-11-17 14:58:36 +01:00
Dennis Luxen
282800e6b1 replace boost::optional with mapbox::util::optional 2014-11-17 14:58:36 +01:00
Dennis Luxen
e938bd3481 Revert "remove implicitly defined inline keywords from header-implemented functions in Util/ headers"
This reverts commit dc35e97ae002bdfda4bc3a68507749c464cfe371.
2014-11-17 14:58:36 +01:00
Dennis Luxen
9b501276fb upgrade variant dependency 2014-11-17 14:58:36 +01:00
Dennis Luxen
90d191f5f8 remove implicitly defined inline keywords from header-implemented functions in Extractor/ExtractionHelperFunctions.h 2014-11-17 14:58:36 +01:00
Dennis Luxen
f452e7f9d2 remove implicitly defined inline keywords from header-implemented functions in Util/ headers 2014-11-17 14:58:36 +01:00
Dennis Luxen
1d25f41122 remove unused code 2014-11-17 14:58:36 +01:00
Dennis Luxen
5556785804 remove implicitly defined inline keywords from header-implemented functions in ExtractionWay 2014-11-17 14:58:35 +01:00
Dennis Luxen
22ce4c24fb move key/value wrapper function into anonymous namespace in ScriptingEnvironment 2014-11-17 14:58:35 +01:00
Dennis Luxen
d4d2d127d1 pass an rvalue of a parsed node into the external memory storage 2014-11-17 14:58:35 +01:00
Dennis Luxen
3c28932862 remove errenous define in AppVeyor cmake call 2014-11-17 14:58:35 +01:00
Dennis Luxen
7e9177cb3c link against expat.lib 2014-11-17 14:58:35 +01:00
Dennis Luxen
f692103c81 fix build on windows by linking against the right libs 2014-11-17 14:58:35 +01:00
Dennis Luxen
5a1dfe9b89 include variant library from a relative path 2014-11-17 14:58:35 +01:00
Dennis Luxen
7175180dc9 remove deprecated code 2014-11-17 14:58:34 +01:00
Dennis Luxen
f95d1fa8ba add expat to cmake call on AppVeyor 2014-11-17 14:58:34 +01:00
Dennis Luxen
7b57068f6f manually install osmpbf, the one on Travis is outdated 2014-11-17 14:58:34 +01:00
Dennis Luxen
d79eac3e26 port foot profile 2014-11-17 14:58:34 +01:00
Dennis Luxen
27c255c874 port bicycle profile 2014-11-17 14:58:34 +01:00
Dennis Luxen
bdc611b23a port timestamp test to libosmium 2014-11-17 14:58:34 +01:00
Dennis Luxen
4cddf0bf5d replace explicit value fetching with wrapper call 2014-11-17 14:58:34 +01:00
Dennis Luxen
462d4c99cc port testbot profile 2014-11-17 14:58:34 +01:00
Dennis Luxen
94a2188090 explicitly specify optional parameter 2014-11-17 14:58:33 +01:00
Dennis Luxen
ebcdcb5f00 port car profile 2014-11-17 14:58:33 +01:00
Dennis Luxen
f9e780ed67 add a wrapper function to work around binding a function with default parameters against LuaBind 2014-11-17 14:58:33 +01:00
Dennis Luxen
18f8ce69cd remove default c'tor in ScriptingEnvironment 2014-11-17 14:58:33 +01:00
Dennis Luxen
dce665f14e reformat ExtractorCallbacks 2014-11-17 14:58:33 +01:00
Dennis Luxen
80046b646b actually parse the data that flowing thru osmium 2014-11-17 14:58:33 +01:00
Dennis Luxen
06ddceeac0 reset travel modes on ExtractionWay::clear() 2014-11-17 14:58:33 +01:00
Dennis Luxen
b7ea1dfcd0 fix generation of file names 2014-11-17 14:58:33 +01:00
Dennis Luxen
6d9598cd4c link against expat not libxml2, good riddance 2014-11-17 14:58:33 +01:00
Dennis Luxen
60c9701c3f reduce white space noise 2014-11-17 14:58:32 +01:00
Dennis Luxen
2a8644b72c expose libosmium types to LUA 2014-11-17 14:58:32 +01:00
Dennis Luxen
b6e469abd1 implement parsing thru libosmium 2014-11-17 14:58:32 +01:00
Dennis Luxen
004c237085 implement restriction type interface in RestrictionMap 2014-11-17 14:58:32 +01:00
Dennis Luxen
398e3bdf82 implement new restriction type interface in PrepareData 2014-11-17 14:58:32 +01:00
Dennis Luxen
958350af82 add InputRestrictionContainer implementation 2014-11-17 14:58:32 +01:00
Dennis Luxen
2d677a8af9 support new restriction type in component analysis 2014-11-17 14:58:32 +01:00
Dennis Luxen
05a79f5b55 implement loader routines for new restriction type 2014-11-17 14:58:31 +01:00
Dennis Luxen
ac9566d3d7 add include dir to libosmium 2014-11-17 14:58:31 +01:00
Dennis Luxen
8b7bf94aae implement new Restriction type 2014-11-17 14:58:31 +01:00
Dennis Luxen
c4e785e523 remove explicit keyword from WayIDStartAndEndEdge ctor 2014-11-17 14:58:31 +01:00
Dennis Luxen
2f6f883f7f implement ExtractionWay and -Node 2014-11-17 14:58:31 +01:00
Dennis Luxen
d071e92a1c implement restriction parsing 2014-11-17 14:58:31 +01:00
Dennis Luxen
b18b4072e1 implement restriction parsing 2014-11-17 14:58:31 +01:00
Dennis Luxen
0a2898da17 remove legacy extrators 2014-11-17 14:58:30 +01:00
Dennis Luxen
73fb596973 add libosmium 2014-11-17 14:58:30 +01:00
Dennis Luxen
c3f9dc7400 Merge pull request #1271 from alex85k/mingw-full
Support building tools on Windows, more MinGW
2014-11-17 09:18:40 +01:00
alex85k
c75ce210ea support building tools on Windows 2014-11-16 21:33:41 +05:00
Dennis Luxen
ffca6d8ba5 Merge pull request #1268 from alex85k/develop
fix appveyor packaging - 2
2014-11-14 09:25:01 +01:00
alex85k
1ec35befc8 package .exe, .pdb and lua profiles on AppVeyor 2014-11-14 00:37:07 +05:00
Dennis Luxen
6080eaebbd Merge pull request #1267 from alex85k/develop
fix appveyor packaging
2014-11-13 17:26:48 +01:00
alex85k
41ea339053 fix appveyor packaging 2014-11-13 20:16:40 +03:00
Dennis Luxen
75f9c08445 Merge pull request #1266 from Project-OSRM/revert-1256-patch-1
Revert "fix #1255 assume lift gates are passable"
2014-11-13 14:24:09 +01:00
Dennis Luxen
cec3d1488a Revert "fix #1255 assume lift gates are passable" 2014-11-13 14:23:54 +01:00
Dennis Luxen
ebec082da2 Merge pull request #1256 from AlanBell/patch-1
fix #1255 assume lift gates are passable
2014-11-13 14:23:42 +01:00
Dennis Luxen
bec585e382 update distance table entries only if larger than 0. 2014-11-13 13:45:21 +01:00
Dennis Luxen
2cc8ae875a Merge pull request #1259 from Steffaan/develop
Update NearestPlugin.h to return correct names on mulitple results.
2014-11-11 10:33:49 -08:00
Dennis Luxen
db8252e650 Merge branch 'AlanBell-patch-1' into develop 2014-11-11 09:47:53 -08:00
Dennis Luxen
e3cb26a1c4 Merge branch 'patch-1' of https://github.com/AlanBell/osrm-backend into AlanBell-patch-1 2014-11-11 09:47:16 -08:00
Stefan
44036ae26d Update NearestPlugin.h to return correct names on mulitple results. 2014-11-11 18:22:32 +01:00
AlanBell
5b5f871a6e Merge pull request #1 from AlanBell/master
test case for lift gate access
2014-11-11 09:26:54 +00:00
AlanBell
9a8f9cae6d test case for lift gate access 2014-11-11 09:16:57 +00:00
AlanBell
8f804581c0 fix #1255 assume lift gates are passable
lift gates are commonly found on industrial parks or businesses, delivery drivers need to route to these, most gates are permissive and open in daytime, this patch won't route through gates where access is specifically no.
2014-11-07 10:29:25 +00:00
Dennis Luxen
e26ef17545 reserve delta vector beforehand to avoid realocations. 2014-11-01 17:32:49 -04:00
Dennis Luxen
800bb223b5 remove unused variable 2014-11-01 17:15:20 -04:00
Dennis Luxen
75606f2100 reformatting 2014-10-31 12:15:09 -04:00
Dennis Luxen
a28928e6ca use double braces for array initialization as brace elision is implemented/supported differently in GCC and Clang 2014-10-29 10:39:23 -04:00
Dennis Luxen
8700007025 Merge branch 'revert-1240-revert-1217-sketch-upstream' into develop 2014-10-29 10:18:44 -04:00
Patrick Niklaus
520f7fa2de Add UnitTest for DP
Conflicts:
	CMakeLists.txt
2014-10-29 00:40:34 +01:00
Patrick Niklaus
096208a154 Move DP thresholds back to header, since they are needed for testing
Conflicts:
	Algorithms/DouglasPeucker.cpp
2014-10-29 00:38:52 +01:00
Patrick Niklaus
27caab69ec Fix broken DP 2014-10-29 00:37:45 +01:00
Patrick Niklaus
3fe2b587cb Revert "Revert "Bring general sketch commits upstream"" 2014-10-29 00:33:43 +01:00
Dennis Luxen
c791188811 separate logic between polyline compression algorithm and JSON formatting.
fixes and closes #1245
2014-10-28 17:31:51 -04:00
Dennis Luxen
b227c90c18 remove redundant local variable 2014-10-28 11:11:06 -04:00
Dennis Luxen
8a5538356b remove redundant local variable 2014-10-28 10:39:29 -04:00
Dennis Luxen
b257c881b5 explicit casts help mitigate MSVC warnery 2014-10-28 10:36:09 -04:00
Dennis Luxen
0f5dffb1c3 add some specific casts to avoid MSVC warnery 2014-10-28 10:36:02 -04:00
Dennis Luxen
d2bd238274 Merge pull request #1244 from Project-OSRM/run_unittests_on_travis
Run unittests on travis
2014-10-28 10:35:22 -04:00
Dennis Luxen
fed700440d pick different random seed to avoid edge case 2014-10-28 09:49:55 -04:00
Dennis Luxen
32a9d42412 run datastructure unit tests on travis 2014-10-28 09:14:43 -04:00
Dennis Luxen
efc938d870 fix building of tests/benchmark 2014-10-28 09:11:14 -04:00
Dennis Luxen
369f669227 break out PhantomNode.h into a header/impl combo, rename to new naming scheme. 2014-10-27 17:56:06 -04:00
Dennis Luxen
1c56671f01 reformat to break overly long lines 2014-10-27 17:34:50 -04:00
Dennis Luxen
4dbc1e0e96 reformat to fix OCLint long line warning 2014-10-27 13:20:33 -04:00
Dennis Luxen
94288843f1 make entire_length variable a private member that cannot be set from the outside and only accessed thru a const getter. 2014-10-27 12:21:29 -04:00
Dennis Luxen
b12decc865 Merge pull request #1240 from Project-OSRM/revert-1217-sketch-upstream
Revert "Bring general sketch commits upstream"
2014-10-27 10:08:17 -04:00
Dennis Luxen
0fc944abf3 Revert "Bring general sketch commits upstream" 2014-10-27 10:07:07 -04:00
Dennis Luxen
9f96c98f02 Merge pull request #1217 from TheMarex/sketch-upstream
Bring general sketch commits upstream
2014-10-26 10:19:24 -04:00
Patrick Niklaus
9805b05738 Reorder include and use correct datatypes 2014-10-25 10:14:31 +02:00
Patrick Niklaus
13ed186469 Fix include order in staticrtree 2014-10-25 10:14:31 +02:00
Patrick Niklaus
00a43221ac Use numeric_limits 2014-10-25 10:14:31 +02:00
Patrick Niklaus
edc39112e2 Add wrapper function to DouglasPlucker for backwards-compability 2014-10-23 16:23:54 +02:00
Patrick Niklaus
3b727dea99 Make atan2_lookup inline since it is header-declared 2014-10-23 16:23:54 +02:00
Patrick Niklaus
f16b2adec7 Allow empty ranges in DP 2014-10-23 16:23:54 +02:00
Patrick Niklaus
7d425aa76f Use iterators for DouglasPeucker 2014-10-23 16:23:54 +02:00
Patrick Niklaus
651c07c724 Add global timer utils
Global timers can be used to accumulate timings of the same context
in a thread-safe way.
2014-10-23 16:23:54 +02:00
Patrick Niklaus
4d27b75897 Move Rectangle2DInt to own header 2014-10-23 16:23:54 +02:00
Dennis Luxen
6f75d68d07 untangle includes 2014-10-23 16:11:54 +02:00
Dennis Luxen
ae269e12bb disable debug code in rtree 2014-10-23 16:11:35 +02:00
Dennis Luxen
3a48929fe6 add benchmark for a single coordinate incremental lookup 2014-10-23 16:11:01 +02:00
Dennis Luxen
be970326b6 remove superflous include from library 2014-10-22 19:28:15 +02:00
Dennis Luxen
463511871f Refactor routing plugins:
- remove superflous members from RawRouteData, partially implements #1238
- DescriptorTable moved to BaseDescriptor.h
- added templated assignment c'tor to DescriptorConfig
- refactored check for valid input coordinates, moved to BasePlugin.h
- replaced shared_ptr's to descriptors in ViaRoutePlugin.h with unique_ptr
- implemented FindIncrementalPhantomNode in facades for a single, i.e. first result
- untangled a few includes
2014-10-22 19:02:19 +02:00
Dennis Luxen
002da1e02d add range-based for_each_pair 2014-10-22 18:56:14 +02:00
Dennis Luxen
b095aae5ce some minor include untangling 2014-10-21 19:05:56 +02:00
Dennis Luxen
511c21029e To arrive at a later point in time: Revert "remove inline keywords"
This reverts commit 81b0447024.
2014-10-21 18:34:50 +02:00
Dennis Luxen
81b0447024 remove inline keywords 2014-10-21 18:06:58 +02:00
Dennis Luxen
d42772a261 bump variant dependency 2014-10-20 16:02:26 +02:00
Dennis Luxen
c1136099a9 fix link order to make symbol available in libosrm 2014-10-20 13:26:51 +02:00
Dennis Luxen
06f8a975c0 prevent double compile of dependent compile units 2014-10-20 13:04:44 +02:00
Dennis Luxen
c8cd8775f6 Merge branch 'develop' of github.com:Project-OSRM/osrm-backend into develop 2014-10-20 12:54:12 +02:00
Dennis Luxen
f9900c91bd Merge branch 'alex85k-mingw-support' into develop 2014-10-20 12:53:09 +02:00
Dennis Luxen
accaf6e77e Merge branch 'mingw-support' of https://github.com/alex85k/Project-OSRM into alex85k-mingw-support 2014-10-20 12:52:45 +02:00
Dennis Luxen
8490e297a9 add todo marker 2014-10-20 11:39:23 +02:00
Dennis Luxen
6d3a4b5f6c deactivate inactive includes 2014-10-20 11:25:50 +02:00
Dennis Luxen
1f36206f45 replace boost::get<> call with proper function call to mapbox::variant 2014-10-20 11:25:34 +02:00
Dennis Luxen
952e10936c rename variable 2014-10-20 10:58:45 +02:00
Dennis Luxen
2b3093a687 reformat file according to guidelines 2014-10-20 10:32:57 +02:00
Dennis Luxen
d7e25772b0 remove left-over boost::noncopyable and replace by c++11 ctor deletes. 2014-10-20 10:20:58 +02:00
Dennis Luxen
c66c9b0353 Merge branch 'alex85k-warning-fix' into develop 2014-10-20 10:13:36 +02:00
alex85k
bbde0d75da remove unused variable in Windows code 2014-10-18 19:19:26 +06:00
alex85k
c3aec4f627 do not use gcc-ar for MinGW 4.9 2014-10-18 19:13:46 +06:00
alex85k
113852eed4 use math defines on Mingw 2014-10-18 18:47:17 +06:00
Dennis Luxen
6b9b2c1468 Merge pull request #1231 from Project-OSRM/testing/smarter_caching
smarter caching of test files
2014-10-17 15:59:08 +02:00
Emil Tin
2c87b295ff add raketask for clearing test cache files 2014-10-17 15:13:06 +02:00
Emil Tin
93767d68f8 remove debug output 2014-10-17 15:07:56 +02:00
Emil Tin
cc3646ca16 fix tests that use {base} expansion 2014-10-17 15:07:56 +02:00
Emil Tin
48333f73d5 rename rather than copy then when possible 2014-10-17 15:07:56 +02:00
Emil Tin
1f4241a63d smarter caching of test files 2014-10-17 15:07:56 +02:00
Dennis Luxen
8eccfaa034 fix a number of implicit conversions 2014-10-17 14:19:33 +02:00
Dennis Luxen
438d1af12a fix implicit type conversios 2014-10-17 13:03:49 +02:00
Dennis Luxen
5be6ef380f replace shared_ptr instances to make intent of single owner more obvious 2014-10-17 12:35:53 +02:00
Dennis Luxen
76419ed2fc remove unneeded member variable 2014-10-17 12:32:18 +02:00
Dennis Luxen
4684921e51 fix implicit casts 2014-10-17 12:31:02 +02:00
Dennis Luxen
edd8caa2bf compile Fingerprint only once 2014-10-17 12:30:11 +02:00
Dennis Luxen
cb5575ae89 remove compile-time time stamps, rely on git SHA instead, fixes #1229 2014-10-17 10:57:00 +02:00
Dennis Luxen
42e726dec5 reformat according to styleguide 2014-10-16 17:49:10 +02:00
Dennis Luxen
e3d33aa171 add const keywords where possible 2014-10-16 17:43:05 +02:00
Dennis Luxen
f2ceeb35da fixes issue #1167, odd routing instructions
- the turn angle for compressed edges was not computed from the uncompressed geometry
- for a given turn (a,b,c) the last compressed node for edge (a,b) and the first packed node for (b,c) is returned
- adds a cucumber test to guard against regression
2014-10-16 15:58:58 +02:00
Dennis Luxen
577cf5ddc4 retrieve first and last nodes of a compressed segment 2014-10-16 15:42:33 +02:00
Dennis Luxen
91ced39233 replace shared_ptrs with std::unique_ptr<> in Prepare 2014-10-16 12:10:43 +02:00
Dennis Luxen
4b6cb0b8b8 replace raw ptrs with std::unique_ptr<> in Prepare 2014-10-16 12:10:12 +02:00
Dennis Luxen
fb81302382 fix typo: Lunux->Linux 2014-10-16 11:52:16 +02:00
Dennis Luxen
dfc81f65ee Merge pull request #889 from Project-OSRM/experimental/cuke_datastore
use osrm-datastore for testing, keep osrm-routed runnning
2014-10-15 15:41:38 +02:00
Dennis Luxen
909db4c861 replace inline with anonynmous namespace to avoid duplicate symbols during linking 2014-10-15 15:15:40 +02:00
Dennis Luxen
4277eed1b6 Revert "remove whitespace from package description"
This reverts commit 6f5703a5fe.
2014-10-15 13:21:42 +02:00
Dennis Luxen
6f5703a5fe remove whitespace from package description 2014-10-15 12:55:40 +02:00
Dennis Luxen
f7469f298d add a tail to the oneway circle to avoid edge cases 2014-10-15 11:33:43 +02:00
Dennis Luxen
b29d5df7a2 simplify conditional operation, remove useless parantheses 2014-10-15 10:43:58 +02:00
Dennis Luxen
549ba65861 catch a number of uncaught exceptions 2014-10-15 10:23:48 +02:00
Dennis Luxen
a9d99cbe54 fix inverted logic 2014-10-14 18:03:24 +02:00
Emil Tin
8438024370 avoid unnessecary process check 2014-10-14 16:05:06 +02:00
Dennis Luxen
e6a00ddcfd rethrow exception, refactor default block in fully covered switch statement 2014-10-14 15:59:18 +02:00
Emil Tin
71b967d243 test both datastore and direct data load 2014-10-14 15:35:14 +02:00
Dennis Luxen
1fc1e9590a throw an exception instead of false asserts 2014-10-14 12:52:11 +02:00
Dennis Luxen
0a0099fb41 rename variable, break long lines 2014-10-14 12:49:50 +02:00
Dennis Luxen
b890d394ad Add range based CRC32 computation for iterable objects 2014-10-13 18:18:15 +02:00
Dennis Luxen
a7fd37ae76 make Descriptor classes final 2014-10-13 18:17:24 +02:00
Dennis Luxen
41fafae21d mark Plugin classes as final 2014-10-13 17:29:53 +02:00
Dennis Luxen
a38c007f51 throw instead of assert(false) 2014-10-13 17:20:34 +02:00
Dennis Luxen
c7ee402b0e make link tests less brittle, no overlapping paths 2014-10-13 14:56:17 +02:00
Dennis Luxen
1c19796e3e fix container.hpp to properly use std::next and std::end 2014-10-13 13:54:40 +02:00
Emil Tin
76fb0cb965 get process handling up to date 2014-10-13 11:19:49 +02:00
Dennis Luxen
23c79f5cc9 reformat StaticRTreeBench.cpp 2014-10-13 11:15:22 +02:00
Emil Tin
14eac50261 remove datastore test 2014-10-13 11:10:40 +02:00
Emil Tin
cf3eae1c91 disable failing test 2014-10-13 10:58:03 +02:00
Emil Tin
db06cdb4ce adjust datastore testing 2014-10-13 10:58:03 +02:00
Emil Tin
7ba8e51fa9 use osrm-database during testing 2014-10-13 10:58:03 +02:00
Dennis Luxen
bc6466cc36 fix test to inlcude renamed headers 2014-10-13 09:45:07 +02:00
Dennis Luxen
4fbefaef9a catch an uncaught exception and give git revision in springclean tool 2014-10-13 09:42:47 +02:00
Dennis Luxen
be11d3325d add mutex include 2014-10-10 19:38:59 +02:00
Dennis Luxen
274140d309 refactor SimpleLogger into simple_logger compile unit 2014-10-10 19:32:49 +02:00
Dennis Luxen
ed960ccc8d refactor angle computation into class/compile unit 2014-10-10 18:47:28 +02:00
Dennis Luxen
f2b72113c1 refactor ContainerUtil into container.hpp 2014-10-10 18:24:13 +02:00
Dennis Luxen
67a8d30e87 renamed file 2014-10-10 18:19:10 +02:00
Dennis Luxen
dafd0e5db7 rewrite NumericUtils into floating_point.hpp 2014-10-10 18:18:56 +02:00
Dennis Luxen
d6d10cbf06 reformat Coordinate class 2014-10-10 18:00:09 +02:00
Dennis Luxen
3d3ba86be4 Merge pull request #1212 from Project-OSRM/fix_997
implements and fixes #997: support base path for c'tor
2014-10-10 17:17:41 +02:00
Dennis Luxen
52ed8a7ed0 move springclean functionality in its own tools, remove from datastore 2014-10-10 16:55:24 +02:00
Dennis Luxen
9449c99e25 enable partitioning on LTO, good riddance GCC 4.7 2014-10-10 10:46:43 +02:00
Dennis Luxen
4c0846734e rework the population and checking of base paths 2014-10-10 10:41:06 +02:00
Dennis Luxen
4c64f5fe62 remove shared memory indicator member, use unique_ptr for barriers 2014-10-10 10:41:06 +02:00
Dennis Luxen
9455ea0547 fix initialization of use_shared_memory 2014-10-10 10:41:06 +02:00
Dennis Luxen
c3b54a63c3 remove ServerPaths member from OSRM_impl. pass it by value to c'tor 2014-10-10 10:41:06 +02:00
Dennis Luxen
b9e1d3116c implements and fixes #997
- ServerPaths object can be populated by passing base path to OSRM
- reduces code/functionality duplication in node-OSRM
2014-10-10 10:41:05 +02:00
Dennis Luxen
5bb7e62a7c fix test on 'some' Intel FPU 2014-10-10 10:36:24 +02:00
Dennis Luxen
a443f3a0bb add barrier checkpoint to the white list of passable tags 2014-10-10 10:34:34 +02:00
Dennis Luxen
440244eed8 use double precision fp math for mercartor projection and point-line projections (for now), fixes #1191 2014-10-09 18:58:58 +02:00
Dennis Luxen
2b9e25300f disable checking for empty data sets to make tests pass in debug mode, #889 2014-10-09 17:27:41 +02:00
Dennis Luxen
de264dbf94 untangle includes 2014-10-09 14:08:12 +02:00
Dennis Luxen
848b773e24 fix reloading of RTree from shared memory, potentially fixes a number of issue from #889 2014-10-08 19:20:15 +02:00
Dennis Luxen
d92f022041 remove implicit inline keyword from header files 2014-10-08 14:47:51 +02:00
Dennis Luxen
57fab61789 move casts from/to string into static class 2014-10-08 14:47:22 +02:00
Dennis Luxen
ec8f977ebe reformat StringUtil.h 2014-10-08 12:48:20 +02:00
Dennis Luxen
8dc85e7641 use C++11 type traits to reduce code size in integral->string conversion 2014-10-08 12:40:56 +02:00
Dennis Luxen
4e00ebcd74 Merge pull request #1211 from Project-OSRM/fix_1173
Fix and close #1173
2014-10-08 11:44:48 +02:00
Dennis Luxen
335e719b5d pick compressed edge-weights in correct order 2014-10-08 11:01:58 +02:00
Dennis Luxen
415f8ef2d8 add test-case for bug 2014-10-08 11:01:33 +02:00
Dennis Luxen
17615d1d4a Merge pull request #1209 from Project-OSRM/test/links
test link speeds
2014-10-07 18:08:23 +02:00
Emil Tin
5072252c72 test link speeds 2014-10-07 17:05:39 +02:00
Dennis Luxen
46e93770c9 Merge pull request #1208 from Project-OSRM/feature/surfaces
surface, tracktype, smoothness tags in car profile, closes #955, #1208, #389.
2014-10-07 15:11:55 +02:00
Emil Tin
fe43734811 use nil for unlimited surface speeds 2014-10-07 13:50:53 +02:00
Emil Tin
0df81c49d5 surface, tracktype, smoothness tags in car profile 2014-10-07 10:43:47 +02:00
Dennis Luxen
5653516b32 traverse *_link roads at a significantly lower speed than the main link, fixes #1174 2014-10-06 13:42:30 +02:00
Dennis Luxen
22da5be08e Merge branch 'frodrigo-develop' into develop 2014-10-06 09:43:11 +02:00
Dennis Luxen
862656aecc Merge branch 'develop' of https://github.com/frodrigo/osrm-backend into frodrigo-develop 2014-10-06 09:42:55 +02:00
Frédéric Rodrigo
ec119a6d52 Add test for maxspeed like 'countrycode:zone type' for car profile 2014-10-04 21:17:18 +02:00
Frédéric Rodrigo
6b98b5f4c7 Parse maxspeed value like FR:urban on car profile 2014-10-04 14:12:14 +02:00
Dennis Luxen
5effe95f2c reformat JSONContainer.h 2014-10-03 11:13:50 +02:00
Dennis Luxen
f22e3fd3ff mark Renderer c'tors in JSONContainer as explicit 2014-10-03 11:02:28 +02:00
Dennis Luxen
0047040af9 encapsulate base64 encoding into class to remove static functions from global namespace 2014-10-03 10:38:37 +02:00
Dennis Luxen
60987e6b9b mark c'tors explicit 2014-10-03 10:27:24 +02:00
Dennis Luxen
27d5e2b219 fix include order 2014-10-03 10:23:21 +02:00
Dennis Luxen
53fd0c3a55 fix initialization of EdgeBasedGraphFactory 2014-10-03 10:21:15 +02:00
Dennis Luxen
63456a6d4f fix position of include guard 2014-10-03 10:19:45 +02:00
Dennis Luxen
d4cd3c2f7b remove superflous include 2014-10-03 10:17:02 +02:00
Dennis Luxen
dbf7137a1a fix include guard name 2014-10-03 10:15:03 +02:00
Dennis Luxen
785891c315 fix name of include guard 2014-10-03 10:03:44 +02:00
Dennis Luxen
b7417ec954 fix name of include guard 2014-10-03 10:02:36 +02:00
Dennis Luxen
61b861f0e5 fix name of include guard 2014-10-03 10:01:24 +02:00
Dennis Luxen
0fea0738bf remove superflous inline keyword 2014-10-03 09:59:04 +02:00
Dennis Luxen
4f25d29815 use nullptr instead of NULL 2014-10-03 09:56:07 +02:00
Dennis Luxen
28302a5040 unique_ptr<T> should be unique_ptr<T[]> when used with array 2014-10-02 19:26:57 +02:00
Dennis Luxen
9cc5ca5c58 fix name of include guard 2014-10-02 19:24:43 +02:00
Dennis Luxen
4c4e60b3c9 fix name of include guard 2014-10-02 19:24:06 +02:00
Dennis Luxen
5689a96602 make c'tors of Descriptors explicit 2014-10-02 19:22:02 +02:00
Dennis Luxen
8b57db467a move c'tor should not take const argument 2014-10-02 19:19:52 +02:00
Dennis Luxen
50339e53e2 rename variable across all ifdef paths 2014-09-30 14:52:16 +02:00
Dennis Luxen
bc9f5189a5 use irange based for loop in DouglasPeucker run 2014-09-30 14:42:55 +02:00
Dennis Luxen
fee83fee40 rename short variable and reformat, OCLint 2014-09-30 14:30:15 +02:00
Dennis Luxen
cd5112ab0e rename short variable, OCLint 2014-09-30 14:28:00 +02:00
Dennis Luxen
a43b88f9a2 reformat 2014-09-30 14:22:11 +02:00
Dennis Luxen
c20fd5dcaa fix short variable name, OCLint 2014-09-30 14:21:24 +02:00
Dennis Luxen
f12e296c09 fix short variable name, OCLint 2014-09-30 14:19:49 +02:00
Dennis Luxen
9c3a572646 link unlocking tool against Threads 2014-09-29 16:59:09 +02:00
Dennis Luxen
6175faa9a4 Merge pull request #1202 from Project-OSRM/fix_1192
Fix and close #1192
2014-09-29 12:27:52 +02:00
Dennis Luxen
af02fc6bbe add tests for ferry durations 2014-09-29 11:44:51 +02:00
Dennis Luxen
cc0bbc42a2 add duration to backward speed, fixes #1192 2014-09-29 11:37:36 +02:00
Dennis Luxen
fd747c7340 propagate Lua include dir when compile-checking Luabind, fixes #1196 2014-09-25 12:58:23 +02:00
Dennis Luxen
bd33202972 make routing algorithm classes final 2014-09-24 16:03:52 +02:00
Dennis Luxen
f6f0de0e38 pimpl OSRM lib with std::unique_ptr 2014-09-24 13:17:55 +02:00
Dennis Luxen
881041800b remove superflous include 2014-09-23 09:41:28 +02:00
Dennis Luxen
11f3ac16f6 add some formatting 2014-09-23 09:41:10 +02:00
Dennis Luxen
969bf95230 Merge pull request #1194 from Project-OSRM/better_luabind_check
better checking for luabind compilation, fixes some OSX woes
2014-09-19 17:08:39 +02:00
Dennis Luxen
abc6b4180c better checking for luabind compilation, fixes some OSX woes 2014-09-19 16:33:24 +02:00
Dennis Luxen
f74d762a92 Merge branch 'alex85k-luabind-check' into develop 2014-09-19 09:57:56 +02:00
Dennis Luxen
f00892ed66 Merge branch 'luabind-check' of https://github.com/alex85k/Project-OSRM into alex85k-luabind-check 2014-09-19 09:57:43 +02:00
alex85k
f14c6e6845 Auto-detect Lua compatible with installed Luabind 2014-09-18 23:34:51 +06:00
Dennis Luxen
b1bbf2ef84 add relational operators 2014-09-18 11:10:23 +02:00
Dennis Luxen
201062cade make width of computation depend on base type, i.e. if its 64bit then use 64bit math 2014-09-18 10:19:40 +02:00
Dennis Luxen
8cb9198bcf allow a 64bit base type 2014-09-18 09:43:11 +02:00
Dennis Luxen
f5e53c0452 make cast operators explicit 2014-09-18 09:42:38 +02:00
Dennis Luxen
41d9c00f70 FixedPointNumber implementation 2014-09-17 19:20:15 +02:00
Dennis Luxen
b52f392c92 Merge branch 'srajkovic-stefan-rajkovic-multiple-nearest-points' into develop 2014-09-16 12:33:06 +02:00
Dennis Luxen
efaa3b5ab2 Merge branch 'stefan-rajkovic-multiple-nearest-points' of https://github.com/srajkovic/osrm-backend into srajkovic-stefan-rajkovic-multiple-nearest-points
Conflicts:
	DataStructures/RouteParameters.cpp
	Server/APIGrammar.h
2014-09-16 12:32:40 +02:00
Dennis Luxen
36f3d8d6ac Merge pull request #1187 from Project-OSRM/upgrade_protobuf_appveyor
2nd try: upgrade to protobuf 2.5.0 on appveyor
2014-09-15 20:10:57 +02:00
Dennis Luxen
e469afa4a9 upgrade to protobuf 2.5.0 on appveyor 2014-09-15 16:21:37 +02:00
Dennis Luxen
9d4b0caa5b fix #1181, uncompressed geometries regressed into array of strings 2014-09-15 14:27:27 +02:00
Dennis Luxen
392c07951e some renaming of member functions to remove ambiguity 2014-09-15 14:23:43 +02:00
Dennis Luxen
8e72c3d81e Merge pull request #1184 from Project-OSRM/cmake_object_library
use object libraries in cmake, bump cmake to 2.8.8+
2014-09-15 13:15:12 +02:00
Dennis Luxen
02428f1e06 add object library to benchmarks 2014-09-15 12:21:13 +02:00
Dennis Luxen
b3aa513563 manually install cmake on Travis 2014-09-15 12:14:32 +02:00
Dennis Luxen
b8b08cb114 use object libraries in cmake, bump cmake to 2.8.8+ 2014-09-15 11:34:55 +02:00
Dennis Luxen
ebbbf1059d Revert "disable LUA 5.2", cf. #1179
This reverts commit 994bd0a910.
2014-09-15 10:24:44 +02:00
Dennis Luxen
37297076f8 Merge pull request #1177 from joto/patch-3
Add object_types to some tags.
2014-09-07 23:15:03 +02:00
Jochen Topf
a75b2df6fe Add object_types to some tags.
The newest taginfo understand an `object_types` field to restrict the key/value to certain types of OSM objects.
2014-09-07 20:39:56 +02:00
Dennis Luxen
9ccd0f0282 bump variant version 2014-09-04 16:19:00 +02:00
Dennis Luxen
e57d9f2e2e Merge pull request #1157 from Project-OSRM/fix/spelling_of_edge
fix spelling of 'edge'
2014-08-31 11:25:56 +02:00
Emil Tin
cf593ba9f9 fix spelling of edge in SharedDataFacade 2014-08-31 09:09:12 +02:00
Dennis Luxen
9eb862a6a4 Merge pull request #1172 from joto/patch-2
Update taginfo.json
2014-08-25 22:07:08 +02:00
Jochen Topf
bc84e08da5 Update taginfo.json 2014-08-25 21:55:07 +02:00
Dennis Luxen
24dae2f096 fix URL 2014-08-22 10:43:25 +02:00
Dennis Luxen
ab24d6bd96 add JSON file for taginfo analysis 2014-08-22 10:42:43 +02:00
Dennis Luxen
7782c80c4f implement missing loading of TravelMode vector into shared memory 2014-08-22 10:31:47 +02:00
Dennis Luxen
994bd0a910 disable LUA 5.2 2014-08-22 10:31:47 +02:00
Stefan Rajkovic
bc9dcba4d4 Removed unnecessary whitespace 2014-08-21 13:24:04 -04:00
Dennis Luxen
85c244ed08 Merge pull request #1166 from Project-OSRM/server_instance_unique_ptr
keep server instance in a shared_ptr
2014-08-21 19:22:37 +02:00
Stefan Rajkovic
495196193c Uses range based check for number of results 2014-08-21 13:19:05 -04:00
Stefan Rajkovic
def1e5e1d8 Set restrictions on number of results possible, so 0 < number <= 100. 2014-08-21 13:15:13 -04:00
Dennis Luxen
2727091e47 Merge pull request #1154 from Project-OSRM/feature/travel_mode
travel mode, closes #569, #603 and #606. Great job!
2014-08-21 15:12:02 +02:00
Dennis Luxen
d7fbd416ba fix expected values of backward speed in test 2014-08-21 12:18:19 +02:00
Dennis Luxen
6a09ce1613 fix comparison in car speed profile 2014-08-21 12:17:03 +02:00
Emil Tin
774e6346e7 more robust check for parsed ways 2014-08-20 17:10:40 +02:00
Dennis Luxen
05b939760c Revert "use more osrm::irange"
This reverts commit d6c6fbfe03.
2014-08-20 15:47:48 +02:00
Dennis Luxen
d6c6fbfe03 use more osrm::irange 2014-08-20 15:34:10 +02:00
Dennis Luxen
bb3cbf2dda fix indentation, remove superflous else clause 2014-08-20 14:01:40 +02:00
Dennis Luxen
39d96a45aa fix lambda syntax 2014-08-20 12:14:31 +02:00
Dennis Luxen
6a8c5c8869 fix typo 2014-08-20 11:57:46 +02:00
Dennis Luxen
96318bbe11 switch from unique to shared ptr 2014-08-20 11:57:31 +02:00
Emil Tin
00dd2463fd use lambda to decide turn value 2014-08-20 11:48:47 +02:00
Emil Tin
bcd55626ef make accessors const, add comments 2014-08-20 11:37:47 +02:00
Dennis Luxen
8f8cb6a52f keep server instance in a unique_ptr 2014-08-20 11:24:29 +02:00
Emil Tin
2e3d33dfcd remove type from more structs, remove asserts 2014-08-20 11:08:59 +02:00
Emil Tin
1e40cd6f0b remove type assertion 2014-08-20 11:08:59 +02:00
Emil Tin
6e2608b2f2 fix cuke support file 2014-08-20 11:08:59 +02:00
Emil Tin
60d80cf261 code style fixes 2014-08-20 11:08:59 +02:00
Emil Tin
9c23fd4a31 remove accidentially added file 2014-08-20 11:08:59 +02:00
Emil Tin
fccb1aad32 remove type attribute 2014-08-20 11:08:59 +02:00
Emil Tin
2780ff31b5 fix bug with mode of 1st instruction 2014-08-20 11:08:59 +02:00
Emil Tin
c37c8dc21d add mode test 2014-08-20 11:08:59 +02:00
Emil Tin
6ee7a81f10 update foot profile, add ferry mode 2014-08-20 11:08:58 +02:00
Emil Tin
3d94638d86 update car profile, add ferry mode 2014-08-20 11:08:58 +02:00
Emil Tin
418ff95543 fix initialization order 2014-08-20 11:08:58 +02:00
Emil Tin
221113cbb7 fix assert 2014-08-20 11:08:58 +02:00
Emil Tin
13ea12cf6e fix unit test 2014-08-20 11:08:58 +02:00
Dennis Luxen
1945aae4dc reorder members of SegmentInformation, remove bit fields where possible 2014-08-20 11:08:58 +02:00
Emil Tin
30362cfc0c update lua interface to speed and mode 2014-08-20 11:08:58 +02:00
Emil Tin
6cdc590db5 typedef instead of enum for TravelMode to avoid gcc warnings 2014-08-20 11:08:58 +02:00
Emil Tin
eb122a2b8c tidy feature file 2014-08-20 11:08:58 +02:00
Emil Tin
feaf8711d3 announce mode changes 2014-08-20 11:08:58 +02:00
Emil Tin
6e364ff0ba rename travel mode None to Inaccessible 2014-08-20 11:08:58 +02:00
Emil Tin
6f6aff7493 remove direction field from ExtractionWay 2014-08-20 11:08:58 +02:00
Emil Tin
207cddd50b use enum for TravelMode 2014-08-20 11:08:58 +02:00
Emil Tin
35988d8f09 fix problem with mode of first instruction 2014-08-20 11:08:42 +02:00
Emil Tin
bea63028c7 remove bitfield from SegmentInformation, works around compile err 2014-08-20 11:08:42 +02:00
Emil Tin
0244060806 add a few tests 2014-08-20 11:08:42 +02:00
Emil Tin
bfdc296f43 reduce failing test 2014-08-20 11:08:42 +02:00
Emil Tin
8e625a5d07 rename test 2014-08-20 11:08:42 +02:00
Emil Tin
3460bd0ba9 fix problems with mode, 1 failing test left 2014-08-20 11:08:42 +02:00
Emil Tin
4dd0377eb8 fix compilation of tests 2014-08-20 11:08:42 +02:00
Emil Tin
6e1ab9fe3a profile fixes 2014-08-20 11:08:42 +02:00
Emil Tin
7a2d214cc4 reactivate assert of sizeof(NodeBasedEdgeData) 2014-08-20 11:08:42 +02:00
Emil Tin
62495a6de4 remove comment 2014-08-20 11:08:42 +02:00
Emil Tin
8ea88468f3 remove unneeded methods 2014-08-20 11:08:42 +02:00
Emil Tin
687892890b remove spurious comment 2014-08-20 11:08:42 +02:00
Emil Tin
ff0dfacc48 fix initialization order to avoid compiler warning 2014-08-20 11:08:42 +02:00
Emil Tin
235a52032a more tests passing 2014-08-20 11:08:42 +02:00
Emil Tin
a5ee7e78f6 fixes 2014-08-20 11:08:41 +02:00
Emil Tin
181dbe8493 improve tests for travel mode 2014-08-20 11:08:41 +02:00
Emil Tin
dae9c9a7ed use 4 bits for travel mode 2014-08-20 11:08:41 +02:00
Emil Tin
6d6d299ea4 most tests passing 2014-08-20 11:08:41 +02:00
Emil Tin
6fd615b9cd first cut at porting travel mode, some tests fail 2014-08-20 11:08:41 +02:00
Emil Tin
d09394ed52 add failing tests for travel mode 2014-08-20 11:08:41 +02:00
Emil Tin
3e6f27d173 rename contra_flow to travel_mode, use unsigned char 2014-08-20 11:08:41 +02:00
Dennis Luxen
82c2ae5441 first round of replacing deprecated typedefs with much nicer using statements 2014-08-19 13:01:38 +02:00
Dennis Luxen
7edf2bb2c2 Merge pull request #1164 from Project-OSRM/appveyor_nuget
Install protoc on both Travis and AppVeyor.
2014-08-19 11:00:23 +02:00
Dennis Luxen
c9607b99a3 install protoc thru nuget 2014-08-19 10:11:32 +02:00
Dennis Luxen
2fe1a84dd4 adding protobuf compiler to dependencies, used in branches 2014-08-19 09:56:49 +02:00
Dennis Luxen
c63218a889 add final/override keyword where possible to help compiler de-virtualize function calls 2014-08-18 10:19:33 +02:00
Dennis Luxen
5efa9664db Revert "fixing line endings"
This reverts commit dc75469e78.
2014-08-15 18:53:00 +02:00
Dennis Luxen
dc75469e78 fixing line endings 2014-08-15 18:47:26 +02:00
Dennis Luxen
9d1e21b5ad Merge pull request #1104 from Project-OSRM/experimental/mapbox_variant
Experimental/mapbox variant
2014-08-14 18:57:53 +02:00
Dennis Luxen
27a367c733 enter build directory before calling tests 2014-08-14 17:29:11 +02:00
Dennis Luxen
ffa0ace2a7 build tests by running msbuild on tests project file 2014-08-14 17:29:10 +02:00
Dennis Luxen
074e1e992c build test target explicitly on AppVeyor 2014-08-14 17:29:10 +02:00
Dennis Luxen
cdd72c7e56 fast forward variant lib 2014-08-14 17:29:10 +02:00
Dennis Luxen
a5e99a95a3 remove constexpr workaround as minimum req. is now Nov 2013 CTP 2014-08-14 17:29:10 +02:00
Dennis Luxen
1de736019d make canary static const instead of constexpr 2014-08-14 17:29:10 +02:00
Dennis Luxen
d6b2712070 make msbuild less verbose 2014-08-14 17:29:10 +02:00
Dennis Luxen
eda8f4ccec make integer literals static const instead of constexpr 2014-08-14 17:29:10 +02:00
Dennis Luxen
7e3f476407 use 64bit cmake generator 2014-08-14 17:29:10 +02:00
Dennis Luxen
e10f36d5f0 use explicit OSRM.sln filename 2014-08-14 17:29:10 +02:00
Dennis Luxen
1bfd9abda3 replace nmake by msbuild 2014-08-14 17:29:10 +02:00
Dennis Luxen
4a1a10fde8 use Nov 2013 CTP to build 2014-08-14 17:29:10 +02:00
Dennis Luxen
4c3cb76ced remove remnants of boost::variant 2014-08-14 17:29:10 +02:00
Dennis Luxen
e2794e9f06 initial checkin of mapbox::util::variant 2014-08-14 17:29:10 +02:00
Dennis Luxen
7d2c627ad2 replace boost::variant w/ mapbox::util::variant 2014-08-14 17:29:10 +02:00
Dennis Luxen
b310e0f718 apply some reformatting 2014-08-14 17:12:58 +02:00
Dennis Luxen
18915ae2bd make dummy __get_cpuid available on Windows 2014-08-14 17:12:58 +02:00
Dennis Luxen
5dbda8f519 refactoring of IteratorBasedCRC32, fixes #1140 2014-08-14 17:12:58 +02:00
Dennis Luxen
82ce9dfc04 reactivate software-based CRC32 on x64 platforms without SSE4.2 2014-08-14 17:12:57 +02:00
Dennis Luxen
ad5cd564ab even more reformatting 2014-08-13 16:11:56 +02:00
Dennis Luxen
6f01f580ca fix several errors reported by OCLint:
- rename variable with short name
- fix inverted logic
- rename members in SpeedProfile
2014-08-13 11:02:36 +02:00
Dennis Luxen
d5130d9fe4 reformatting DescriptionFactory.cpp 2014-08-13 11:02:36 +02:00
Dennis Luxen
0341a0d5e7 reformatting DescriptionFactory.cpp 2014-08-12 19:29:54 +02:00
Dennis Luxen
32191fb05a also build tests on Travis 2014-08-12 16:17:27 +02:00
Dennis Luxen
1592fe377a Merge pull request #1150 from Project-OSRM/feature/announce_via_locations
implements announcement of waypoints, closes #584
2014-08-12 11:49:51 +02:00
Dennis Luxen
5add28410f Adapt test cases to output of way points
- waypoints are now announced in the route guidance
- implements #584
2014-08-12 09:27:17 +02:00
Dennis Luxen
d54a55c12b implements announcement of waypoints, closes #584 2014-08-11 20:29:15 +02:00
Dennis Luxen
aab5e8430f ignore package related files 2014-08-11 16:16:56 +02:00
Dennis Luxen
2e20fdb462 allow building of packages 2014-08-11 16:16:56 +02:00
Dennis Luxen
2ac3da7a90 update minimum compiler to gcc 4.8, take 2 2014-08-11 09:42:29 +02:00
Dennis Luxen
399b79bab2 update minimum compiler to gcc 4.8 2014-08-11 09:39:35 +02:00
Stefan Rajkovic
b9eb936cac Uses current JSON format if number of results requested is 1 2014-08-08 14:06:06 -04:00
Stefan Rajkovic
38117df11b Added ability to get multiple points from /nearest by using num_results argument 2014-08-08 13:58:30 -04:00
Dennis Luxen
27d729baf0 use a return value in Prepare::BuildEdgeExpandedGraph instead of parameter re-assignment 2014-08-08 13:00:39 +02:00
Dennis Luxen
d408a64c8c rename variable to have a longer, more telling name in Prepare 2014-08-08 12:41:57 +02:00
Dennis Luxen
9aeb28066d fix inverted logic 2014-08-07 19:19:21 +02:00
Dennis Luxen
6fb7c8687e fixes #1107, turn restriction combination including overlaps and one-ways 2014-08-07 18:34:56 +02:00
Dennis Luxen
d9666008e3 remove left-over debug output 2014-08-07 18:17:35 +02:00
Dennis Luxen
e132230651 add some minor comments to Range 2014-08-07 17:39:53 +02:00
Dennis Luxen
c2877a0c22 use std::shared_ptr instead of raw ptr 2014-08-07 13:40:43 +02:00
Dennis Luxen
251fc3ec68 apply some more constness 2014-08-07 12:02:57 +02:00
Dennis Luxen
287f0a3b68 minor edit 2014-08-07 12:01:32 +02:00
Dennis Luxen
b03d9fe987 replace INT_MAX by proper typedef 2014-08-07 12:01:31 +02:00
Dennis Luxen
98372ef33f replace boost::irange in Tools 2014-08-05 18:06:15 +02:00
Dennis Luxen
d00f4afb84 replace C limits with STL-defined and typedef'ed limits 2014-08-05 17:20:01 +02:00
Dennis Luxen
d4bf02c882 replace boost integer range 2014-08-05 17:19:09 +02:00
Dennis Luxen
284e671163 add convenience class for integer range 2014-08-04 17:27:34 +02:00
Dennis Luxen
0f112e5c9d untangle includes 2014-08-04 13:23:37 +02:00
Dennis Luxen
759449b4be remove an unneeded check in JSONDescriptor 2014-08-01 15:59:45 +02:00
Dennis Luxen
9c03f919a3 Merge pull request #1138 from dmbreaker/fix/alter_route_end
Fixes alternative route end-point (http://imgur.com/ZQhwTZi)
2014-07-31 17:07:08 +02:00
Dennis Luxen
c9afd9a281 make dummy date in generated test files valid 2014-07-31 16:41:38 +02:00
dmbreaker
a999cb9db9 Fixes alternative route end-point (http://imgur.com/ZQhwTZi) 2014-07-31 16:10:02 +04:00
Dennis Luxen
fdc5bd6195 add try catch, fixes coverity issues 1229132 and 1229133 2014-07-30 11:28:36 +02:00
Dennis Luxen
e1d94eee21 Merge branch 'Zhdanovich-scc_develop' into develop 2014-07-30 09:42:55 +02:00
Kirill Zhdanovich
885f237217 Apply diff https://github.com/Project-OSRM/osrm-backend/pull/1133 to develop branch 2014-07-29 22:12:59 +02:00
Dennis Luxen
5860a4e28e clear external vector after use, closes #1131 2014-07-28 16:15:21 +02:00
Dennis Luxen
2bebed44ff use stxxl as external data store instead of hand-rolled code in /tmp 2014-07-28 15:58:50 +02:00
Dennis Luxen
4990e544cf add a distinct tool to check if hsgr file is valid, closes #1081 2014-07-28 14:51:33 +02:00
Dennis Luxen
8010506d4e remove reverted include 2014-07-28 14:20:17 +02:00
Dennis Luxen
f2f7abb9a8 remove reverted include 2014-07-28 14:19:16 +02:00
Dennis Luxen
85f6ab869e Revert "let ServerFactory return unique ptr instead of raw ptr"
This reverts commit cc7c6b9ece.
2014-07-28 14:08:54 +02:00
Dennis Luxen
fc87b0a11e enabling defaultctor for Server 2014-07-28 12:04:11 +02:00
Dennis Luxen
79bc071754 enabling default copy ctor for Server 2014-07-28 11:24:49 +02:00
Dennis Luxen
797243fc9c return unique ptr instead of raw ptr 2014-07-28 11:03:53 +02:00
Dennis Luxen
cc7c6b9ece let ServerFactory return unique ptr instead of raw ptr 2014-07-28 10:15:22 +02:00
Dennis Luxen
279071e5bb re-add pairwise container traversal 2014-07-28 10:14:24 +02:00
Dennis Luxen
426374ff8a register all classes at once in LUA environment 2014-07-24 18:26:40 +02:00
Dennis Luxen
1508874ebc return early if way is not either highway=* or route=* in car profile. Estimated cost saving 10% 2014-07-24 18:00:37 +02:00
Dennis Luxen
bbe440cacd fix implcit conversion in DynamicGraph 2014-07-24 11:29:03 +02:00
Dennis Luxen
e647e73af9 fix implcit conversion in RestrictionMap 2014-07-24 11:25:43 +02:00
Dennis Luxen
696ddfde0e mark temporaries const 2014-07-24 11:23:33 +02:00
Dennis Luxen
37d6257524 fix implicit conversion in TemporaryStorage 2014-07-24 11:23:03 +02:00
Dennis Luxen
faee894052 add a couple of consts to range based for loops 2014-07-24 10:15:04 +02:00
Dennis Luxen
61f16b8c5e remove code duplication 2014-07-24 09:56:20 +02:00
Dennis Luxen
85eb38e755 reformatting code according to guidelines 2014-07-23 19:28:04 +02:00
Dennis Luxen
a87cf60dfc move common code into Util header 2014-07-23 19:25:09 +02:00
Dennis Luxen
3b135447f3 use typedef Edgeweight instead of raw int 2014-07-23 14:50:45 +02:00
Dennis Luxen
0c3713f7e5 Merge branch 'TheMarex-boost-test' into develop 2014-07-22 18:55:33 +02:00
Patrick Niklaus
4d0571fd73 Fix win32 linking and run test automatically in AppVayor 2014-07-22 18:23:43 +02:00
Patrick Niklaus
4722988bf0 Try including typedefs 2014-07-22 17:17:56 +02:00
Patrick Niklaus
61151535e6 Fix include in RangeTableTest 2014-07-22 17:17:56 +02:00
Patrick Niklaus
bcff6c192c Remove template paramters and constexpr in test
Stops clang from complaining about non-constexpr.
2014-07-22 17:17:56 +02:00
Patrick Niklaus
020d0cfb49 Revert "Change StaticRTree serialization constructor to static function"
This makes clang 3.4 crash on ubuntu because it can not handle lambda
expressions + binding in static member functions correctly.

This reverts commit d6dd6693b18e042c0068da579dcc64d1e5a2e002.
2014-07-22 17:17:56 +02:00
Patrick Niklaus
d38e3bd729 Add tests and benchmarks to appveyor 2014-07-22 17:17:56 +02:00
Patrick Niklaus
84a604f70b Add test for new GetMinDist 2014-07-22 17:17:56 +02:00
Patrick Niklaus
782baf54a3 Remove perpendicular distance call
Since we know that the MBB is axis aligned we can compute
the distance to the line segments a lot simpler.
2014-07-22 17:17:56 +02:00
Patrick Niklaus
d754e4eeca Add benchmark for StaticRTree
Build with 'make benchmarks'
2014-07-22 17:17:56 +02:00
Patrick Niklaus
db98f6191e Prepare alrady writes the correct number of nodes 2014-07-22 17:17:56 +02:00
Patrick Niklaus
b453a42f77 Fixed perpendicular distance calculation of segment endpoint is on equator 2014-07-22 17:17:56 +02:00
Patrick Niklaus
2a6585e664 Add regression test for 'gap' querry bug 2014-07-22 17:17:56 +02:00
Patrick Niklaus
bc013925b8 Consider points on the edge of the rectangle as inside 2014-07-22 17:17:56 +02:00
Patrick Niklaus
8108ecc4d3 Add test for StaticRTree 2014-07-22 17:17:56 +02:00
Patrick Niklaus
1c80584206 Fix GetMinDistance 2014-07-22 17:17:56 +02:00
Patrick Niklaus
a3dd9c3e57 Change StaticRTree serialization constructor to static function
Since the constructor does not satisfy the requirements for a
constructor (the RTree is not properly initialized) make it a
static function instead.
2014-07-22 17:17:56 +02:00
Patrick Niklaus
8f05fc0a84 Make tuning constants template agruments in StaticRTree 2014-07-22 17:17:56 +02:00
Patrick Niklaus
3c4feecda0 Make fstream non-static and StaticRTree thread-specific instead 2014-07-22 17:17:56 +02:00
Patrick Niklaus
e776a51c73 Added test for StaticGraph 2014-07-22 17:17:56 +02:00
Patrick Niklaus
129e8ef98a Fix small errors in StaticGraph 2014-07-22 17:17:56 +02:00
Patrick Niklaus
69134f6d6a Add test for RangeTable 2014-07-22 17:17:56 +02:00
Patrick Niklaus
b32062f875 Fix typo in RangeTable 2014-07-22 17:17:56 +02:00
Patrick Niklaus
8d46ee85f1 Add test for BinaryHeap 2014-07-22 17:17:56 +02:00
Patrick Niklaus
9f9fde1f2b Fix missing include in BinaryHeap 2014-07-22 17:17:56 +02:00
Emil Tin
2b041e09ac tests uturn query param 2014-07-22 13:24:26 +02:00
Emil Tin
73b32bb45e enable setting query params in cuke tests 2014-07-22 13:24:26 +02:00
Dennis Luxen
11e6e74f09 fix implicit conversion 2014-07-22 12:56:24 +02:00
Dennis Luxen
bf3e3f0c3d fix segfault when index into packed geometry ran out of bounds 2014-07-22 11:59:31 +02:00
Dennis Luxen
2656acc321 produce stack trace if script fails during setup. partially implements #1128 2014-07-21 15:46:19 +02:00
Dennis Luxen
e46c9be79f dont fail if script does not define member 2014-07-21 15:44:57 +02:00
Dennis Luxen
507167d5c1 use 64bit int types to not lose precision in for loop counting variables 2014-07-21 13:14:05 +02:00
Dennis Luxen
fc90162f69 fix typo, thx @joto, see #1126 2014-07-21 10:55:13 +02:00
Dennis Luxen
1e8fb7a38c Updated README to reflect new location 2014-07-21 10:50:41 +02:00
Dennis Luxen
afb6c5a09d comparison between signed and unsigned integer expressions 2014-07-18 13:58:37 +02:00
Dennis Luxen
2255ab0a37 remove unneede include 2014-07-18 11:38:05 +02:00
Dennis Luxen
a6ab042078 use parallel sorting for DeallocatingVector 2014-07-18 11:37:07 +02:00
Dennis Luxen
480f70c049 fix down-sizing in resize operation 2014-07-18 11:20:27 +02:00
Dennis Luxen
0592897859 rework assignment/copy operator, add operator[] to DeallocatingVector RA-iterator 2014-07-18 10:59:46 +02:00
Dennis Luxen
d5a9f8e177 refactor DeallocatingVector, apply boost::iterator_facade 2014-07-17 18:26:14 +02:00
Dennis Luxen
5840829cdc refactor DeallocatingVector, apply boost::iterator_facade 2014-07-17 18:25:23 +02:00
Dennis Luxen
fd0946b770 remove unneeded includes, fix variable names 2014-07-17 14:14:14 +02:00
Dennis Luxen
293b462fd2 add timing to SCC generation 2014-07-17 11:27:06 +02:00
Dennis Luxen
3db50fdd54 rename variables in SCC class, add const to variables, reformat 2014-07-17 11:16:26 +02:00
Dennis Luxen
1540e6518c rename variables in SCC class to be more legible 2014-07-17 11:07:35 +02:00
Dennis Luxen
8b30c13cd9 make sure edges are put into shapefile once and only once. 2014-07-17 10:48:30 +02:00
Dennis Luxen
a7eb89b2f0 reformat SCC class, make sure road distances are not counted twice 2014-07-17 10:43:21 +02:00
Dennis Luxen
53c102e1e9 use boost::irange and range based for loop in // for (NodeID node = 0; node < last_node; ++node) 2014-07-17 10:30:56 +02:00
Dennis Luxen
7d90737921 remove zombie code from StronglyConnectedComponents.h 2014-07-17 10:27:47 +02:00
Dennis Luxen
e281f88f2e remove zombie code from StronglyConnectedComponents.h 2014-07-17 10:27:23 +02:00
Dennis Luxen
16c5c7bbb4 set projection to EPSG:4326 for created shapefile 2014-07-17 10:26:27 +02:00
Dennis Luxen
7d4dfd87f1 add c'tor to TarjanEdgeData, use emplace_back in-place construction of edges 2014-07-17 10:25:39 +02:00
Dennis Luxen
6156bf0f9d make uturn parameter optional 2014-07-16 13:01:25 +02:00
Dennis Luxen
ee1fdca52e implement path query with uturns at via nodes 2014-07-16 12:53:33 +02:00
Dennis Luxen
95b5bcbd49 add and parse U-turn parameters in servers APIGrammar 2014-07-16 12:48:11 +02:00
Dennis Luxen
0c529361a3 add member variable/functions to store information if uturns are allowed 2014-07-16 12:47:10 +02:00
Dennis Luxen
7110acc94f add initialization to QueryEdge::EdgeData 2014-07-16 09:44:09 +02:00
Dennis Luxen
1188002bcb downcast position explicitly to unsigned 2014-07-15 16:48:04 +02:00
Dennis Luxen
b47a3f15ce fix initialization on Windows, i.e. cannot convert from bool to bool& 2014-07-15 15:37:30 +02:00
Dennis Luxen
695a2a2b6e use correctly sized 64bit integer and avoid unintended (implicit up/down casts) 2014-07-15 15:25:44 +02:00
Dennis Luxen
c8b4ef3eed add two tests for turn restrictions starting/ending on the same segment 2014-07-15 15:10:13 +02:00
Dennis Luxen
6091248493 fix range initialization on Windows 2014-07-15 15:06:34 +02:00
Dennis Luxen
32fd507ad9 apply more emplace_backs and range based for loops to Contractor 2014-07-15 12:06:52 +02:00
Dennis Luxen
0ee77a37d1 make DynamicGraph::InputEdge c'tor variadic, forward args to EdgeData type 2014-07-15 11:50:08 +02:00
Dennis Luxen
05241544c5 make DeallocatingVector::emplace_back variadic and forward Args to contained element 2014-07-15 11:47:58 +02:00
Dennis Luxen
495c872489 add c'tors to QueryEdge and its EdgeData 2014-07-15 11:46:26 +02:00
Dennis Luxen
8c09edfdbd add minor reformatting 2014-07-15 11:42:27 +02:00
Dennis Luxen
67722cf788 make c'tor of DynamicGraph::InputEdge variadic to be more flexible against changing EdgeData types 2014-07-14 17:35:26 +02:00
Dennis Luxen
8e3484b873 rename ContractorEdgeData members 2014-07-14 17:35:02 +02:00
Dennis Luxen
4622aebabb reorder members for potentially tighter alignment 2014-07-14 17:31:50 +02:00
Dennis Luxen
96f29c27cd make c'tor of StaticGraph::InputEdge variadic to be more flexible against changing EdgeData types 2014-07-14 17:16:28 +02:00
Dennis Luxen
3de98f7a9d prevent in-source builds 2014-07-14 16:21:16 +02:00
Dennis Luxen
2b33fcd92d add c'tor to InputEdge of StaticGraph 2014-07-14 14:49:53 +02:00
Dennis Luxen
b1ffcd4350 rename member to distance 2014-07-14 14:44:24 +02:00
Dennis Luxen
fd500001fb Revert "also build tools on Windows"
This reverts commit 54a757a917.
2014-07-14 14:43:07 +02:00
Dennis Luxen
54a757a917 also build tools on Windows 2014-07-14 14:35:51 +02:00
Dennis Luxen
98dfc218d9 install tools if activated 2014-07-11 15:25:26 +02:00
Dennis Luxen
f6f0f1fb72 fix signed/unsigned comparison in assertion 2014-07-11 14:04:09 +02:00
Dennis Luxen
218c810860 rename variable in XMLParser to make sure its name reflects the actual content 2014-07-11 14:03:38 +02:00
Dennis Luxen
c836b6df3b fix SCC computation in debug mode by clearing a vector 2014-07-11 14:01:28 +02:00
Dennis Luxen
637bab29c6 transform negative numbers to positives by *(-1) 2014-07-11 14:00:33 +02:00
Dennis Luxen
0061b3fcbf remove unneeded member in Extractor, move to function scope 2014-07-11 10:10:50 +02:00
Dennis Luxen
2a19ded9d5 reformat Prepare.h/cpp with clang-format 2014-07-10 15:24:30 +02:00
Dennis Luxen
bda9de0775 use boost::irange and range based for loop 2014-07-10 15:22:02 +02:00
Dennis Luxen
7047610a45 header untangling 2014-07-10 15:17:57 +02:00
Dennis Luxen
903d6f9e12 make instance of Prepare object an rvalue, remove dead code 2014-07-10 15:08:55 +02:00
Dennis Luxen
7d61bb2868 Merge branch 'dmbreaker-feature/prepare' into develop 2014-07-10 15:07:24 +02:00
Dennis Luxen
def7164cad Merge branch 'feature/prepare' of https://github.com/dmbreaker/Project-OSRM into dmbreaker-feature/prepare 2014-07-10 15:07:15 +02:00
Dennis Luxen
fc399e01fe explicitly cast segment length from float to int 2014-07-10 15:06:20 +02:00
Dennis Luxen
ffdc3eee2d use proper float literal instead of implicit cast from int 2014-07-10 15:01:38 +02:00
Dennis Luxen
1f6f44ab01 include untangling of Extractor 2014-07-10 14:45:59 +02:00
Dennis Luxen
19740758c9 Merge branch 'dmbreaker-feature/extractor' into develop 2014-07-10 14:32:20 +02:00
Dennis Luxen
f618660d24 Merge branch 'feature/extractor' of https://github.com/dmbreaker/Project-OSRM into dmbreaker-feature/extractor 2014-07-10 14:32:09 +02:00
Dennis Luxen
f50dbe298a properly initialize variable 2014-07-10 14:03:20 +02:00
Dennis Luxen
c324fbace4 path searches were pruned too early, fixes #1117 2014-07-10 13:56:36 +02:00
Dennis Luxen
d05152af71 Merge pull request #1109 from DennisOSRM/fix/update_rspec_style
update rspec matchers to use expect()
2014-07-05 15:40:37 +02:00
Dennis Luxen
bf228b4ae4 fix integer range to have correct end 2014-07-04 17:41:56 +02:00
Dennis Luxen
ba0c17e287 make sure all node-based edges are serialized in forward fashion 2014-07-04 17:33:18 +02:00
Dennis Luxen
6cfbd4cefe fix unpacking of local path 2014-07-04 17:31:22 +02:00
Dennis Luxen
e17a2e79a0 use range based for w/ integer ranges where possible 2014-07-04 17:23:45 +02:00
Dennis Luxen
72d709ae6c use explicit NodeID type in SharedDataFacade 2014-07-04 17:20:04 +02:00
Dennis Luxen
08ca450c40 change simplified graph loader to return a list of coordinates 2014-07-04 17:19:01 +02:00
dmbreaker
a2951659ac prepare.cpp refactoring 2014-07-03 15:29:15 +04:00
dmbreaker
3a6af3810f One more blank line. 2014-07-03 10:23:43 +04:00
dmbreaker
3973554f07 Added blank lines between includes. 2014-07-03 10:23:43 +04:00
dmbreaker
718cba2e36 Trying to fix win-build 2014-07-03 10:23:43 +04:00
dmbreaker
d2a70d1504 Removed pragma, reorganized includes. 2014-07-03 10:23:43 +04:00
dmbreaker
4bc847ac42 extractor.cpp refactored a bit 2014-07-03 10:23:43 +04:00
Dennis Luxen
c3621edf9c refactor DynamicGraph to use integer ranges where possible 2014-07-02 16:58:19 +02:00
Dennis Luxen
a64f2de9e1 add function to add a node into DynamicGraph 2014-07-02 15:27:09 +02:00
Dennis Luxen
ce684cf9d4 fixes #1110, linker issues on CentOS 2014-07-02 14:38:02 +02:00
Dennis Luxen
1d1be10f16 add functions to load graph into simplified data structures 2014-07-02 14:36:20 +02:00
Dennis Luxen
a09f97c9d5 remove OpenMP library linking 2014-07-02 14:34:44 +02:00
Dennis Luxen
48da2d2dfb add some comment to datastore 2014-07-02 11:21:34 +02:00
Dennis Luxen
36c0edea2a collapse if statement in datastore 2014-07-02 11:18:45 +02:00
Dennis Luxen
3568dc2083 use auto keyword to make code more legible 2014-07-02 11:07:29 +02:00
Dennis Luxen
51ad72a432 remove superflous include 2014-07-02 11:06:55 +02:00
Dennis Luxen
9ce970df8f use default keyword to get rid of compiler warning of not returning a value in a non-void function 2014-07-01 16:51:18 +02:00
Dennis Luxen
cfa4d80dd7 make comparion of loop safe against underflows 2014-07-01 16:30:05 +02:00
Dennis Luxen
885cd05f1a fix data race in SimpleLogger by making state indicator variable atomic 2014-07-01 16:15:56 +02:00
Dennis Luxen
21188725d5 apply a bit of code refactoring to SCC implementation 2014-07-01 15:16:41 +02:00
Dennis Luxen
70f257b62f add BUILD_TOOLS flag, retire WITH_TOOLS soon 2014-07-01 15:16:41 +02:00
Dennis Luxen
e8fb8e13df deactivate unused code 2014-07-01 15:16:41 +02:00
Dennis Luxen
7b7b93e9ba remove debug.bin generation 2014-07-01 15:16:41 +02:00
Dennis Luxen
4014da3cc5 make facade d'tors virtual 2014-07-01 14:26:29 +02:00
Dennis Luxen
410120adee close LUA context to avoid memory leak on shutdown 2014-07-01 14:26:02 +02:00
Dennis Luxen
a98e65aa1e make variables const 2014-07-01 13:27:08 +02:00
Emil Tin
dba9998118 update rspec matchers to use expect() 2014-06-30 20:43:51 +02:00
Dennis Luxen
1c75ce5911 reformat according w/ clang-format 2014-06-30 19:25:45 +02:00
Dennis Luxen
33b30aeb95 Merge branch 'fix/shared_mem_warnings' into develop 2014-06-30 19:23:30 +02:00
Dennis Luxen
abd8d3459a Merge branch 'develop' into fix/shared_mem_warnings 2014-06-30 19:23:15 +02:00
Dennis Luxen
471698c59f fix picking of second route name 2014-06-30 16:05:26 +02:00
Dennis Luxen
e67cf578ae remove explicit c'tor from Coordinate, use initializer list in PolylineCompressor 2014-06-30 15:16:35 +02:00
Dennis Luxen
186ad5d444 stream-line code in PolylineCompressor, apply range-based for loop again 2014-06-30 15:10:28 +02:00
Emil Tin
7eb810c34a fix shared mem warnings 2014-06-30 13:01:59 +02:00
Dennis Luxen
7817384e3c remove debug call 2014-06-30 11:53:36 +02:00
Dennis Luxen
34256ba358 properly compute sharing of nodes in search space with packed shortest path 2014-06-27 19:41:40 +02:00
Dennis Luxen
08eb5aa7d1 use shrink_to_fit() instead of swap trick 2014-06-27 19:40:47 +02:00
Dennis Luxen
1d3932e8c5 fix an off-by-one issue in the output JSON 2014-06-27 16:18:38 +02:00
Dennis Luxen
3f85b30d4a remove some unneeded includes 2014-06-27 10:38:28 +02:00
Dennis Luxen
e4c398aa23 make std::hash specialization for std::pair<> fully generic 2014-06-27 09:50:57 +02:00
Dennis Luxen
f9417555d0 remove superflous include 2014-06-27 09:50:26 +02:00
Dennis Luxen
5d3123b97f reformat code using clang-format 2014-06-26 13:50:29 +02:00
dmbreaker
25080aaf1d Non-explicit constructor and hash-functions. 2014-06-26 13:50:29 +02:00
dmbreaker
05ac4b5ab6 Fixes to fulfill remarks. 2014-06-26 13:50:29 +02:00
dmbreaker
07e13e2499 Replaced std::pair with classes.
Looks like fixed wrong restriction type in CheckForEmanatingIsOnlyTurn (now RestrictionTarget instead if RestrictionSource).
2014-06-26 13:50:29 +02:00
dmbreaker
2d9645b9b0 Added structures for RestrictionTarget and RestrictionSource. 2014-06-26 13:50:29 +02:00
Dennis Luxen
65ccbedab2 Merge pull request #1103 from dmbreaker/feature/graph_comments
Added some graphical explanations for variables.
2014-06-26 12:16:44 +02:00
Dennis Luxen
631567864b Merge pull request #1098 from TheMarex/rangetable-covertity
Fix coverity warning in RangeTable
2014-06-26 12:15:35 +02:00
Dennis Luxen
39d479128c add better comment to document the source of the hash_combine work 2014-06-26 12:14:47 +02:00
Dennis Luxen
4c0b315c07 Merge pull request #1094 from gberaudo/fixes
Several fixes: remove dead code, fix Int->String conversion for INT_MIN, remove duplicated coordinate from encoded polyline.
2014-06-26 11:54:45 +02:00
dmbreaker
264e83a1f3 Added comments with graphical representation of variables. 2014-06-26 12:31:45 +04:00
Dennis Luxen
2b2ed50721 add a hash combine implementation that has some minor performance guarantees 2014-06-25 18:50:46 +02:00
Dennis Luxen
31fbf99109 fail hard when building tools and not all prequisites are met 2014-06-25 10:53:51 +02:00
Dennis Luxen
63381ad221 fix compilation on GCC 4.8.2, type of priority_queue<> is not properly deduced 2014-06-24 18:31:34 +02:00
Guillaume Beraudo
6ee2d1103e Remove duplicated point in polyline encoded data
First point was outputted twice.
Add test case.
2014-06-24 17:25:36 +02:00
Guillaume Beraudo
bee18dba54 Display warning when routing without street names.
Indeed, street names are optional for routing.
2014-06-24 17:18:52 +02:00
Guillaume Beraudo
481e445e8a Fix printInt when value=INT_MIN (was overflowing) 2014-06-24 17:18:52 +02:00
Guillaume Beraudo
129f7b7441 Remove unused polyline method 2014-06-24 17:18:52 +02:00
Guillaume Beraudo
d6bc3c5175 Remove unused test method 2014-06-24 17:18:52 +02:00
Dennis Luxen
de7c56c6bc remove remaining NULL pointers by nullptrs 2014-06-24 16:50:00 +02:00
Dennis Luxen
0c59ecfa14 remove dead code, produce empty route when origin and destination are the same 2014-06-24 16:09:25 +02:00
Patrick Niklaus
f67241a3cb Fix coverity warning in RangeTable 2014-06-24 13:26:27 +02:00
Dennis Luxen
3b2893944c remove non-existing dependency 2014-06-24 12:45:16 +02:00
Dennis Luxen
dd7d6df4c6 streamline PBF parsing code 2014-06-24 12:25:19 +02:00
Dennis Luxen
efbda436f3 properly cast from int to bool 2014-06-24 11:46:32 +02:00
Dane Springmeyer
2064934939 link -lrt to osrm-prepare 2014-06-23 16:02:58 -07:00
Dennis Luxen
b36cf7c450 remove debug output 2014-06-23 17:34:20 +02:00
Dennis Luxen
a24dd3dee2 use incremental NN query for Nearest plugin 2014-06-23 17:33:55 +02:00
Dennis Luxen
7b22f08869 remove dead code 2014-06-23 17:32:52 +02:00
Dennis Luxen
840929754a remove debug output 2014-06-23 17:32:24 +02:00
Dennis Luxen
51fd332806 add incremental query to Facades 2014-06-23 16:56:01 +02:00
Dennis Luxen
4d7e0f6b79 use incremental NN query for distance table generation 2014-06-23 16:55:38 +02:00
Dennis Luxen
b74a573ec5 add typedef for an array of phantom node vectors 2014-06-23 16:54:57 +02:00
Dennis Luxen
5faf88afdb implement incremental NN query for R-tree 2014-06-23 16:54:31 +02:00
Dennis Luxen
5e1110930e use proper floating point literal instead of implicit cast from int 2014-06-23 14:42:37 +02:00
Dennis Luxen
f11adf5f80 fix signed/unsigned comparison 2014-06-23 14:35:09 +02:00
Dennis Luxen
40a71e09a6 use an explicit downcast to initialize variable 2014-06-23 13:22:46 +02:00
Dennis Luxen
1231847a3c replace hashmap with a dummy vector based implementation as the number of tags per object is tiny 2014-06-23 13:22:14 +02:00
Dennis Luxen
b06a73e893 replace hashmap with a dummy vector based implementation as the number of tags per object is tiny 2014-06-23 13:21:56 +02:00
Dennis Luxen
f99f194927 use proper interface of HashTable, use prefix increment 2014-06-23 12:13:01 +02:00
Dennis Luxen
eac7d07ef6 rename variables to cut OCLint warnings 2014-06-23 12:11:56 +02:00
Dennis Luxen
60d70a9f4c fix leak on shutdown 2014-06-20 17:32:20 +02:00
Dennis Luxen
c944783590 don't downcast from std:.size_t to unsigned 2014-06-20 17:32:03 +02:00
Dennis Luxen
8104a8aea1 reformat to cut long line 2014-06-20 16:49:33 +02:00
Dennis Luxen
a4db678895 reformat to cut long line 2014-06-20 16:48:34 +02:00
Dennis Luxen
da33d02461 reformat to cut long line 2014-06-20 16:47:09 +02:00
Dennis Luxen
9b4071006e reformat to cut long line 2014-06-20 16:39:58 +02:00
Dennis Luxen
b3cdd5b3bf reformat to cut long line 2014-06-20 16:36:15 +02:00
Dennis Luxen
93e53ec612 fix comparison to accept 0 distance results in distance table 2014-06-19 19:52:15 +02:00
Dennis Luxen
ea8319e2b9 add more asserts to test for data corruption during MBR merging in StaticRTree 2014-06-19 17:52:59 +02:00
Dennis Luxen
2fae253c62 use std::size_t consistently and avoid possible loss of data 2014-06-19 11:14:28 +02:00
Dennis Luxen
e204b257ad add proper size_t->unsigned cast 2014-06-19 10:40:24 +02:00
Dennis Luxen
dd83d8ed61 make size of table compact 2014-06-19 10:40:04 +02:00
Dennis Luxen
61f3d85af1 add even more cast sanity 2014-06-18 11:49:01 +02:00
Dennis Luxen
804e515847 stream line code a bit in Reply 2014-06-18 11:25:56 +02:00
Dennis Luxen
35977b6c7f add explicit cast 2014-06-18 11:24:50 +02:00
Dennis Luxen
23f1d3d83b add explicit cast 2014-06-18 11:20:24 +02:00
Dennis Luxen
b8ea935424 cast bearing to unsigned 2014-06-18 11:17:51 +02:00
Dennis Luxen
7c0866f626 stream line code a bit in Reply 2014-06-18 11:17:23 +02:00
Dennis Luxen
0f2062b739 round bearing value to integers 2014-06-18 11:00:13 +02:00
Dennis Luxen
e91454eeee use auto keyword to deduce types automatically 2014-06-18 10:59:43 +02:00
Dennis Luxen
58134200df use float consistently in DescriptionFactory 2014-06-18 10:44:46 +02:00
Dennis Luxen
f6bab21928 use double consistently in JSONDescriptor 2014-06-18 10:44:09 +02:00
Dennis Luxen
011910811b use float consistently in Contractor 2014-06-18 10:43:26 +02:00
Dennis Luxen
bbc0ba147a reformat Descriptors/JSONDescriptor.h 2014-06-18 10:15:38 +02:00
Dennis Luxen
922a4331db reformat source file datastore.cpp 2014-06-18 09:42:45 +02:00
Dennis Luxen
8f7f1e2683 reformat source file Server/RequestHandler.cpp 2014-06-18 09:40:53 +02:00
Dennis Luxen
1980cc007f cast parameters before c'ting Coordinate 2014-06-17 19:10:26 +02:00
Dennis Luxen
39611f7477 couple more explicit casts 2014-06-17 18:52:01 +02:00
Dennis Luxen
e3d659576f cast std::size_t and unsigned in a proper way 2014-06-17 16:01:06 +02:00
Dennis Luxen
46d4670b74 cast float to unsigned in a proper way 2014-06-17 16:00:42 +02:00
Dennis Luxen
15ca6d5ca9 use explicit casts where feasible 2014-06-17 15:57:03 +02:00
Dennis Luxen
58f23cda4a use explicit casts where feasible 2014-06-17 15:51:43 +02:00
Dennis Luxen
a58d8420a2 add some formatting whitespace 2014-06-17 15:48:47 +02:00
Dennis Luxen
96f834fb81 use explicit casts 2014-06-17 15:47:59 +02:00
Dennis Luxen
86617eccb1 use explicit casts 2014-06-17 15:47:40 +02:00
Dennis Luxen
f2936d1c2d add disabled HipChat notifications to Windows build 2014-06-17 15:47:16 +02:00
Dennis Luxen
0fc8e04ab5 use proper data types to avoid uncessary casts 2014-06-17 15:30:28 +02:00
Dennis Luxen
a65e2d3115 downcast size_t to unsigned 2014-06-17 13:19:59 +02:00
Dennis Luxen
ca6e25b11c make many more conversions explicit 2014-06-17 13:18:55 +02:00
Dennis Luxen
3ec6a6f5bc remove ignored parameter 2014-06-17 13:09:58 +02:00
Dennis Luxen
c12fae47e7 allow results at high latitudes to be a bit more imprecise 2014-06-17 13:00:13 +02:00
Dennis Luxen
604d2c698b replace fp divisions by multiplications 2014-06-17 12:50:29 +02:00
Dennis Luxen
5d14016366 add static_casts to avoid unnecessary conversion from double to float 2014-06-17 12:37:55 +02:00
Dennis Luxen
b112becbba use explicit casts to mitigate MSVC warnings 2014-06-17 12:15:40 +02:00
Dennis Luxen
e68a09fb3c fix windows deploy on develop branch, partially fixes #1085 2014-06-16 15:13:19 +02:00
Dennis Luxen
30e9b4513a Merge branch 'alex85k-develop' into develop 2014-06-16 13:43:26 +02:00
alex85k
671b14dac0 pack only develop version to zip on AppVeyor 2014-06-16 16:02:14 +06:00
Porjo
82e99988e8 Change content-type header for JSON data 2014-06-16 09:29:34 +02:00
Dennis Luxen
313a7ed7fa Merge pull request #1076 from alex85k/patch-mingw
Add Mingw support (tune libraries and disable cpuid with #ifdef)
2014-06-15 21:55:18 +02:00
Dennis Luxen
cf3365574e Merge branch 'TheMarex-thread-control' into develop 2014-06-15 12:35:26 +02:00
Dennis Luxen
0e1f6f50ea Merge branch 'thread-control' of https://github.com/TheMarex/Project-OSRM into TheMarex-thread-control 2014-06-15 12:35:15 +02:00
Dennis Luxen
5b6518d4a9 Merge branch 'TheMarex-diffencoding' into develop 2014-06-15 12:10:18 +02:00
Patrick Niklaus
c009dce591 Another VC2013 fix 2014-06-15 11:42:59 +02:00
Patrick Niklaus
40e2d7932b Fix VC2013 issues 2014-06-15 11:29:36 +02:00
Patrick Niklaus
e29b7a6eae Fix some minor style issues 2014-06-15 11:04:10 +02:00
Patrick Niklaus
a3e9cbc000 Allow user to force thread number
This allows the user to do (potentially) stupid things, but warns him.
The default is TBBs default, so probably the right thing.
To enforce thread numbers in extractor it must be passed to the child
threads.
2014-06-14 17:02:43 +02:00
Patrick Niklaus
aedcc2ff40 Add array inlcude 2014-06-12 22:01:23 +02:00
Patrick Niklaus
4c17aeb180 Removed SSE code in RangeTable to rely on compiler optimazation 2014-06-12 22:01:23 +02:00
Patrick Niklaus
ef60ae652c Fix edge cases in RangeTable 2014-06-12 22:01:23 +02:00
Patrick Niklaus
1d62ed028e Fix off-by-one since back() gives last value inside [begin,end) 2014-06-12 22:01:23 +02:00
Patrick Niklaus
50bf7694c2 Constify some parts of RangeTable 2014-06-12 22:01:22 +02:00
Patrick Niklaus
807f1d7c1c Initial support for SharedDataFacade
SharedDataLayout was refactored to include canary values at the
boundaries of each memory block. This makes it easy to detect overruns
and block-size mismatches between osrm-datastore and the
SharedDataFacade.
2014-06-12 22:01:22 +02:00
Patrick Niklaus
7a7d0c09d9 Integrate RangeTable into server 2014-06-12 22:00:03 +02:00
Patrick Niklaus
f90ce77da4 Use differential encoding for name offsets
Each name is represented as an integer range in a vector of chars.
Instead of storing the absolute offset inside this array, we can store
only the offset to the previous entry (the string size). By doing this we reduce
the number of bytes need to store an offset from 4 to 1 bytes (if we
set a maximum string length of 255).
This is however slower, since the absolute offset must be computed on
each querry by summing up all previous lengths. To limit the
performance inpact we only do this for blocks of a certain size (16).
2014-06-12 22:00:03 +02:00
Dennis Luxen
d27ac27bc7 remove one fwd decl, add more comments to Connection 2014-06-12 13:46:07 +02:00
Dennis Luxen
44c6a64bf4 make c'tor of NodeInfo explicit 2014-06-11 18:26:34 +02:00
Dennis Luxen
2d6eae9391 make conversion explicit 2014-06-11 18:15:36 +02:00
Dennis Luxen
ba440550a6 make conversion explicit 2014-06-11 18:15:31 +02:00
Dennis Luxen
8e24fee9da explicitly cast from int to bool 2014-06-11 17:44:50 +02:00
alex85k
1148652101 Add Mingw support (tune libraries and disable cpuid with #ifdef) 2014-06-11 20:58:53 +06:00
Dennis Luxen
ed01eeaeb3 reformat SharedMemoryFactory according to code guidelines 2014-06-11 15:22:51 +02:00
Dennis Luxen
096f187d6f remove empty line 2014-06-11 15:19:11 +02:00
Dennis Luxen
fa35eb1959 adapt for merge, add deployment details 2014-06-11 15:17:51 +02:00
Dennis Luxen
8d89d30c74 Merge branch 'alex85k-win-038' into develop 2014-06-11 15:15:05 +02:00
alex85k
f1bde40939 add appveyor.yml template 2014-06-11 18:38:03 +06:00
alex85k
4e7ccaa298 use std::memcpy instead of std::copy (avoid checked iterators assertions) 2014-06-11 18:38:02 +06:00
alex85k
d0284991ed patch Ruby files for successful testing on Windows 2014-06-11 18:38:01 +06:00
alex85k
c4998990e5 disable io-benchmark on Windows 2014-06-11 18:38:01 +06:00
alex85k
42d3ee9b94 workaround for std::packaged_task<void()> problem on MSVC 2014-06-11 18:38:00 +06:00
alex85k
be5c3e41e1 Replace sizeof asserts with warning on Windows 2014-06-11 18:37:26 +06:00
alex85k
3282d410c4 Add basic shared memory support for Windows OS 2014-06-11 18:15:17 +06:00
Alexei Kasatkin
75303c95f8 Avoid constexpr by #ifdef (not supported in MSVC18) 2014-06-11 18:15:16 +06:00
Alexei Kasatkin
0209272831 fix includes and definitions (avoid unistd.h, isatty, fix min,max, round and M_PI) 2014-06-11 18:15:15 +06:00
Alexei Kasatkin
0e16c4ed97 Add more Boost libraries on Windows, fix TBB debug linking, stop building
on old Microsoft compilers
2014-06-11 18:15:14 +06:00
Dennis Luxen
e49720f34a add include 2014-06-11 13:44:10 +02:00
Dennis Luxen
8aee371d81 further include untangling, chops 5sec compile time 2014-06-11 12:25:57 +02:00
Dennis Luxen
71c4f81b59 avoid signed/unsigned comparison 2014-06-10 18:08:58 +02:00
Dennis Luxen
3127fafc88 Merge branch 'patch-6' of https://github.com/alex85k/Project-OSRM into develop 2014-06-10 17:40:56 +02:00
Dennis Luxen
4e6bdf28cc fixes #1041, some only_ turn restrictions are inverted under certain conditions 2014-06-10 17:26:22 +02:00
Dennis Luxen
621a5a86a0 fixes #1041, some only_ turn restrictions are inverted under certain conditions 2014-06-10 17:26:05 +02:00
Dennis Luxen
d80c8cbd2f add another turn restriction test 2014-06-10 17:23:24 +02:00
Dennis Luxen
686f1aeeb2 reformat some code 2014-06-10 17:23:07 +02:00
alex85k
e27a69bab7 Use one more .string().c_str() call 2014-06-10 20:34:21 +06:00
Dennis Luxen
4ee2e1d049 fix long line 2014-06-10 10:49:45 +02:00
Dennis Luxen
2102648102 fix short variable name 2014-06-10 10:48:43 +02:00
Dennis Luxen
8611e40172 Merge branch 'TheMarex-fix-cucumber' into develop 2014-06-09 18:41:37 +02:00
Dennis Luxen
7d5b88fff8 Merge branch 'fix-cucumber' of https://github.com/TheMarex/Project-OSRM into TheMarex-fix-cucumber 2014-06-09 18:41:18 +02:00
Dennis Luxen
cfd9aa31a9 add algorithm include 2014-06-09 18:32:07 +02:00
Dennis Luxen
62aea4c321 refactored function names 2014-06-09 18:10:46 +02:00
Dennis Luxen
f75fcb3041 refactor RequestHandler to remove code duplication, nested blocks and object copies 2014-06-09 18:06:23 +02:00
Dennis Luxen
971c557d85 explicitly initialize Header member 2014-06-09 17:58:17 +02:00
Dennis Luxen
ea05aa225e rename some function names in Reply 2014-06-09 17:57:35 +02:00
Dennis Luxen
56cdabff6a add move c'tor to Header 2014-06-09 17:57:03 +02:00
Dennis Luxen
15f62e680a use inplace construction for Headers instead of explicit objects and copying 2014-06-09 17:55:16 +02:00
Dennis Luxen
0af4e16c21 use inplace construction for Headers instead of explicit objects and copying 2014-06-09 17:54:46 +02:00
Dennis Luxen
c7b90bac1a add explicit unsigned->string conversion 2014-06-09 17:50:50 +02:00
Patrick Niklaus
4b81331d53 Don't reset response, so log_fail won't crash cucumber 2014-06-09 14:33:30 +02:00
Dennis Luxen
47ab0cbf62 reduce some code duplication 2014-06-09 12:11:44 +02:00
Dennis Luxen
f5b079b8e7 add more comments to reduce NCSS number 2014-06-09 11:58:23 +02:00
Emil Tin
21c4691d40 cuke: make File.tail utility more robust 2014-06-08 12:06:34 +02:00
Dennis Luxen
3726706608 remove another superflous include 2014-06-06 19:19:45 +02:00
Dennis Luxen
28a53aa147 remove superflous include 2014-06-06 19:18:44 +02:00
Dennis Luxen
2ad572490c const as const can 2014-06-06 18:06:05 +02:00
Dennis Luxen
0ed9caf969 fix a couple of implicit signed/unsigned conversions 2014-06-06 18:05:07 +02:00
Dennis Luxen
63ee376f71 removing constexpr at one position 2014-06-06 18:01:01 +02:00
Dennis Luxen
67bcb98a84 make some constants explicit floats to cut down on MSVC conversion warnings 2014-06-06 15:39:29 +02:00
Dennis Luxen
9cd91ae99c Merge pull request #1066 from alex85k/patch-path-cstr
Obtain char* from boost::filesystem::path on all systems
2014-06-06 12:02:32 +02:00
Dennis Luxen
d111a0e5e6 guard against an empty alternative path in ExtractRouteNames 2014-06-06 11:50:14 +02:00
Dennis Luxen
11d4c04cea removed left-overs from win/, i.e. a previous windows porting attempt 2014-06-06 11:33:47 +02:00
Dennis Luxen
01773c2a00 fix and refactor the selection of RouteNames 2014-06-06 11:30:12 +02:00
alex85k
1079bf7843 sort vectors before using std::set_difference
discussed in https://github.com/DennisOSRM/Project-OSRM/pull/998#issuecomment-45238338
The vectors are better to be sorted up to ``name_id_comperator`` before running std::set_difference. Elsewhere we get debug checked iterator assertions on Windows and theretically possible incorrect results.
2014-06-06 10:27:35 +02:00
Dennis Luxen
05bcfd2c1c Merge pull request #1065 from alex85k/patch-skip-zero-rw
skip zero bytes reading or wrtiting
2014-06-06 10:22:49 +02:00
Alexei Kasatkin
5357a6a4fd get char* from boost::filesystem::path 2014-06-05 23:48:54 +06:00
Alexei Kasatkin
b6787b0014 safeguard: do not read/write 0 bytes (iostream) 2014-06-05 23:16:19 +06:00
Dennis Luxen
a32116d24c Merge pull request #1063 from alex85k/patch-6
simplify static asserts
2014-06-05 18:58:08 +02:00
alex85k
a03b698e5a simplify static asserts
Simplify static asserts to make them compatible with older compilers and MSVC 2013
2014-06-05 22:55:22 +06:00
Dennis Luxen
fa0c5db18c include <string> as it is needed 2014-06-05 18:29:22 +02:00
Dennis Luxen
bc063ded7a make sure result is always > 0, hits when origin and destination are on the same one-way segment in reversed order 2014-06-05 18:28:54 +02:00
Dennis Luxen
846505cbc8 Merge pull request #1051 from TheMarex/linker-fix
Fix linking for linux
2014-06-05 18:14:33 +02:00
Dennis Luxen
964118d1d6 add more comments and rename a couple of badly named variables 2014-06-05 17:27:00 +02:00
Patrick Niklaus
c43b67ea2e Fixes build using gcc 4.9 with LTO.
Otherwise sem_close is not found.
2014-06-05 17:26:19 +02:00
Dennis Luxen
f68af08931 fix short variable names and long lines 2014-06-05 15:40:52 +02:00
Dennis Luxen
cdd5a41965 remove duplicate edges from NodeBasedGraph 2014-06-05 15:33:24 +02:00
Dennis Luxen
e13ee59af3 remove some code lint 2014-06-05 15:14:39 +02:00
Dennis Luxen
9eb183e01d Merge branch 'alex85k-patch-timing' into develop 2014-06-05 11:22:52 +02:00
Dennis Luxen
1163417722 Merge branch 'patch-timing' of https://github.com/alex85k/Project-OSRM into alex85k-patch-timing
Conflicts:
	extractor.cpp
2014-06-05 11:22:26 +02:00
Dennis Luxen
3edc48cda5 Merge branch 'alex85k-patch-6' into develop 2014-06-05 11:04:35 +02:00
Dennis Luxen
2c01425ee5 Merge branch 'patch-6' of https://github.com/alex85k/Project-OSRM into alex85k-patch-6 2014-06-05 11:04:17 +02:00
Dennis Luxen
ed9c72814f Merge pull request #1058 from alex85k/patch-4
add a safe-guard against bad input
2014-06-05 11:02:39 +02:00
Dennis Luxen
adbbe2b097 fix broken transmission of checksum/hinting mechanism on shared memory 2014-06-05 10:55:27 +02:00
alex85k
7335e0809a Globally rename UUID to FingerPrint 2014-06-05 10:31:19 +02:00
alex85k
75dabb75e2 Use TimingUtil.h for all time measurement,
and make TimingUtil.h Windows-compatible
2014-06-04 19:52:34 +06:00
alex85k
15adcd24be Remove extra mutex unlocking in ConcurrentQueue.h
As discussed in https://github.com/DennisOSRM/Project-OSRM/pull/998 , unlocking the mutex is performed on destruction. Second unlocking gives an assertion (for debug version) for Windows and FreeBSD 10.
2014-06-04 18:01:48 +06:00
alex85k
e98ba99331 add a safe-guard against bad input
do not write empty original_edge_data_vector to file
2014-06-04 16:02:18 +06:00
Dennis Luxen
11459d38d0 Merge pull request #1052 from alex85k/patch-4
add a cmake option WITH_TOOLS
2014-06-03 14:58:36 +02:00
alex85k
baf4ea2e8c add a cmake option WITH_TOOLS 2014-06-03 18:38:33 +06:00
Dennis Luxen
6a29168c14 use EdgeWeight typedef where possible 2014-06-03 11:28:39 +02:00
Dennis Luxen
a4689c7a27 add some comments to reduce NCSS complexity 2014-06-03 10:49:25 +02:00
Dennis Luxen
8fda5a187b rename variable to a shorter name 2014-06-03 10:44:09 +02:00
Dennis Luxen
7b78270f4b safe-guard against broken input data 2014-06-02 19:23:50 +02:00
Dennis Luxen
afd3599a9c remove depth of nested block 2014-06-02 18:18:27 +02:00
Dennis Luxen
4bc8562cd0 further reduce lint 2014-06-02 18:18:03 +02:00
Dennis Luxen
11fed4c06c remove variable name lint 2014-06-02 16:05:19 +02:00
Dennis Luxen
9416a983c6 rename one char variable names 2014-06-02 16:04:44 +02:00
Dennis Luxen
8108c6320d use lambda for complex initialization 2014-06-02 15:56:06 +02:00
Dennis Luxen
b40b931568 unlinting DouglasPeucker 2014-06-02 09:48:43 +02:00
Dennis Luxen
282f70ea91 remove debug output 2014-05-30 19:48:34 +02:00
Dennis Luxen
a671f63a3e Apply strong heuristics to speed up line generalization 2014-05-30 19:10:37 +02:00
Dennis Luxen
f3ad14cb7f use integer approximation for polyline generalization 2014-05-30 14:34:04 +02:00
Dennis Luxen
21eb5b661d add integer based approximation for perpendicular distance 2014-05-30 14:33:37 +02:00
Dennis Luxen
87fe073118 re-layout parameters 2014-05-30 13:30:54 +02:00
Dennis Luxen
507dadebf4 fix a couple of variable names 2014-05-30 10:15:35 +02:00
Dennis Luxen
7dac8c621c fix a couple of OCLint warning, i.e. short variable names and useless parantheses 2014-05-30 10:01:55 +02:00
Dennis Luxen
19f4ebf3c5 make threshold values floats by construction 2014-05-30 10:01:18 +02:00
Dennis Luxen
c21b40bebc further renaming of variable names, reduces legacy lint 2014-05-29 19:25:17 +02:00
Dennis Luxen
0766c3c62d refactor member names in ImportEdge 2014-05-29 18:46:20 +02:00
Dennis Luxen
cc40eb709c moved ImportNode/Edge into compile units 2014-05-29 18:31:20 +02:00
Dennis Luxen
3625308585 moved ImportNode/Edge into compile units 2014-05-29 18:31:02 +02:00
Dennis Luxen
df3a7676eb streamline branch-and-bound query code in R-tree 2014-05-29 17:16:24 +02:00
Dennis Luxen
8f6077e973 add proper c'tor to PhantomNode 2014-05-29 17:15:41 +02:00
Dennis Luxen
e6689144c4 remove debug output 2014-05-29 16:27:08 +02:00
Dennis Luxen
a67de410bf move TreeNode exploration into its own function, fix performance regression 2014-05-29 15:36:14 +02:00
Dennis Luxen
54ec1a89de use complex const variable initialization w/ lambda functions instead of conditional operator 2014-05-29 12:47:03 +02:00
Dennis Luxen
4b5f744c6f move distance calculations to float 2014-05-28 18:34:48 +02:00
Dennis Luxen
df978345d7 rename start->source 2014-05-28 18:20:47 +02:00
Dennis Luxen
facc07c60d use correct edge weight type in PathData 2014-05-28 18:20:29 +02:00
Dennis Luxen
2f203ac22c rename start->source 2014-05-28 18:19:27 +02:00
Dennis Luxen
cc864191b8 remove some unneeded flags when compiling with clang 2014-05-28 18:18:57 +02:00
Dennis Luxen
547455245e link against UUID (needed in node-OSRM) 2014-05-28 16:09:51 +02:00
Dennis Luxen
b0d7449bb4 add type traits include 2014-05-28 12:53:18 +02:00
Dennis Luxen
aed04c7d55 server cast int to string only where it is needed 2014-05-28 12:34:48 +02:00
Dennis Luxen
bb5973f2fd rename variable 2014-05-28 12:34:24 +02:00
Dennis Luxen
f801fd1f0d fix inverted logic 2014-05-28 12:06:57 +02:00
Dennis Luxen
44ca12ead6 fix inverted logic 2014-05-28 12:05:42 +02:00
Dennis Luxen
9c48389f74 collapse if statements 2014-05-28 12:03:07 +02:00
Dennis Luxen
acefb5a5f3 remove debug output 2014-05-27 19:05:37 +02:00
Dennis Luxen
3d691a3aec implements #947, free osrm-datastore's shared memory 2014-05-27 18:14:43 +02:00
Dennis Luxen
38ebdbb563 implements #949, wrong duration on first segment 2014-05-27 16:54:10 +02:00
Dennis Luxen
1090325c31 remove superflous check 2014-05-27 14:50:59 +02:00
Dennis Luxen
f8ba4b9312 use C++11 shrinktofit() instead of swap tricks 2014-05-27 12:16:53 +02:00
Dennis Luxen
49a1dfff60 fix off-by-one issue related to #1020 2014-05-27 12:09:05 +02:00
Dennis Luxen
5f4d342d45 move last leg handling into DescribeLeg() function 2014-05-27 11:48:19 +02:00
Dennis Luxen
e1c1f79068 remove todo marker 2014-05-27 11:44:47 +02:00
Dennis Luxen
a716fa252f implements #792 2014-05-27 11:16:55 +02:00
Dennis Luxen
0b12e4d8be remove assert 2014-05-27 10:45:57 +02:00
Dennis Luxen
6ad6c94355 further CMakeLists.txt lint removal 2014-05-26 18:42:29 +02:00
Dennis Luxen
78270c8155 fix unneeded variable warning in release build 2014-05-26 18:40:21 +02:00
Dennis Luxen
4573ae21e6 unlinting CMakeLists.txt 2014-05-26 18:36:11 +02:00
Dennis Luxen
0ab6220635 add some more constness 2014-05-26 18:35:37 +02:00
Dennis Luxen
3b51976b96 remove unneeded include 2014-05-26 18:11:32 +02:00
Dennis Luxen
c35211b2f6 add some const keywords where applicable 2014-05-26 17:37:44 +02:00
Dennis Luxen
f62515e13b commented assertion that is triggered on trivial instances 2014-05-26 16:03:08 +02:00
Dennis Luxen
7f2daf8926 some variables renamed to replace camel case 2014-05-26 16:02:15 +02:00
Dennis Luxen
0325861ef3 remove an unneeded parameter 2014-05-26 15:31:30 +02:00
Dennis Luxen
37f8285a6e implements #1020 2014-05-26 15:31:09 +02:00
Dennis Luxen
d3906cffdc add property to mark end of leg 2014-05-26 15:30:06 +02:00
Dennis Luxen
bee1c77efe make variable const 2014-05-26 15:29:28 +02:00
Dennis Luxen
7250a82286 remove dead code 2014-05-26 13:08:10 +02:00
Dennis Luxen
984457f9c6 remove useless parantheses, straighten includes 2014-05-26 12:49:49 +02:00
Dennis Luxen
5db23f7e46 make short variable names more legible 2014-05-26 12:49:24 +02:00
Dennis Luxen
f4f49b2b46 remove unused variable 2014-05-26 12:42:47 +02:00
Dennis Luxen
58b35f6e2d make short variable names more legible 2014-05-26 12:41:25 +02:00
Dennis Luxen
b51ad16756 remove useless parantheses 2014-05-26 12:37:00 +02:00
Dennis Luxen
d790bda7d2 implements #986, streamline error messages 2014-05-26 12:33:35 +02:00
Dennis Luxen
15ce232f61 partially fixes #1034 2014-05-26 11:59:13 +02:00
Dennis Luxen
d999a47600 partially fixes #1034 2014-05-26 11:47:01 +02:00
Dennis Luxen
644286111f add test for #1034 2014-05-26 11:46:01 +02:00
Dennis Luxen
917b1cbd6c fix index of instructions 2014-05-26 11:38:35 +02:00
Dennis Luxen
6d1b585212 remove unneeded output 2014-05-26 10:19:45 +02:00
Dennis Luxen
6ca35a6264 remove debug output 2014-05-26 09:25:42 +02:00
Dennis Luxen
0290b1b4e0 Merge branch 'dmbreaker-develop' into develop 2014-05-23 14:50:23 +02:00
Dennis Luxen
1d86bf3e56 Merge branch 'develop' of https://github.com/dmbreaker/Project-OSRM into dmbreaker-develop 2014-05-23 14:50:05 +02:00
Dennis Luxen
3fd8ab8d3a use parallel sorting when loading OSRM data files 2014-05-23 14:49:50 +02:00
Dennis Luxen
d240ae3b03 sort edges in StaticGraph in parallel 2014-05-23 14:32:40 +02:00
Emil Tin
b875765c52 update test to avoid single ring 2014-05-23 12:52:32 +02:00
shipenok
2bdec31219 minor fix to open result in browser 2014-05-23 14:27:55 +04:00
Emil Tin
a9eebdb1fa fix test related to via points and #1034 2014-05-23 11:45:18 +02:00
Emil Tin
b25f3a9e91 update test related to via points and #1034 2014-05-23 11:42:44 +02:00
Emil Tin
06f3375a97 test showing bug related to via points. see #1034 2014-05-23 11:23:11 +02:00
Dennis Luxen
5057ae920c replace a couple of std::sort calls with tbb::parallel_sort 2014-05-22 19:07:29 +02:00
Dennis Luxen
6a03f13d55 fixes #1032:
- remove left-overs from OpenMP
- replace omp_* calls with TBB equivalents
2014-05-22 18:39:11 +02:00
Dennis Luxen
20cbfd95d6 remove OpenMP references from CMakeLists.txt 2014-05-22 18:39:11 +02:00
Dennis Luxen
885dbe1e65 Merge pull request #1028 from TheMarex/tbb-port
Port from OpenMP to TBB
2014-05-22 16:57:06 +02:00
Patrick Niklaus
e2daf5c2fc Make some temporary variables const 2014-05-21 21:49:22 +02:00
Patrick Niklaus
bef113001a Add TBB to travis.ymk 2014-05-21 21:49:22 +02:00
Patrick Niklaus
f0b403bc2e Set requested threads in TBB 2014-05-21 21:49:22 +02:00
Patrick Niklaus
a21fb5fc89 Use append operator instead of function, because function is inplace. 2014-05-21 21:49:22 +02:00
Patrick Niklaus
bbc0424563 Set number of threads in TBB 2014-05-21 21:49:22 +02:00
Patrick Niklaus
f487845e9d Port Contractor to TBB 2014-05-21 21:49:22 +02:00
Patrick Niklaus
77641a9fce Port StaticRTree to use TBB 2014-05-21 21:49:22 +02:00
Patrick Niklaus
56d93eb18b Replace omp atomic with std variant 2014-05-21 21:49:22 +02:00
Patrick Niklaus
da1fd96d4e Port extractor to TBB 2014-05-21 21:49:22 +02:00
2625 changed files with 591359 additions and 33542 deletions

7
.babelrc Normal file
View File

@ -0,0 +1,7 @@
{
"plugins": ["transform-class-properties"],
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}

View File

@ -2,53 +2,89 @@
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AlwaysBreakTemplateDeclarations: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: true
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerBinding: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<'
Priority: 3
- Regex: '^"(osrm|util|engine|extract|contract)/'
Priority: 2
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
MaxEmptyLinesToKeep: 1
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: false
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
IndentWidth: 4
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Allman
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
...

101
.clang-tidy Normal file
View File

@ -0,0 +1,101 @@
---
Checks: >
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-easily-swappable-parameters,
-bugprone-branch-clone,
-bugprone-misplaced-widening-cast,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-integer-division,
-bugprone-reserved-identifier,
-bugprone-unhandled-self-assignment,
-bugprone-forward-declaration-namespace,
-bugprone-sizeof-expression,
-bugprone-throw-keyword-missing,
-bugprone-chained-comparison,
-bugprone-incorrect-enable-if,
-bugprone-switch-missing-default-case,
-bugprone-empty-catch,
-bugprone-unchecked-optional-access,
-clang-analyzer-*,
-clang-diagnostic-deprecated-declarations,
-clang-diagnostic-constant-conversion,
cppcoreguidelines-avoid-goto,
cppcoreguidelines-no-malloc,
cppcoreguidelines-virtual-class-destructor,
google-*,
-google-build-explicit-make-pair,
-google-build-using-namespace,
-google-explicit-constructor,
-google-default-arguments,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-readability-namespace-comments,
-google-readability-function,
-google-readability-todo,
-google-runtime-int,
-google-build-namespaces,
-google-runtime-references,
-google-readability-function-size,
llvm-*,
-llvm-namespace-comment,
-llvm-qualified-auto,
-llvm-include-order,
-llvm-else-after-return,
-llvm-header-guard,
-llvm-twine-local,
misc-*,
-misc-argument-comment,
-misc-const-correctness,
-misc-non-private-member-variables-in-classes,
-misc-unconventional-assign-operator,
-misc-no-recursion,
-misc-misplaced-const,
-misc-definitions-in-headers,
-misc-unused-parameters,
-misc-include-cleaner,
modernize-concat-nested-namespaces,
modernize-use-using,
performance-*,
-performance-no-int-to-ptr,
-performance-enum-size,
-performance-avoid-endl,
readability-*,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-container-size-empty,
-readability-convert-member-functions-to-static,
-readability-const-return-type,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-naming,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-else-after-return,
-readability-inconsistent-declaration-parameter-name,
-readability-isolate-declaration,
-readability-identifier-length,
-readability-redundant-declaration,
-readability-uppercase-literal-suffix,
-readability-named-parameter,
-readability-qualified-auto,
-readability-suspicious-call-argument,
-readability-redundant-access-specifiers,
-readability-redundant-member-init,
-readability-static-definition-in-anonymous-namespace,
-readability-use-anyofallof,
-readability-simplify-boolean-expr,
-readability-make-member-function-const,
-readability-redundant-string-init,
-readability-non-const-parameter,
-readability-redundant-inline-specifier,
-readability-avoid-nested-conditional-operator,
-readability-avoid-return-with-void-value,
-readability-redundant-casting,
-readability-static-accessed-through-instance
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'

14
.cncc.style Normal file
View File

@ -0,0 +1,14 @@
# Kind-specific patterns to check AST nodes against. Both python-clang and
# libclang docs explain CursorKind, with differences in detail. See also:
# - https://github.com/llvm-mirror/clang/blob/aca4fe314a55cacae29e1548cb7bfd2119c6df4c/bindings/python/clang/cindex.py#L599
# - http://clang.llvm.org/doxygen/group__CINDEX.html#gaaccc432245b4cd9f2d470913f9ef0013
# - https://docs.python.org/2/library/re.html#regular-expression-syntax
class_decl: '^([A-Z]+[a-z]+)+$'
struct_decl: '^([A-Z]+[a-z]+)+$'
field_decl: '^[a-z_]+$'
var_decl: '^[a-z]+[a-z0-9_]*$'
parm_decl: '^[a-z]*[a-z0-9_]*$'
namespace: '^[a-z_]*$'
cxx_method: '^([A-Z]+[a-z]+)+$'
function_decl: '^[a-z]+([A-Z]+[a-z]+)*$'

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
test
build

30
.editorconfig Normal file
View File

@ -0,0 +1,30 @@
# EditorConfig is awesome: http://EditorConfig.org
#
# NOTE: Keep settings in sync with the master .clang-format file
#
# top-most EditorConfig file
root = true
# CMake configuration files
[{CMakeLists.txt,CMakeSettings.json,*.cmake}]
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
# CI configuration files
[{.travis.yml,appveyor.yml}]
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
# Unix shell scripts
[*.sh]
end_of_line = lf
indent_style = space
trim_trailing_whitespace = true
# Windows shell scripts
[*.bat]
end_of_line = crlf
indent_style = space
trim_trailing_whitespace = true

2
.eslintignore Normal file
View File

@ -0,0 +1,2 @@
features/support/flatbuffers.js
features/support/fbresult_generated.js

28
.eslintrc Normal file
View File

@ -0,0 +1,28 @@
{
"rules": {
"indent": [
2,
4
],
"quotes": [
1,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
],
"no-console": [
1
]
},
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended"
}

18
.gitattributes vendored Normal file
View File

@ -0,0 +1,18 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.cpp text
*.hpp text
# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf
# https://eslint.org/docs/latest/rules/linebreak-style#using-this-rule-with-version-control-systems
*.js text eol=lf

View File

@ -0,0 +1,65 @@
name: Build and Publish Docker Image
on:
release:
types: [published, prereleased]
env:
IMAGE_NAME: openharbor/osrm-backend
jobs:
publish:
strategy:
matrix:
docker-base-image: ["debian", "alpine"]
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
- name: Docker meta - debug
id: metadebug
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=true
suffix=-debug,onlatest=true
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Build and push debug image
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
tags: ${{ steps.metadebug.outputs.tags }}
build-args: |
DOCKER_TAG=${{ join(steps.metadebug.outputs.tags) }}-${{ matrix.docker-base-image }}
- name: Build and push normal image
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
DOCKER_TAG=${{ join(steps.meta.outputs.tags) }}-${{ matrix.docker-base-image }}

30
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,30 @@
---
name: Bug Report
about: Report issue with osrm-backend
labels: Bug Report
---
# Issue
Please describe the issue you are seeing with OSRM.
Images are a good way to illustrate your problem.
**Note**: If your issue relates to the demo site (https://map.project-osrm.org) or routing provided on openstreetmap.org, be aware that they use separate [profile settings](https://github.com/fossgis-routing-server/cbf-routing-profiles) from those provided by default in `osrm-backend`.
If your issue relates to the demo site or openstreetmap.org behaviour, please check these profiles first to see if they explain the behaviour before creating an issue here.
# Steps to reproduce
Please provide the steps required to reproduce your problem.
- `osrm-backend` version being used
- OSM extract that was processed
- Processing commands (e.g. CH vs MLD processing)
- Server queries
If you're reporting an issue with https://map.project-osrm.org, please provide a link to the problematic request.
# Specifications
Please provide details of your development environment.
- Library/dependency versions
- Operating system
- Hardware

10
.github/ISSUE_TEMPLATE/feature.md vendored Normal file
View File

@ -0,0 +1,10 @@
---
name: Feature Request
about: Request a new feature in osrm-backend
labels: Feature Request
---
# Feature
Please describe the feature you would like to see in OSRM.
Images are often a good way to illustrate your requested feature.

19
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,19 @@
# Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Please read our [documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/releasing.md) on release and version management.
If your PR is still work in progress please attach the relevant label.
## Tasklist
- [ ] CHANGELOG.md entry ([How to write a changelog entry](http://keepachangelog.com/en/1.0.0/#how))
- [ ] update relevant [Wiki pages](https://github.com/Project-OSRM/osrm-backend/wiki)
- [ ] add tests (see [testing documentation](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/testing.md))
- [ ] review
- [ ] adjust for comments
- [ ] cherry pick to release branch
## Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?

View File

@ -0,0 +1,84 @@
name: build and publish container image
on:
push:
tags:
- 'v*'
jobs:
publish:
strategy:
matrix:
docker-base-image: ["debian", "alpine"]
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- name: Docker meta - debug
id: metadebug
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=true
suffix=-debug,onlatest=true
- name: Docker meta - assertions
id: metaassertions
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=true
suffix=-assertions,onlatest=true
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container image - debug
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
tags: ${{ steps.metadebug.outputs.tags }}
build-args: |
DOCKER_TAG=${{ join(steps.metadebug.outputs.tags ) }}-${{ matrix.docker-base-image }}
- name: Build container image - assertions
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
tags: ${{ steps.metaassertions.outputs.tags }}
build-args: |
DOCKER_TAG=${{ join(steps.metaassertions.outputs.tags ) }}-${{ matrix.docker-base-image }}
# build and publish "normal" image as last to get it listed on top
- name: Build container image - normal
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile-${{ matrix.docker-base-image }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
DOCKER_TAG=${{ join(steps.meta.outputs.tags ) }}-${{ matrix.docker-base-image }}

786
.github/workflows/osrm-backend.yml vendored Normal file
View File

@ -0,0 +1,786 @@
name: osrm-backend CI
on:
push:
branches:
- master
tags:
- v[1-9]+.[0-9]+.[0-9]+
- v[1-9]+.[0-9]+.[0-9]+-[a-zA-Z]+.[0-9]+
- v[1-9]+.[0-9]+-[0-9a-zA-Z]+
pull_request:
branches:
- master
env:
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
CMAKE_VERSION: 3.21.2
ENABLE_NODE_BINDINGS: "ON"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
windows-release-node:
needs: format-taginfo-docs
runs-on: windows-2022
continue-on-error: false
env:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
- run: pip install "conan<2.0.0"
- run: conan --version
- run: cmake --version
- uses: actions/setup-node@v4
with:
node-version: 18
- run: node --version
- run: npm --version
- name: Prepare environment
shell: bash
run: |
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
- run: npm install --ignore-scripts
- run: npm link --ignore-scripts
- name: Build
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON ..
cmake --build . --config Release
# TODO: MSVC goes out of memory when building our tests
# - name: Run tests
# shell: bash
# run: |
# cd build
# cmake --build . --config Release --target tests
# # TODO: run tests
# - name: Run node tests
# shell: bash
# run: |
# ./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf
# mkdir -p test/data/ch
# cp test/data/monaco.osrm* test/data/ch/
# ./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm
# ./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm
# node test/nodejs/index.js
- name: Build Node package
shell: bash
run: ./scripts/ci/node_package.sh
- name: Publish Node package
if: ${{ env.PUBLISH == 'On' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: build/stage/**/*.tar.gz
omitBody: true
omitBodyDuringUpdate: true
omitName: true
omitNameDuringUpdate: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
format-taginfo-docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Enable Node.js cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Prepare environment
run: |
npm ci --ignore-scripts
clang-format-15 --version
- name: Run checks
run: |
./scripts/check_taginfo.py taginfo.json profiles/car.lua
./scripts/format.sh && ./scripts/error_on_dirty.sh
node ./scripts/validate_changelog.js
npm run docs && ./scripts/error_on_dirty.sh
npm audit --production
docker-image-matrix:
strategy:
matrix:
docker-base-image: ["debian", "alpine"]
needs: format-taginfo-docs
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Enable osm.pbf cache
uses: actions/cache@v4
with:
path: berlin-latest.osm.pbf
key: v1-berlin-osm-pbf
restore-keys: |
v1-berlin-osm-pbf
- name: Docker build
run: |
docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} .
- name: Test Docker image
run: |
if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
fi
TAG=osrm-backend-local
# when `--memory-swap` value equals `--memory` it means container won't use swap
# see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details
MEMORY_ARGS="--memory=1g --memory-swap=1g"
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson
if [ ! -s "${PWD}/berlin-latest.geojson" ]
then
>&2 echo "No berlin-latest.geojson found"
exit 1
fi
# removing `.osrm.nbg` to check that whole pipeline works without it
rm -rf "${PWD}/berlin-latest.osrm.nbg"
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm
docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm &
curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
docker stop osrm-container
build-test-publish:
needs: format-taginfo-docs
strategy:
matrix:
include:
- name: gcc-13-debug-cov
continue-on-error: false
node: 20
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Debug
CCOMPILER: gcc-13
CUCUMBER_TIMEOUT: 20000
CXXCOMPILER: g++-13
ENABLE_COVERAGE: ON
- name: clang-18-debug-asan-ubsan
continue-on-error: false
node: 20
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Debug
CCOMPILER: clang-18
CUCUMBER_TIMEOUT: 20000
CXXCOMPILER: clang++-18
ENABLE_SANITIZER: ON
TARGET_ARCH: x86_64-asan-ubsan
OSRM_CONNECTION_RETRIES: 10
OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5
- name: clang-18-release
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-18
CXXCOMPILER: clang++-18
CUCUMBER_TIMEOUT: 60000
ENABLE_LTO: OFF
- name: clang-18-debug
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Debug
CCOMPILER: clang-18
CXXCOMPILER: clang++-18
CUCUMBER_TIMEOUT: 60000
ENABLE_LTO: OFF
- name: clang-18-debug-clang-tidy
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Debug
CCOMPILER: clang-18
CXXCOMPILER: clang++-18
CUCUMBER_TIMEOUT: 60000
ENABLE_CLANG_TIDY: ON
- name: clang-17-release
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-17
CXXCOMPILER: clang++-17
CUCUMBER_TIMEOUT: 60000
ENABLE_LTO: OFF
- name: clang-16-release
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-16
CXXCOMPILER: clang++-16
CUCUMBER_TIMEOUT: 60000
ENABLE_LTO: OFF
- name: conan-linux-debug-asan-ubsan
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-18
CXXCOMPILER: clang++-18
ENABLE_CONAN: ON
ENABLE_SANITIZER: ON
ENABLE_LTO: OFF
- name: conan-linux-release
continue-on-error: false
node: 18
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: clang-18
CXXCOMPILER: clang++-18
ENABLE_CONAN: ON
ENABLE_LTO: OFF
- name: gcc-14-release
continue-on-error: false
node: 20
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: gcc-14
CXXCOMPILER: g++-14
CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized'
- name: gcc-13-release
continue-on-error: false
node: 20
runs-on: ubuntu-24.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: gcc-13
CXXCOMPILER: g++-13
CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized'
- name: gcc-12-release
continue-on-error: false
node: 20
runs-on: ubuntu-22.04
BUILD_TOOLS: ON
BUILD_TYPE: Release
CCOMPILER: gcc-12
CXXCOMPILER: g++-12
CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized'
- name: conan-linux-release-node
build_node_package: true
continue-on-error: false
node: 20
runs-on: ubuntu-24.04
BUILD_TYPE: Release
CCOMPILER: clang-16
CXXCOMPILER: clang++-16
ENABLE_CONAN: ON
NODE_PACKAGE_TESTS_ONLY: ON
- name: conan-linux-debug-node
build_node_package: true
continue-on-error: false
node: 20
runs-on: ubuntu-24.04
BUILD_TYPE: Debug
CCOMPILER: clang-16
CXXCOMPILER: clang++-16
ENABLE_CONAN: ON
NODE_PACKAGE_TESTS_ONLY: ON
- name: conan-macos-x64-release-node
build_node_package: true
continue-on-error: true
node: 20
runs-on: macos-13 # x86_64
BUILD_TYPE: Release
CCOMPILER: clang
CXXCOMPILER: clang++
CUCUMBER_TIMEOUT: 60000
ENABLE_ASSERTIONS: ON
ENABLE_CONAN: ON
- name: conan-macos-arm64-release-node
build_node_package: true
continue-on-error: true
node: 20
runs-on: macos-14 # arm64
BUILD_TYPE: Release
CCOMPILER: clang
CXXCOMPILER: clang++
CUCUMBER_TIMEOUT: 60000
ENABLE_ASSERTIONS: ON
ENABLE_CONAN: ON
name: ${{ matrix.name}}
continue-on-error: ${{ matrix.continue-on-error }}
runs-on: ${{ matrix.runs-on }}
env:
BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }}
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }}
CCOMPILER: ${{ matrix.CCOMPILER }}
CFLAGS: ${{ matrix.CFLAGS }}
CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }}
CXXCOMPILER: ${{ matrix.CXXCOMPILER }}
CXXFLAGS: ${{ matrix.CXXFLAGS }}
ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }}
ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }}
ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }}
ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }}
ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }}
NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }}
TARGET_ARCH: ${{ matrix.TARGET_ARCH }}
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
ENABLE_LTO: ${{ matrix.ENABLE_LTO }}
steps:
- uses: actions/checkout@v4
- name: Build machine architecture
run: uname -m
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Enable Node.js cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Enable compiler cache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-${{ matrix.name }}-${{ github.sha }}
restore-keys: |
ccache-${{ matrix.name }}-
- name: Enable Conan cache
uses: actions/cache@v4
with:
path: ~/.conan
key: v9-conan-${{ matrix.name }}-${{ github.sha }}
restore-keys: |
v9-conan-${{ matrix.name }}-
- name: Enable test cache
uses: actions/cache@v4
with:
path: ${{github.workspace}}/test/cache
key: v4-test-${{ matrix.name }}-${{ github.sha }}
restore-keys: |
v4-test-${{ matrix.name }}-
- name: Prepare environment
run: |
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
mkdir -p $HOME/.ccache
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV
echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV
if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then
# We can only set this after checkout once we know the workspace directory
echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV
echo "UBSAN_OPTIONS=symbolize=1:halt_on_error=1:print_stacktrace=1:suppressions=${GITHUB_WORKSPACE}/scripts/ci/undefinedsanitizer.conf" >> $GITHUB_ENV
echo "ASAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/addresssanitizer.conf" >> $GITHUB_ENV
fi
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV
fi
# See: https://github.com/actions/toolkit/issues/946#issuecomment-1590016041
# We need it to be able to access system folders while restoring cached Boost below
- name: Give tar root ownership
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar
- name: Cache Boost
if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
id: cache-boost
uses: actions/cache@v4
with:
path: |
/usr/local/include/boost
/usr/local/lib/libboost*
key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }}
restore-keys: |
v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }}
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON'
run: |
BOOST_VERSION="1.85.0"
BOOST_VERSION_FLAVOR="${BOOST_VERSION}-b2-nodocs"
wget -q https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION_FLAVOR}.tar.gz
tar xzf boost-${BOOST_VERSION_FLAVOR}.tar.gz
cd boost-${BOOST_VERSION}
sudo ./bootstrap.sh
sudo ./b2 install
cd ..
sudo rm -rf boost-${BOOST_VERSION}*
- name: Install dev dependencies
run: |
python3 -m pip install "conan<2.0.0" || python3 -m pip install "conan<2.0.0" --break-system-packages
# workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499
# and that's why CI cannot find conan executable installed above
if [[ "${RUNNER_OS}" == "macOS" ]]; then
echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH
fi
# ccache
if [[ "${RUNNER_OS}" == "Linux" ]]; then
sudo apt-get update -y && sudo apt-get install ccache
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
brew install ccache
fi
# Linux dev packages
if [ "${ENABLE_CONAN}" != "ON" ]; then
sudo apt-get update -y
sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev
if [[ "${CCOMPILER}" != clang-* ]]; then
sudo apt-get install -y ${CXXCOMPILER}
fi
if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then
sudo apt-get install -y lcov
fi
fi
# TBB
TBB_VERSION=2021.12.0
if [[ "${RUNNER_OS}" == "Linux" ]]; then
TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-lin.tgz"
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-mac.tgz"
fi
wget --tries 5 ${TBB_URL} -O onetbb.tgz
tar zxvf onetbb.tgz
sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/
sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/
- name: Add Clang 18 to list of Conan compilers # workaround for the issue that Conan 1.x doesn't know about Clang 18
if: ${{ matrix.ENABLE_CONAN == 'ON' && matrix.CCOMPILER == 'clang-18' }}
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
conan config init
yq eval '.compiler.clang.version += ["18"]' -i "$HOME/.conan/settings.yml"
- name: Add Apple-clang 16 to list of Conan compilers # workaround for the issue that Conan 1.x doesn't know about Apple-clang 16
if: ${{ matrix.ENABLE_CONAN == 'ON' && matrix.runs-on == 'macos-14' }}
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_darwin_arm64 -O /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq
conan config init
yq eval '.compiler.apple-clang.version += ["16.0"]' -i "$HOME/.conan/settings.yml"
- name: Prepare build
run: |
mkdir ${OSRM_BUILD_DIR}
ccache --max-size=256M
npm ci --ignore-scripts
if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then
lcov --directory . --zerocounters # clean cached files
fi
echo "CC=${CCOMPILER}" >> $GITHUB_ENV
echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV
if [[ "${RUNNER_OS}" == "macOS" ]]; then
# missing from GCC path, needed for conan builds of libiconv, for example.
sudo xcode-select --switch /Library/Developer/CommandLineTools
echo "LIBRARY_PATH=${LIBRARY_PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV
echo "CPATH=${CPATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV
fi
- name: Build and install OSRM
run: |
echo "Using ${JOBS} jobs"
pushd ${OSRM_BUILD_DIR}
ccache --zero-stats
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \
-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-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=${BUILD_TOOLS:-OFF} \
-DENABLE_CCACHE=ON \
-DENABLE_LTO=${ENABLE_LTO:-ON} \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
make --jobs=${JOBS}
if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then
make tests --jobs=${JOBS}
make benchmarks --jobs=${JOBS}
sudo make install
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV
fi
echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV
fi
popd
- name: Build example
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
run: |
mkdir example/build && pushd example/build
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make --jobs=${JOBS}
popd
- name: Run all tests
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
run: |
make -C test/data benchmark
# macOS SIP strips the linker path. Reset this inside the running shell
export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }}
./example/build/osrm-example test/data/mld/monaco.osrm
# All tests assume to be run from the build directory
pushd ${OSRM_BUILD_DIR}
for i in ./unit_tests/*-tests ; do echo Running $i ; $i ; done
if [ -z "${ENABLE_SANITIZER}" ]; then
npm run nodejs-tests
fi
popd
npm test
- name: Use Node 18
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
uses: actions/setup-node@v4
with:
node-version: 18
- name: Run Node package tests on Node 18
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
run: |
node --version
npm run nodejs-tests
- name: Use Node 20
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run Node package tests on Node 20
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
run: |
node --version
npm run nodejs-tests
- name: Use Node latest
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
uses: actions/setup-node@v4
with:
node-version: latest
- name: Run Node package tests on Node-latest
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
run: |
node --version
npm run nodejs-tests
- name: Upload test logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
path: test/logs/
# - name: Generate code coverage
# if: ${{ matrix.ENABLE_COVERAGE == 'ON' }}
# run: |
# lcov --directory . --capture --output-file coverage.info # capture coverage info
# lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
# lcov --list coverage.info #debug info
# # Uploading report to CodeCov
# - name: Upload code coverage
# if: ${{ matrix.ENABLE_COVERAGE == 'ON' }}
# uses: codecov/codecov-action@v4
# with:
# files: coverage.info
# name: codecov-osrm-backend
# fail_ci_if_error: true
# verbose: true
- name: Build Node package
if: ${{ matrix.build_node_package }}
run: ./scripts/ci/node_package.sh
- name: Publish Node package
if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: build/stage/**/*.tar.gz
omitBody: true
omitBodyDuringUpdate: true
omitName: true
omitNameDuringUpdate: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Show CCache statistics
run: |
ccache -p
ccache -s
benchmarks:
if: github.event_name == 'pull_request'
needs: [format-taginfo-docs]
runs-on: self-hosted
env:
CCOMPILER: clang-16
CXXCOMPILER: clang++-16
CC: clang-16
CXX: clang++-16
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }}
steps:
- name: Checkout PR Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
path: pr
- name: Activate virtualenv
run: |
python3 -m venv .venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4"
- name: Prepare data
run: |
if [ "$RUN_BIG_BENCHMARK" = "true" ]; then
rm -rf ~/data.osm.pbf
wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet
gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv
else
if [ ! -f "~/data.osm.pbf" ]; then
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf
else
echo "Using cached data.osm.pbf"
fi
gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv
fi
- name: Prepare environment
run: |
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
mkdir -p $HOME/.ccache
ccache --zero-stats
ccache --max-size=256M
- name: Checkout Base Branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
path: base
- name: Build Base Branch
run: |
cd base
npm ci --ignore-scripts
cd ..
mkdir base/build
cd base/build
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON ..
make -j$(nproc)
make -j$(nproc) benchmarks
cd ..
make -C test/data
- name: Build PR Branch
run: |
cd pr
npm ci --ignore-scripts
cd ..
mkdir -p pr/build
cd pr/build
cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON ..
make -j$(nproc)
make -j$(nproc) benchmarks
cd ..
make -C test/data
# we run benchmarks in tmpfs to avoid impact of disk IO
- name: Create folder for tmpfs
run: |
# if by any chance it was mounted before(e.g. due to previous job failed), unmount it
sudo umount ~/benchmarks | true
rm -rf ~/benchmarks
mkdir -p ~/benchmarks
# see https://llvm.org/docs/Benchmarking.html
- name: Run PR Benchmarks
run: |
sudo cset shield -c 2-3 -k on
sudo mount -t tmpfs -o size=4g none ~/benchmarks
cp -rf pr/build ~/benchmarks/build
cp -rf pr/lib ~/benchmarks/lib
mkdir -p ~/benchmarks/test
cp -rf pr/test/data ~/benchmarks/test/data
cp -rf pr/profiles ~/benchmarks/profiles
sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
sudo umount ~/benchmarks
sudo cset shield --reset
- name: Run Base Benchmarks
run: |
sudo cset shield -c 2-3 -k on
sudo mount -t tmpfs -o size=4g none ~/benchmarks
cp -rf base/build ~/benchmarks/build
cp -rf base/lib ~/benchmarks/lib
mkdir -p ~/benchmarks/test
cp -rf base/test/data ~/benchmarks/test/data
cp -rf base/profiles ~/benchmarks/profiles
# TODO: remove it when base branch will have this file at needed location
if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then
cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json
fi
# we intentionally use scripts from PR branch to be able to update them and see results in the same PR
sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
sudo umount ~/benchmarks
sudo cset shield --reset
- name: Post Benchmark Results
run: |
python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results
- name: Show CCache statistics
run: |
ccache -p
ccache -s
ci-complete:
runs-on: ubuntu-22.04
needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks]
steps:
- run: echo "CI complete"

29
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: 'Close stale issues'
on:
# NOTE: uncomment if you want to test changes to this file in PRs CI
# pull_request:
# branches:
# - master
schedule:
- cron: '30 1 * * *' # every day at 1:30am
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v9
with:
operations-per-run: 3000
stale-issue-message: 'This issue seems to be stale. It will be closed in 30 days if no further activity occurs.'
stale-pr-message: 'This PR seems to be stale. Is it still relevant?'
days-before-issue-stale: 180 # 6 months
days-before-issue-close: 30 # 1 month
days-before-pr-stale: 180 # 6 months
days-before-pr-close: -1 # never close PRs
exempt-issue-labels: 'Do Not Stale,Feature Request,Performance,Bug Report,CI,Starter Task,Refactor,Guidance'

63
.gitignore vendored
View File

@ -1,3 +1,9 @@
# pre compiled dependencies #
#############################
osrm-deps
.ycm_extra_conf.py
# Compiled source #
###################
*.com
@ -35,9 +41,13 @@ Thumbs.db
# build related files #
#######################
/_build*
/build/
/Util/UUID.cpp
/Util/GitDescription.cpp
/example/build/
/test/data/monaco.osrm*
/test/data/ch
/test/data/mld
/cmake/postinst
# Eclipse related files #
#########################
@ -46,31 +56,19 @@ Thumbs.db
.cproject
.project
# stxxl related files #
#######################
.stxxl
stxxl.log
stxxl.errlog
# Visual Studio (Code) related files #
######################################
/.vs*
/*.local.bat
/CMakeSettings.json
/.cache
# compiled protobuffers #
#########################
/DataStructures/pbf-proto/*.pb.h
/DataStructures/pbf-proto/*.pb.cc
# Jetbrains related files #
###########################
.idea/
# External Libs #
#################
/lib/
/win/lib
# Visual Studio Temp + build Files #
# Compiled Binary Files #
####################################
/win/*.user
/win/*.ncb
/win/*.suo
/win/Debug/
/win/Release/
/win/bin/
/win/bin-debug/
/osrm-extract
/osrm-io-benchmark
/osrm-components
@ -79,14 +77,31 @@ stxxl.errlog
/osrm-prepare
/osrm-unlock-all
/osrm-cli
/osrm-check-hsgr
/osrm-springclean
/nohup.out
# Sandbox folder #
###################
/sandbox/
# Test related files #
######################
/test/profile.lua
/test/cache
/test/speeds.csv
/test/penalties.csv
node_modules
# Deprecated config file #
##########################
/server.ini
*.swp
# local lua debugging file
debug.lua
# node-osrm artifacts
lib/binding

16
.npmignore Normal file
View File

@ -0,0 +1,16 @@
*
!README.md
!CHANGELOG.md
!CONTRIBUTING.MD
!LICENCE.TXT
!package.json
!package-lock.json
!yarn.lock
!docs
!example
!taginfo.json
!lib/*.js
!profiles/*
!profiles/lib/*
!profiles/examples/*
!scripts/node_install.sh

View File

@ -1,54 +0,0 @@
language: cpp
compiler:
- gcc
# - clang
# Make sure CMake is installed
install:
- sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:boost-latest/ppa
- sudo apt-get update >/dev/null
- sudo apt-get -q install libprotoc-dev libprotobuf7 libprotobuf-dev libosmpbf-dev libbz2-dev libstxxl-dev libstxxl1 libxml2-dev libzip-dev lua5.1 liblua5.1-0-dev rubygems
- sudo apt-get -q install g++-4.7
- sudo apt-get install libboost1.54-all-dev
#luabind
- curl https://gist.githubusercontent.com/DennisOSRM/f2eb7b948e6fe1ae319e/raw/install-luabind.sh | sudo bash
#osmosis
- curl -s https://gist.githubusercontent.com/DennisOSRM/803a64a9178ec375069f/raw/ | sudo bash
before_script:
- rvm use 1.9.3
- gem install bundler
- bundle install
- mkdir build
- cd build
- cmake .. $CMAKEOPTIONS
script:
- make -j 2
- cd ..
- cucumber -p verify
after_script:
# - cd ..
# - cucumber -p verify
branches:
only:
- master
- develop
cache:
- bundler
- apt
env:
- CMAKEOPTIONS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-4.7" OSRM_PORT=5000 OSRM_TIMEOUT=60
- CMAKEOPTIONS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++-4.7" OSRM_PORT=5010 OSRM_TIMEOUT=60
notifications:
irc:
channels:
- irc.oftc.net#osrm
on_success: change
on_failure: always
use_notice: true
skip_join: false
recipients:
- dennis@mapbox.com
email:
on_success: change
on_failure: always

View File

@ -1,140 +0,0 @@
#ifndef __BFS_COMPONENT_EXPLORER_H__
#define __BFS_COMPONENT_EXPLORER_H__
#include "../typedefs.h"
#include "../DataStructures/DynamicGraph.h"
#include "../DataStructures/RestrictionMap.h"
#include <queue>
#include <unordered_set>
// Explores the components of the given graph while respecting turn restrictions
// and barriers.
template <typename GraphT> class BFSComponentExplorer
{
public:
BFSComponentExplorer(const GraphT &dynamicGraph,
const RestrictionMap &restrictions,
const std::unordered_set<NodeID> &barrier_nodes)
: m_graph(dynamicGraph), m_restriction_map(restrictions), m_barrier_nodes(barrier_nodes)
{
BOOST_ASSERT(m_graph.GetNumberOfNodes() > 0);
}
/*!
* Returns the size of the component that the node belongs to.
*/
inline unsigned int GetComponentSize(NodeID node)
{
BOOST_ASSERT(node < m_component_index_list.size());
return m_component_index_size[m_component_index_list[node]];
}
inline unsigned int GetNumberOfComponents() { return m_component_index_size.size(); }
/*!
* Computes the component sizes.
*/
void run()
{
std::queue<std::pair<NodeID, NodeID>> bfs_queue;
unsigned current_component = 0;
BOOST_ASSERT(m_component_index_list.empty());
BOOST_ASSERT(m_component_index_size.empty());
unsigned num_nodes = m_graph.GetNumberOfNodes();
m_component_index_list.resize(num_nodes, std::numeric_limits<unsigned>::max());
BOOST_ASSERT(num_nodes > 0);
// put unexplorered node with parent pointer into queue
for (NodeID node = 0; node < num_nodes; ++node)
{
if (std::numeric_limits<unsigned>::max() == m_component_index_list[node])
{
unsigned size = ExploreComponent(bfs_queue, node, current_component);
// push size into vector
m_component_index_size.emplace_back(size);
++current_component;
}
}
}
private:
/*!
* Explores the current component that starts at node using BFS.
*/
inline unsigned ExploreComponent(std::queue<std::pair<NodeID, NodeID>> &bfs_queue,
NodeID node,
unsigned current_component)
{
bfs_queue.emplace(node, node);
// mark node as read
m_component_index_list[node] = current_component;
unsigned current_component_size = 1;
while (!bfs_queue.empty())
{
// fetch element from BFS queue
std::pair<NodeID, NodeID> current_queue_item = bfs_queue.front();
bfs_queue.pop();
const NodeID v = current_queue_item.first; // current node
const NodeID u = current_queue_item.second; // parent
// increment size counter of current component
++current_component_size;
const bool is_barrier_node = (m_barrier_nodes.find(v) != m_barrier_nodes.end());
if (!is_barrier_node)
{
const NodeID to_node_of_only_restriction =
m_restriction_map.CheckForEmanatingIsOnlyTurn(u, v);
for (auto e2 : m_graph.GetAdjacentEdgeRange(v))
{
const NodeID w = m_graph.GetTarget(e2);
if (to_node_of_only_restriction != std::numeric_limits<unsigned>::max() &&
w != to_node_of_only_restriction)
{
// At an only_-restriction but not at the right turn
continue;
}
if (u != w)
{
// only add an edge if turn is not a U-turn except
// when it is at the end of a dead-end street.
if (!m_restriction_map.CheckIfTurnIsRestricted(u, v, w))
{
// only add an edge if turn is not prohibited
if (std::numeric_limits<unsigned>::max() == m_component_index_list[w])
{
// insert next (node, parent) only if w has
// not yet been explored
// mark node as read
m_component_index_list[w] = current_component;
bfs_queue.emplace(w, v);
}
}
}
}
}
}
return current_component_size;
}
std::vector<unsigned> m_component_index_list;
std::vector<NodeID> m_component_index_size;
const GraphT &m_graph;
const RestrictionMap &m_restriction_map;
const std::unordered_set<NodeID> &m_barrier_nodes;
};
#endif

View File

@ -1,140 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <osrm/Coordinate.h>
#include "DouglasPeucker.h"
#include "../DataStructures/SegmentInformation.h"
#include "../Util/SimpleLogger.h"
#include <boost/assert.hpp>
#include <cmath>
#include <limits>
DouglasPeucker::DouglasPeucker()
: douglas_peucker_thresholds({262144., // z0
131072., // z1
65536., // z2
32768., // z3
16384., // z4
8192., // z5
4096., // z6
2048., // z7
960., // z8
480., // z9
240., // z10
90., // z11
50., // z12
25., // z13
15., // z14
5., // z15
.65, // z16
.5, // z17
.35 // z18
})
{
}
void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level)
{
input_geometry.front().necessary = true;
input_geometry.back().necessary = true;
BOOST_ASSERT_MSG(!input_geometry.empty(), "geometry invalid");
if (input_geometry.size() < 2)
{
return;
}
SimpleLogger().Write() << "input_geometry.size()=" << input_geometry.size();
{
BOOST_ASSERT_MSG(zoom_level < 19, "unsupported zoom level");
unsigned left_border = 0;
unsigned right_border = 1;
// Sweep over array and identify those ranges that need to be checked
do
{
if (!input_geometry[left_border].necessary)
{
SimpleLogger().Write() << "broken interval [" << left_border << "," << right_border << "]";
}
BOOST_ASSERT_MSG(input_geometry[left_border].necessary,
"left border must be necessary");
BOOST_ASSERT_MSG(input_geometry.back().necessary, "right border must be necessary");
if (input_geometry[right_border].necessary)
{
recursion_stack.emplace(left_border, right_border);
left_border = right_border;
}
++right_border;
} while (right_border < input_geometry.size());
}
while (!recursion_stack.empty())
{
// pop next element
const GeometryRange pair = recursion_stack.top();
recursion_stack.pop();
BOOST_ASSERT_MSG(input_geometry[pair.first].necessary, "left border mus be necessary");
BOOST_ASSERT_MSG(input_geometry[pair.second].necessary, "right border must be necessary");
BOOST_ASSERT_MSG(pair.second < input_geometry.size(), "right border outside of geometry");
BOOST_ASSERT_MSG(pair.first < pair.second, "left border on the wrong side");
double max_distance = std::numeric_limits<double>::min();
unsigned farthest_element_index = pair.second;
// find index idx of element with max_distance
for (unsigned i = pair.first + 1; i < pair.second; ++i)
{
const double temp_dist = FixedPointCoordinate::ComputePerpendicularDistance(
input_geometry[i].location,
input_geometry[pair.first].location,
input_geometry[pair.second].location);
const double distance = std::abs(temp_dist);
if (distance > douglas_peucker_thresholds[zoom_level] && distance > max_distance)
{
farthest_element_index = i;
max_distance = distance;
}
}
if (max_distance > douglas_peucker_thresholds[zoom_level])
{
// mark idx as necessary
input_geometry[farthest_element_index].necessary = true;
if (1 < (farthest_element_index - pair.first))
{
recursion_stack.emplace(pair.first, farthest_element_index);
}
if (1 < (pair.second - farthest_element_index))
{
recursion_stack.emplace(farthest_element_index, pair.second);
}
}
}
}

View File

@ -1,62 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DOUGLASPEUCKER_H_
#define DOUGLASPEUCKER_H_
#include <stack>
#include <vector>
/* This class object computes the bitvector of indicating generalized input
* points according to the (Ramer-)Douglas-Peucker algorithm.
*
* Input is vector of pairs. Each pair consists of the point information and a
* bit indicating if the points is present in the generalization.
* Note: points may also be pre-selected*/
struct FixedPointCoordinate;
struct SegmentInformation;
class DouglasPeucker
{
private:
std::vector<double> douglas_peucker_thresholds;
typedef std::pair<unsigned, unsigned> GeometryRange;
// Stack to simulate the recursion
std::stack<GeometryRange> recursion_stack;
double ComputeDistance(const FixedPointCoordinate &point,
const FixedPointCoordinate &segA,
const FixedPointCoordinate &segB) const;
public:
DouglasPeucker();
void Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level);
};
#endif /* DOUGLASPEUCKER_H_ */

View File

@ -1,142 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTRACT_ROUTE_NAMES_H
#define EXTRACT_ROUTE_NAMES_H
#include <boost/assert.hpp>
#include <algorithm>
#include <string>
#include <vector>
struct RouteNames
{
std::string shortest_path_name_1;
std::string shortest_path_name_2;
std::string alternative_path_name_1;
std::string alternative_path_name_2;
};
// construct routes names
template <class DataFacadeT, class SegmentT> struct ExtractRouteNames
{
RouteNames operator()(std::vector<SegmentT> &shortest_path_segments,
std::vector<SegmentT> &alternative_path_segments,
const DataFacadeT *facade)
{
RouteNames route_names;
SegmentT shortest_segment_1, shortest_segment_2;
SegmentT alternative_segment_1, alternative_segment_2;
auto length_comperator = [](SegmentT a, SegmentT b)
{ return a.length > b.length; };
auto name_id_comperator = [](SegmentT a, SegmentT b)
{ return a.name_id < b.name_id; };
if (shortest_path_segments.empty())
{
return route_names;
}
std::sort(shortest_path_segments.begin(), shortest_path_segments.end(), length_comperator);
shortest_segment_1 = shortest_path_segments[0];
if (!alternative_path_segments.empty())
{
std::sort(alternative_path_segments.begin(),
alternative_path_segments.end(),
length_comperator);
alternative_segment_1 = alternative_path_segments[0];
}
std::vector<SegmentT> shortest_path_set_difference(shortest_path_segments.size());
std::vector<SegmentT> alternative_path_set_difference(alternative_path_segments.size());
std::set_difference(shortest_path_segments.begin(),
shortest_path_segments.end(),
alternative_path_segments.begin(),
alternative_path_segments.end(),
shortest_path_set_difference.begin(),
name_id_comperator);
int size_of_difference = shortest_path_set_difference.size();
if (size_of_difference)
{
int i = 0;
while (i < size_of_difference &&
shortest_path_set_difference[i].name_id == shortest_path_segments[0].name_id)
{
++i;
}
if (i < size_of_difference)
{
shortest_segment_2 = shortest_path_set_difference[i];
}
}
std::set_difference(alternative_path_segments.begin(),
alternative_path_segments.end(),
shortest_path_segments.begin(),
shortest_path_segments.end(),
alternative_path_set_difference.begin(),
name_id_comperator);
size_of_difference = alternative_path_set_difference.size();
if (size_of_difference)
{
int i = 0;
while (i < size_of_difference &&
alternative_path_set_difference[i].name_id ==
alternative_path_segments[0].name_id)
{
++i;
}
if (i < size_of_difference)
{
alternative_segment_2 = alternative_path_set_difference[i];
}
}
if (shortest_segment_1.position > shortest_segment_2.position)
{
std::swap(shortest_segment_1, shortest_segment_2);
}
if (alternative_segment_1.position > alternative_segment_2.position)
{
std::swap(alternative_segment_1, alternative_segment_2);
}
route_names.shortest_path_name_1 =
facade->GetEscapedNameForNameID(shortest_segment_1.name_id);
route_names.shortest_path_name_2 =
facade->GetEscapedNameForNameID(shortest_segment_2.name_id);
route_names.alternative_path_name_1 =
facade->GetEscapedNameForNameID(alternative_segment_1.name_id);
route_names.alternative_path_name_2 =
facade->GetEscapedNameForNameID(alternative_segment_2.name_id);
return route_names;
}
};
#endif // EXTRACT_ROUTE_NAMES_H

View File

@ -1,144 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ITERATOR_BASED_CRC32_H
#define ITERATOR_BASED_CRC32_H
#include "../Util/SimpleLogger.h"
#include <iostream>
#if defined(__x86_64__)
#include <cpuid.h>
#else
#include <boost/crc.hpp> // for boost::crc_32_type
inline void __get_cpuid(int param, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
{
*ecx = 0;
}
#endif
template <class ContainerT> class IteratorbasedCRC32
{
private:
typedef typename ContainerT::iterator IteratorType;
unsigned crc;
bool use_SSE42_CRC_function;
#if !defined(__x86_64__)
boost::crc_optimal<32, 0x1EDC6F41, 0x0, 0x0, true, true> CRC32_processor;
#endif
unsigned SoftwareBasedCRC32(char *str, unsigned len)
{
#if !defined(__x86_64__)
CRC32_processor.process_bytes(str, len);
return CRC32_processor.checksum();
#else
return 0;
#endif
}
// adapted from http://byteworm.com/2010/10/13/crc32/
unsigned SSE42BasedCRC32(char *str, unsigned len)
{
#if defined(__x86_64__)
unsigned q = len / sizeof(unsigned);
unsigned r = len % sizeof(unsigned);
unsigned *p = (unsigned *)str;
// crc=0;
while (q--)
{
__asm__ __volatile__(".byte 0xf2, 0xf, 0x38, 0xf1, 0xf1;"
: "=S"(crc)
: "0"(crc), "c"(*p));
++p;
}
str = (char *)p;
while (r--)
{
__asm__ __volatile__(".byte 0xf2, 0xf, 0x38, 0xf1, 0xf1;"
: "=S"(crc)
: "0"(crc), "c"(*str));
++str;
}
#endif
return crc;
}
inline unsigned cpuid() const
{
unsigned eax = 0, ebx = 0, ecx = 0, edx = 0;
// on X64 this calls hardware cpuid(.) instr. otherwise a dummy impl.
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
return ecx;
}
bool DetectNativeCRC32Support()
{
static const int SSE42_BIT = 0x00100000;
const unsigned ecx = cpuid();
const bool has_SSE42 = ecx & SSE42_BIT;
if (has_SSE42)
{
SimpleLogger().Write() << "using hardware based CRC32 computation";
}
else
{
SimpleLogger().Write() << "using software based CRC32 computation";
}
return has_SSE42;
}
public:
IteratorbasedCRC32() : crc(0) { use_SSE42_CRC_function = DetectNativeCRC32Support(); }
unsigned operator()(IteratorType iter, const IteratorType end)
{
unsigned crc = 0;
while (iter != end)
{
char *data = reinterpret_cast<char *>(&(*iter));
if (use_SSE42_CRC_function)
{
crc = SSE42BasedCRC32(data, sizeof(typename ContainerT::value_type));
}
else
{
crc = SoftwareBasedCRC32(data, sizeof(typename ContainerT::value_type));
}
++iter;
}
return crc;
}
};
#endif /* ITERATOR_BASED_CRC32_H */

View File

@ -1,99 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OBJECTTOBASE64_H_
#define OBJECTTOBASE64_H_
#include "../Util/StringUtil.h"
#include <boost/assert.hpp>
#include <boost/archive/iterators/base64_from_binary.hpp>
#include <boost/archive/iterators/binary_from_base64.hpp>
#include <boost/archive/iterators/transform_width.hpp>
#include <algorithm>
#include <string>
#include <vector>
typedef
boost::archive::iterators::base64_from_binary<
boost::archive::iterators::transform_width<const char *, 6, 8>
> base64_t;
typedef
boost::archive::iterators::transform_width<
boost::archive::iterators::binary_from_base64<
std::string::const_iterator>, 8, 6
> binary_t;
template<class ObjectT>
static void EncodeObjectToBase64(const ObjectT & object, std::string& encoded) {
const char * char_ptr_to_object = (const char *)&object;
std::vector<unsigned char> data(sizeof(object));
std::copy(
char_ptr_to_object,
char_ptr_to_object + sizeof(ObjectT),
data.begin()
);
unsigned char number_of_padded_chars = 0; // is in {0,1,2};
while(data.size() % 3 != 0) {
++number_of_padded_chars;
data.push_back(0x00);
}
BOOST_ASSERT_MSG(
0 == data.size() % 3,
"base64 input data size is not a multiple of 3!"
);
encoded.resize(sizeof(ObjectT));
encoded.assign(
base64_t( &data[0] ),
base64_t( &data[0] + (data.size() - number_of_padded_chars) )
);
replaceAll(encoded, "+", "-");
replaceAll(encoded, "/", "_");
}
template<class ObjectT>
static void DecodeObjectFromBase64(const std::string& input, ObjectT & object) {
try {
std::string encoded(input);
//replace "-" with "+" and "_" with "/"
replaceAll(encoded, "-", "+");
replaceAll(encoded, "_", "/");
std::copy (
binary_t( encoded.begin() ),
binary_t( encoded.begin() + encoded.length() - 1),
(char *)&object
);
} catch(...) { }
}
#endif /* OBJECTTOBASE64_H_ */

View File

@ -1,151 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "PolylineCompressor.h"
#include "../Util/StringUtil.h"
//TODO: return vector of start indices for each leg
void PolylineCompressor::encodeVectorSignedNumber(std::vector<int> &numbers, std::string &output)
const
{
const unsigned end = numbers.size();
for (unsigned i = 0; i < end; ++i)
{
numbers[i] <<= 1;
if (numbers[i] < 0)
{
numbers[i] = ~(numbers[i]);
}
}
for (const int number: numbers)
{
encodeNumber(number, output);
}
}
void PolylineCompressor::encodeNumber(int number_to_encode, std::string &output) const
{
while (number_to_encode >= 0x20)
{
int next_value = (0x20 | (number_to_encode & 0x1f)) + 63;
output += static_cast<char>(next_value);
if (92 == next_value)
{
output += static_cast<char>(next_value);
}
number_to_encode >>= 5;
}
number_to_encode += 63;
output += static_cast<char>(number_to_encode);
if (92 == number_to_encode)
{
output += static_cast<char>(number_to_encode);
}
}
JSON::String PolylineCompressor::printEncodedString(const std::vector<SegmentInformation> &polyline) const
{
std::string output;
std::vector<int> delta_numbers;
if (!polyline.empty())
{
FixedPointCoordinate last_coordinate = polyline[0].location;
delta_numbers.emplace_back(last_coordinate.lat);
delta_numbers.emplace_back(last_coordinate.lon);
for (const auto & segment : polyline)
{
if (segment.necessary)
{
int lat_diff = segment.location.lat - last_coordinate.lat;
int lon_diff = segment.location.lon - last_coordinate.lon;
delta_numbers.emplace_back(lat_diff);
delta_numbers.emplace_back(lon_diff);
last_coordinate = segment.location;
}
}
encodeVectorSignedNumber(delta_numbers, output);
}
JSON::String return_value(output);
return return_value;
}
JSON::String PolylineCompressor::printEncodedString(const std::vector<FixedPointCoordinate> &polyline) const
{
std::string output;
std::vector<int> delta_numbers(2 * polyline.size());
if (!polyline.empty())
{
delta_numbers[0] = polyline[0].lat;
delta_numbers[1] = polyline[0].lon;
for (unsigned i = 1; i < polyline.size(); ++i)
{
int lat_diff = polyline[i].lat - polyline[i - 1].lat;
int lon_diff = polyline[i].lon - polyline[i - 1].lon;
delta_numbers[(2 * i)] = (lat_diff);
delta_numbers[(2 * i) + 1] = (lon_diff);
}
encodeVectorSignedNumber(delta_numbers, output);
}
JSON::String return_value(output);
return return_value;
}
JSON::Array PolylineCompressor::printUnencodedString(const std::vector<FixedPointCoordinate> &polyline) const
{
JSON::Array json_geometry_array;
for( const auto & coordinate : polyline)
{
std::string tmp, output;
FixedPointCoordinate::convertInternalLatLonToString(coordinate.lat, tmp);
output += (tmp + ",");
FixedPointCoordinate::convertInternalLatLonToString(coordinate.lon, tmp);
output += tmp;
json_geometry_array.values.push_back(output);
}
return json_geometry_array;
}
JSON::Array PolylineCompressor::printUnencodedString(const std::vector<SegmentInformation> &polyline) const
{
JSON::Array json_geometry_array;
for( const auto & segment : polyline)
{
if (segment.necessary)
{
std::string tmp, output;
FixedPointCoordinate::convertInternalLatLonToString(segment.location.lat, tmp);
output += (tmp + ",");
FixedPointCoordinate::convertInternalLatLonToString(segment.location.lon, tmp);
output += tmp;
json_geometry_array.values.push_back(output);
}
}
return json_geometry_array;
}

View File

@ -1,459 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STRONGLYCONNECTEDCOMPONENTS_H_
#define STRONGLYCONNECTEDCOMPONENTS_H_
#include "../typedefs.h"
#include "../DataStructures/DeallocatingVector.h"
#include "../DataStructures/DynamicGraph.h"
#include "../DataStructures/ImportEdge.h"
#include "../DataStructures/QueryNode.h"
#include "../DataStructures/Percent.h"
#include "../DataStructures/Restriction.h"
#include "../DataStructures/TurnInstructions.h"
#include "../Util/SimpleLogger.h"
#include "../Util/StdHashExtensions.h"
#include <osrm/Coordinate.h>
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#ifdef __APPLE__
#include <gdal.h>
#include <ogrsf_frmts.h>
#else
#include <gdal/gdal.h>
#include <gdal/ogrsf_frmts.h>
#endif
#include <cstdint>
#include <memory>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
class TarjanSCC
{
private:
struct TarjanNode
{
TarjanNode() : index(UINT_MAX), low_link(UINT_MAX), on_stack(false) {}
unsigned index;
unsigned low_link;
bool on_stack;
};
struct TarjanEdgeData
{
int distance;
unsigned name_id : 31;
bool shortcut : 1;
short type;
bool forward : 1;
bool backward : 1;
bool reversedEdge : 1;
};
struct TarjanStackFrame
{
explicit TarjanStackFrame(NodeID v, NodeID parent) : v(v), parent(parent) {}
NodeID v;
NodeID parent;
};
typedef DynamicGraph<TarjanEdgeData> TarjanDynamicGraph;
typedef TarjanDynamicGraph::InputEdge TarjanEdge;
typedef std::pair<NodeID, NodeID> RestrictionSource;
typedef std::pair<NodeID, bool> restriction_target;
typedef std::vector<restriction_target> EmanatingRestrictionsVector;
typedef std::unordered_map<RestrictionSource, unsigned> RestrictionMap;
std::vector<NodeInfo> m_coordinate_list;
std::vector<EmanatingRestrictionsVector> m_restriction_bucket_list;
std::shared_ptr<TarjanDynamicGraph> m_node_based_graph;
std::unordered_set<NodeID> m_barrier_node_list;
std::unordered_set<NodeID> m_traffic_light_list;
unsigned m_restriction_counter;
RestrictionMap m_restriction_map;
public:
TarjanSCC(int number_of_nodes,
std::vector<NodeBasedEdge> &input_edges,
std::vector<NodeID> &bn,
std::vector<NodeID> &tl,
std::vector<TurnRestriction> &irs,
std::vector<NodeInfo> &nI)
: m_coordinate_list(nI), m_restriction_counter(irs.size())
{
for (const TurnRestriction &restriction : irs)
{
std::pair<NodeID, NodeID> restrictionSource = {restriction.fromNode,
restriction.viaNode};
unsigned index;
RestrictionMap::iterator restriction_iterator =
m_restriction_map.find(restrictionSource);
if (restriction_iterator == m_restriction_map.end())
{
index = m_restriction_bucket_list.size();
m_restriction_bucket_list.resize(index + 1);
m_restriction_map.emplace(restrictionSource, index);
}
else
{
index = restriction_iterator->second;
// Map already contains an is_only_*-restriction
if (m_restriction_bucket_list.at(index).begin()->second)
{
continue;
}
else if (restriction.flags.isOnly)
{
// We are going to insert an is_only_*-restriction. There can be only one.
m_restriction_bucket_list.at(index).clear();
}
}
m_restriction_bucket_list.at(index)
.emplace_back(restriction.toNode, restriction.flags.isOnly);
}
m_barrier_node_list.insert(bn.begin(), bn.end());
m_traffic_light_list.insert(tl.begin(), tl.end());
DeallocatingVector<TarjanEdge> edge_list;
for (const NodeBasedEdge &input_edge : input_edges)
{
if (input_edge.source() == input_edge.target())
{
continue;
}
TarjanEdge edge;
if (input_edge.isForward())
{
edge.source = input_edge.source();
edge.target = input_edge.target();
edge.data.forward = input_edge.isForward();
edge.data.backward = input_edge.isBackward();
}
else
{
edge.source = input_edge.target();
edge.target = input_edge.source();
edge.data.backward = input_edge.isForward();
edge.data.forward = input_edge.isBackward();
}
edge.data.distance = (std::max)((int)input_edge.weight(), 1);
BOOST_ASSERT(edge.data.distance > 0);
edge.data.shortcut = false;
// edge.data.roundabout = input_edge.isRoundabout();
// edge.data.ignoreInGrid = input_edge.ignoreInGrid();
edge.data.name_id = input_edge.name();
edge.data.type = input_edge.type();
// edge.data.isAccessRestricted = input_edge.isAccessRestricted();
edge.data.reversedEdge = false;
edge_list.push_back(edge);
if (edge.data.backward)
{
std::swap(edge.source, edge.target);
edge.data.forward = input_edge.isBackward();
edge.data.backward = input_edge.isForward();
edge.data.reversedEdge = true;
edge_list.push_back(edge);
}
}
std::vector<NodeBasedEdge>().swap(input_edges);
BOOST_ASSERT_MSG(0 == input_edges.size() && 0 == input_edges.capacity(),
"input edge vector not properly deallocated");
std::sort(edge_list.begin(), edge_list.end());
m_node_based_graph = std::make_shared<TarjanDynamicGraph>(number_of_nodes, edge_list);
}
~TarjanSCC() { m_node_based_graph.reset(); }
void Run()
{
// remove files from previous run if exist
DeleteFileIfExists("component.dbf");
DeleteFileIfExists("component.shx");
DeleteFileIfExists("component.shp");
Percent p(m_node_based_graph->GetNumberOfNodes());
OGRRegisterAll();
const char *pszDriverName = "ESRI Shapefile";
OGRSFDriver *poDriver =
OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(pszDriverName);
if (NULL == poDriver)
{
throw OSRMException("ESRI Shapefile driver not available");
}
OGRDataSource *poDS = poDriver->CreateDataSource("component.shp", NULL);
if (NULL == poDS)
{
throw OSRMException("Creation of output file failed");
}
OGRLayer *poLayer = poDS->CreateLayer("component", NULL, wkbLineString, NULL);
if (NULL == poLayer)
{
throw OSRMException("Layer creation failed.");
}
// The following is a hack to distinguish between stuff that happens
// before the recursive call and stuff that happens after
std::stack<std::pair<bool, TarjanStackFrame>> recursion_stack;
// true = stuff before, false = stuff after call
std::stack<NodeID> tarjan_stack;
std::vector<unsigned> components_index(m_node_based_graph->GetNumberOfNodes(), UINT_MAX);
std::vector<NodeID> component_size_vector;
std::vector<TarjanNode> tarjan_node_list(m_node_based_graph->GetNumberOfNodes());
unsigned component_index = 0, size_of_current_component = 0;
int index = 0;
NodeID last_node = m_node_based_graph->GetNumberOfNodes();
for (NodeID node = 0; node < last_node; ++node)
{
if (UINT_MAX == components_index[node])
{
recursion_stack.emplace(true, TarjanStackFrame(node, node));
}
while (!recursion_stack.empty())
{
const bool before_recursion = recursion_stack.top().first;
TarjanStackFrame currentFrame = recursion_stack.top().second;
NodeID v = currentFrame.v;
recursion_stack.pop();
if (before_recursion)
{
// Mark frame to handle tail of recursion
recursion_stack.emplace(false, currentFrame);
// Mark essential information for SCC
tarjan_node_list[v].index = index;
tarjan_node_list[v].low_link = index;
tarjan_stack.push(v);
tarjan_node_list[v].on_stack = true;
++index;
// Traverse outgoing edges
for (auto e2 : m_node_based_graph->GetAdjacentEdgeRange(v))
{
const TarjanDynamicGraph::NodeIterator vprime =
m_node_based_graph->GetTarget(e2);
if (UINT_MAX == tarjan_node_list[vprime].index)
{
recursion_stack.emplace(true, TarjanStackFrame(vprime, v));
}
else
{
if (tarjan_node_list[vprime].on_stack &&
tarjan_node_list[vprime].index < tarjan_node_list[v].low_link)
{
tarjan_node_list[v].low_link = tarjan_node_list[vprime].index;
}
}
}
}
else
{
tarjan_node_list[currentFrame.parent].low_link =
std::min(tarjan_node_list[currentFrame.parent].low_link,
tarjan_node_list[v].low_link);
// after recursion, lets do cycle checking
// Check if we found a cycle. This is the bottom part of the recursion
if (tarjan_node_list[v].low_link == tarjan_node_list[v].index)
{
NodeID vprime;
do
{
vprime = tarjan_stack.top();
tarjan_stack.pop();
tarjan_node_list[vprime].on_stack = false;
components_index[vprime] = component_index;
++size_of_current_component;
} while (v != vprime);
component_size_vector.emplace_back(size_of_current_component);
if (size_of_current_component > 1000)
{
SimpleLogger().Write() << "large component [" << component_index
<< "]=" << size_of_current_component;
}
++component_index;
size_of_current_component = 0;
}
}
}
}
SimpleLogger().Write() << "identified: " << component_size_vector.size()
<< " many components, marking small components";
// TODO/C++11: prime candidate for lambda function
// unsigned size_one_counter = 0;
// for (unsigned i = 0, end = component_size_vector.size(); i < end; ++i)
// {
// if (1 == component_size_vector[i])
// {
// ++size_one_counter;
// }
// }
unsigned size_one_counter = std::count_if(component_size_vector.begin(),
component_size_vector.end(),
[] (unsigned value) { return 1 == value;});
SimpleLogger().Write() << "identified " << size_one_counter << " SCCs of size 1";
uint64_t total_network_distance = 0;
p.reinit(m_node_based_graph->GetNumberOfNodes());
NodeID last_u_node = m_node_based_graph->GetNumberOfNodes();
for (NodeID u = 0; u < last_u_node; ++u)
{
p.printIncrement();
for (auto e1 : m_node_based_graph->GetAdjacentEdgeRange(u))
{
if (!m_node_based_graph->GetEdgeData(e1).reversedEdge)
{
continue;
}
const TarjanDynamicGraph::NodeIterator v = m_node_based_graph->GetTarget(e1);
total_network_distance +=
100 * FixedPointCoordinate::ApproximateDistance(m_coordinate_list[u].lat,
m_coordinate_list[u].lon,
m_coordinate_list[v].lat,
m_coordinate_list[v].lon);
if (SHRT_MAX != m_node_based_graph->GetEdgeData(e1).type)
{
BOOST_ASSERT(e1 != UINT_MAX);
BOOST_ASSERT(u != UINT_MAX);
BOOST_ASSERT(v != UINT_MAX);
const unsigned size_of_containing_component =
std::min(component_size_vector[components_index[u]],
component_size_vector[components_index[v]]);
// edges that end on bollard nodes may actually be in two distinct components
if (size_of_containing_component < 10)
{
OGRLineString lineString;
lineString.addPoint(m_coordinate_list[u].lon / COORDINATE_PRECISION,
m_coordinate_list[u].lat / COORDINATE_PRECISION);
lineString.addPoint(m_coordinate_list[v].lon / COORDINATE_PRECISION,
m_coordinate_list[v].lat / COORDINATE_PRECISION);
OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn());
poFeature->SetGeometry(&lineString);
if (OGRERR_NONE != poLayer->CreateFeature(poFeature))
{
throw OSRMException("Failed to create feature in shapefile.");
}
OGRFeature::DestroyFeature(poFeature);
}
}
}
}
OGRDataSource::DestroyDataSource(poDS);
std::vector<NodeID>().swap(component_size_vector);
BOOST_ASSERT_MSG(0 == component_size_vector.size() && 0 == component_size_vector.capacity(),
"component_size_vector not properly deallocated");
std::vector<NodeID>().swap(components_index);
BOOST_ASSERT_MSG(0 == components_index.size() && 0 == components_index.capacity(),
"icomponents_index not properly deallocated");
SimpleLogger().Write() << "total network distance: " << (uint64_t)total_network_distance /
100 / 1000. << " km";
}
private:
unsigned CheckForEmanatingIsOnlyTurn(const NodeID u, const NodeID v) const
{
std::pair<NodeID, NodeID> restriction_source = {u, v};
RestrictionMap::const_iterator restriction_iterator =
m_restriction_map.find(restriction_source);
if (restriction_iterator != m_restriction_map.end())
{
const unsigned index = restriction_iterator->second;
for (const RestrictionSource &restriction_target : m_restriction_bucket_list.at(index))
{
if (restriction_target.second)
{
return restriction_target.first;
}
}
}
return UINT_MAX;
}
bool CheckIfTurnIsRestricted(const NodeID u, const NodeID v, const NodeID w) const
{
// only add an edge if turn is not a U-turn except it is the end of dead-end street.
std::pair<NodeID, NodeID> restriction_source = {u, v};
RestrictionMap::const_iterator restriction_iterator =
m_restriction_map.find(restriction_source);
if (restriction_iterator != m_restriction_map.end())
{
const unsigned index = restriction_iterator->second;
for (const restriction_target &restriction_target : m_restriction_bucket_list.at(index))
{
if (w == restriction_target.first)
{
return true;
}
}
}
return false;
}
void DeleteFileIfExists(const std::string &file_name) const
{
if (boost::filesystem::exists(file_name))
{
boost::filesystem::remove(file_name);
}
}
};
#endif /* STRONGLYCONNECTEDCOMPONENTS_H_ */

1102
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,282 +1,755 @@
cmake_minimum_required(VERSION 2.8)
project(OSRM)
cmake_minimum_required(VERSION 3.18)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed.
Please create a directory and run cmake from there, passing the path to this source directory as the last argument.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
endif()
# detect if this is included as subproject and if so expose
# some variables to its parent scope
get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY)
if(BUILD_AS_SUBPROJECT)
message(STATUS "Building libosrm as subproject.")
endif()
# set OSRM_BUILD_DIR location (might be used in various scripts)
if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR})
set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR})
endif()
option(ENABLE_CONAN "Use conan for dependencies" OFF)
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
option(BUILD_TOOLS "Build OSRM tools" OFF)
option(BUILD_PACKAGE "Build OSRM package" OFF)
option(BUILD_ROUTED "Build osrm-routed HTTP server" ON)
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
option(ENABLE_DEBUG_LOGGING "Use debug logging 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 Link Time Optimisation" ON)
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF)
if (ENABLE_CLANG_TIDY)
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
if(NOT CLANG_TIDY_COMMAND)
message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!")
else()
message(STATUS "Found clang-tidy at ${CLANG_TIDY_COMMAND}")
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND};--warnings-as-errors=*;--header-filter=.*")
endif()
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# be compatible with version handling before cmake 3.x
if (POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
if (POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
project(OSRM C CXX)
if(ENABLE_LTO AND (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
include(CheckIPOSupported)
check_ipo_supported(RESULT LTO_SUPPORTED OUTPUT error)
if(LTO_SUPPORTED)
message(STATUS "IPO / LTO enabled")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(FATAL_ERROR "IPO / LTO not supported: <${error}>")
endif()
endif()
# add @loader_path/$ORIGIN to rpath to make binaries relocatable
if (APPLE)
set(CMAKE_BUILD_RPATH "@loader_path")
else()
set(CMAKE_BUILD_RPATH "\$ORIGIN")
# https://stackoverflow.com/questions/6324131/rpath-origin-not-having-desired-effect
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin")
endif()
include(JSONParser)
file(READ "package.json" packagejsonraw)
sbeParseJson(packagejson packagejsonraw)
# This regex is not strict enough, but the correct one is too complicated for cmake matching.
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
if (packagejson.version MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)([-+][0-9a-zA-Z.-]+)?$")
set(OSRM_VERSION_MAJOR ${CMAKE_MATCH_1})
set(OSRM_VERSION_MINOR ${CMAKE_MATCH_2})
set(OSRM_VERSION_PATCH ${CMAKE_MATCH_3})
set(OSRM_VERSION_PRERELEASE_BUILD ${CMAKE_MATCH_4})
set(OSRM_VERSION packagejson.version)
else()
message(FATAL_ERROR "Version from package.json cannot be parsed, expected semver compatible label, but found ${packagejson.version}")
endif()
if (MSVC)
add_definitions("-DOSRM_PROJECT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"")
else()
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
endif()
# these two functions build up custom variables:
# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
# These variables we want to pass to
# include_directories and add_definitions for both
# this build and for sharing externally via pkg-config
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)
list(APPEND OSRM_DEFINES "${defines}")
set(OSRM_DEFINES "${OSRM_DEFINES}" PARENT_SCOPE)
endfunction(add_dependency_defines)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag)
include(FindPackageHandleStandardArgs)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(GetGitRevisionDescription)
git_describe(GIT_DESCRIPTION)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(bitness 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bitness 64)
message(STATUS "Building on a 64 bit system")
else()
message(WARNING "Building on a 32 bit system is unsupported")
message(FATAL_ERROR "Building on a 32 bit system is not supported")
endif()
include_directories(${CMAKE_SOURCE_DIR}/Include/)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/generated/include/)
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/include)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/Util/UUID.cpp UUID.cpp.alwaysbuild
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UUID-Config.cmake
DEPENDS
${CMAKE_SOURCE_DIR}/Util/UUID.cpp.in
${CMAKE_SOURCE_DIR}/cmake/UUID-Config.cmake
COMMENT "Configuring UUID.cpp"
VERBATIM)
add_custom_target(UUIDConfigure DEPENDS ${CMAKE_SOURCE_DIR}/Util/UUID.cpp)
set(BOOST_COMPONENTS date_time filesystem iostreams program_options regex system thread)
set(BOOST_COMPONENTS date_time iostreams program_options thread unit_test_framework)
configure_file(
${CMAKE_SOURCE_DIR}/Util/GitDescription.cpp.in
${CMAKE_SOURCE_DIR}/Util/GitDescription.cpp
${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/util/version.hpp
)
file(GLOB ExtractorGlob Extractor/*.cpp)
set(ExtractorSources extractor.cpp ${ExtractorGlob})
add_executable(osrm-extract ${ExtractorSources})
file(GLOB UtilGlob src/util/*.cpp src/util/*/*.cpp)
file(GLOB ExtractorGlob src/extractor/*.cpp src/extractor/*/*.cpp)
file(GLOB GuidanceGlob src/guidance/*.cpp src/extractor/intersection/*.cpp)
file(GLOB PartitionerGlob src/partitioner/*.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)
file(GLOB ErrorcodesGlob src/osrm/errorcodes.cpp)
file(GLOB PrepareGlob Contractor/*.cpp DataStructures/HilbertValue.cpp DataStructures/RestrictionMap.cpp)
set(PrepareSources prepare.cpp ${PrepareGlob})
add_executable(osrm-prepare ${PrepareSources})
add_library(UTIL OBJECT ${UtilGlob})
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
add_library(GUIDANCE OBJECT ${GuidanceGlob})
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})
file(GLOB ServerGlob Server/*.cpp)
file(GLOB DescriptorGlob Descriptors/*.cpp)
file(GLOB DatastructureGlob DataStructures/SearchEngineData.cpp DataStructures/RouteParameters.cpp)
file(GLOB CoordinateGlob DataStructures/Coordinate.cpp)
file(GLOB AlgorithmGlob Algorithms/*.cpp)
file(GLOB HttpGlob Server/Http/*.cpp)
file(GLOB LibOSRMGlob Library/*.cpp)
if (BUILD_ROUTED)
add_library(SERVER OBJECT ${ServerGlob})
add_executable(osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
endif()
set(
OSRMSources
${LibOSRMGlob}
${DescriptorGlob}
${DatastructureGlob}
${CoordinateGlob}
${AlgorithmGlob}
${HttpGlob}
)
add_library(COORDLIB STATIC ${CoordinateGlob})
add_library(OSRM ${OSRMSources} Util/GitDescription.cpp Util/UUID.cpp)
add_library(UUID STATIC Util/UUID.cpp)
add_library(GITDESCRIPTION STATIC Util/GitDescription.cpp)
add_dependencies(UUID UUIDConfigure)
add_dependencies(GITDESCRIPTION GIT_DESCRIPTION)
set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX)
add_executable(osrm-routed routed.cpp ${ServerGlob})
set_target_properties(osrm-routed PROPERTIES COMPILE_FLAGS -DROUTED)
add_executable(osrm-datastore datastore.cpp)
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-datastore src/tools/store.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<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:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
add_library(osrm_store $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
# Check the release mode
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
# 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.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified, defaulting to Release")
set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Configuring OSRM in debug mode")
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
message(STATUS "adding profiling flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fno-inline")
set(CMAKE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -fno-inline")
endif()
endif()
if(CMAKE_BUILD_TYPE MATCHES Release)
elseif(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Configuring OSRM in release mode")
# Check if LTO is available
set(LTO_FLAGS "")
CHECK_CXX_COMPILER_FLAG("-flto" HAS_LTO_FLAG)
if (HAS_LTO_FLAG)
set(LTO_FLAGS "${LTO_FLAGS} -flto")
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring OSRM in release mode with debug flags")
elseif(CMAKE_BUILD_TYPE MATCHES MinRelSize)
message(STATUS "Configuring OSRM in release mode with minimized size")
else()
message(STATUS "Unrecognized build type - will use cmake defaults")
endif()
# Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9.0")
message(STATUS "Using gcc specific binutils for LTO.")
set(CMAKE_AR "/usr/bin/gcc-ar")
set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")
endif()
endif (HAS_LTO_FLAG)
# Additional logic for the different build types
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
message(STATUS "Configuring debug mode flags")
set(ENABLE_ASSERTIONS ON)
set(ENABLE_DEBUG_LOGGING ON)
endif()
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fno-inline -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -fno-omit-frame-pointer")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -ggdb")
endif()
set(MAYBE_COVERAGE_LIBRARIES "")
if (ENABLE_COVERAGE)
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
message(ERROR "ENABLE_COVERAGE=ON only makes sense with a Debug build")
endif()
message(STATUS "Enabling coverage")
set(MAYBE_COVERAGE_LIBRARIES "-lgcov")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ftest-coverage -fprofile-arcs")
endif()
if (ENABLE_SANITIZER)
set(SANITIZER_FLAGS "-g -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=undefined -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}")
set(OSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${SANITIZER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SANITIZER_FLAGS}")
endif()
# Configuring compilers
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunreachable-code -Wno-unknown-pragmas -Wno-unneeded-internal-declaration -pedantic -fPIC")
message(STATUS "OpenMP parallelization not available using clang++")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fopenmp -pedantic -fPIC")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -openmp -ipo -fPIC")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# using Visual Studio C++
endif()
# disable partitioning of LTO process when possible (fixes Debian issues)
set(LTO_PARTITION_FLAGS "")
CHECK_CXX_COMPILER_FLAG("-flto-partition=none" HAS_LTO_PARTITION_FLAG)
if (HAS_LTO_PARTITION_FLAG)
set(LTO_PARTITION_FLAGS "${LTO_PARTITION_FLAGS} -flto-partition=none")
endif (HAS_LTO_PARTITION_FLAG)
# Add Link-Time-Optimization flags, if supported (GCC >= 4.7) and enabled
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LTO_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LTO_FLAGS} ${LTO_PARTITION_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LTO_FLAGS} ${LTO_PARTITION_FLAGS}")
# Activate C++11
ADD_DEFINITIONS(
-std=c++11 # Or -std=c++0x
# Other flags
)
# Configuring other platform dependencies
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
message(STATUS "Set Architecture to x64 on OS X")
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
# if(DARWIN_VERSION GREATER 12 AND NOT OSXLIBSTD)
# message(STATUS "Activating -std=c++11 flag for >= OS X 10.9")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# endif()
if(OSXLIBSTD)
message(STATUS "linking against ${OSXLIBSTD}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=${OSXLIBSTD}")
elseif(DARWIN_VERSION GREATER 12)
message(STATUS "linking against libc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
include(cmake/warnings.cmake)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -fcolor-diagnostics -ftemplate-depth=1024")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(COLOR_FLAG "-fdiagnostics-color=auto")
check_cxx_compiler_flag("-fdiagnostics-color=auto" HAS_COLOR_FLAG)
if(NOT HAS_COLOR_FLAG)
set(COLOR_FLAG "")
endif()
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -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()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
# using Intel C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# using Visual Studio C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # avoid compiler error C1128 from scripting_environment_lua.cpp
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32_LEAN_AND_MEAN") # avoid compiler error C2011 from dual #include of winsock.h and winsock2.h
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
add_dependency_defines(-D_WIN32_WINNT=0x0501)
add_dependency_defines(-DXML_STATIC)
find_library(ws2_32_LIBRARY_PATH ws2_32)
target_link_libraries(osrm-extract wsock32 ws2_32)
endif()
if(UNIX AND NOT APPLE)
target_link_libraries(osrm-datastore rt)
target_link_libraries(OSRM rt)
find_library(RT_LIB rt)
if (RT_LIB)
set(MAYBE_RT_LIBRARY -lrt)
endif()
endif()
#Check Boost
set(BOOST_MIN_VERSION "1.49.0")
find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Fatal error: Boost (version >= 1.49.0) required.\n")
endif()
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(OSRM ${Boost_LIBRARIES} COORDLIB)
target_link_libraries(osrm-extract ${Boost_LIBRARIES} UUID GITDESCRIPTION COORDLIB)
target_link_libraries(osrm-prepare ${Boost_LIBRARIES} UUID GITDESCRIPTION COORDLIB)
target_link_libraries(osrm-routed ${Boost_LIBRARIES} OSRM UUID GITDESCRIPTION)
target_link_libraries(osrm-datastore ${Boost_LIBRARIES} UUID GITDESCRIPTION COORDLIB)
find_package(Threads REQUIRED)
target_link_libraries(osrm-extract ${CMAKE_THREAD_LIBS_INIT})
find_package(Lua52)
if(NOT LUA52_FOUND)
find_package(Lua51 REQUIRED)
if(NOT APPLE)
find_package(LuaJIT 5.1)
# Third-party libraries
set(RAPIDJSON_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/rapidjson/include")
include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR})
set(MICROTAR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src")
include_directories(SYSTEM ${MICROTAR_INCLUDE_DIR})
add_library(MICROTAR OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/third_party/microtar/src/microtar.c")
set_property(TARGET MICROTAR PROPERTY POSITION_INDEPENDENT_CODE ON)
target_no_warning(MICROTAR unused-variable)
target_no_warning(MICROTAR format)
set(PROTOZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/protozero/include")
include_directories(SYSTEM ${PROTOZERO_INCLUDE_DIR})
set(VTZERO_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/vtzero/include")
include_directories(SYSTEM ${VTZERO_INCLUDE_DIR})
set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Disable the build of Flatbuffers tests and samples.")
set(FLATBUFFERS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers")
set(FLATBUFFERS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include")
include_directories(SYSTEM ${FLATBUFFERS_INCLUDE_DIR})
add_subdirectory(${FLATBUFFERS_SRC_DIR}
${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build
EXCLUDE_FROM_ALL)
set(FMT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include")
add_compile_definitions(FMT_HEADER_ONLY)
include_directories(SYSTEM ${FMT_INCLUDE_DIR})
# see https://stackoverflow.com/questions/70898030/boost-link-error-using-conan-find-package
if (MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
if(ENABLE_CONAN)
message(STATUS "Installing dependencies via Conan")
# Conan will generate Find*.cmake files to build directory, so we use them with the highest priority
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR})
list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_BINARY_DIR})
include(${CMAKE_CURRENT_LIST_DIR}/cmake/conan.cmake)
conan_check(REQUIRED)
set(CONAN_BOOST_VERSION "1.85.0@#14265ec82b25d91305bbb3b30d3357f8")
set(CONAN_BZIP2_VERSION "1.0.8@#d1b2d5816f25865acf978501dff1f897")
set(CONAN_EXPAT_VERSION "2.6.2@#2d385d0d50eb5561006a7ff9e356656b")
set(CONAN_LUA_VERSION "5.4.6@#658d6089093cf01992c2737ab2e96763")
set(CONAN_TBB_VERSION "2021.12.0@#e56e5b44be8d690530585dd3634c0106")
set(CONAN_SYSTEM_INCLUDES ON)
set(CONAN_ARGS
REQUIRES
"boost/${CONAN_BOOST_VERSION}"
"bzip2/${CONAN_BZIP2_VERSION}"
"expat/${CONAN_EXPAT_VERSION}"
"lua/${CONAN_LUA_VERSION}"
"onetbb/${CONAN_TBB_VERSION}"
BASIC_SETUP
GENERATORS cmake_find_package json # json generator generates a conanbuildinfo.json in the build folder so (non-CMake) projects can easily parse OSRM's dependencies
KEEP_RPATHS
NO_OUTPUT_DIRS
OPTIONS boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it
BUILD missing
)
# Enable revisions in the conan config
execute_process(COMMAND ${CONAN_CMD} config set general.revisions_enabled=1 RESULT_VARIABLE RET_CODE)
if(NOT "${RET_CODE}" STREQUAL "0")
message(FATAL_ERROR "Error setting revisions for Conan: '${RET_CODE}'")
endif()
# explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141)
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
conan_cmake_run("${CONAN_ARGS};ARCH;x86")
# cross-compilation for Apple Silicon
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
conan_cmake_run("${CONAN_ARGS};ARCH;armv8")
else()
conan_cmake_run("${CONAN_ARGS}")
endif()
add_dependency_includes(${CONAN_INCLUDE_DIRS_BOOST})
add_dependency_includes(${CONAN_INCLUDE_DIRS_BZIP2})
add_dependency_includes(${CONAN_INCLUDE_DIRS_EXPAT})
add_dependency_includes(${CONAN_INCLUDE_DIRS_LUA})
add_dependency_includes(${CONAN_INCLUDE_DIRS_TBB})
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
set(Boost_DATE_TIME_LIBRARY "${Boost_date_time_LIB_TARGETS}")
set(Boost_PROGRAM_OPTIONS_LIBRARY "${Boost_program_options_LIB_TARGETS}")
set(Boost_IOSTREAMS_LIBRARY "${Boost_iostreams_LIB_TARGETS}")
set(Boost_THREAD_LIBRARY "${Boost_thread_LIB_TARGETS}")
set(Boost_ZLIB_LIBRARY "${Boost_zlib_LIB_TARGETS}")
set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY "${Boost_unit_test_framework_LIB_TARGETS}")
find_package(BZip2 REQUIRED)
find_package(EXPAT REQUIRED)
find_package(lua REQUIRED)
set(LUA_LIBRARIES ${lua_LIBRARIES})
find_package(TBB REQUIRED)
# note: we avoid calling find_package(Osmium ...) here to ensure that the
# expat and bzip2 are used from conan rather than the system
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
else()
if(NOT APPLE)
find_package(LuaJIT 5.2)
find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
add_dependency_includes(${Boost_INCLUDE_DIRS})
find_package(TBB REQUIRED)
add_dependency_includes(${TBB_INCLUDE_DIR})
set(TBB_LIBRARIES TBB::tbb)
find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})
find_package(Lua 5.2 REQUIRED)
if (LUA_FOUND)
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif()
add_dependency_includes(${LUA_INCLUDE_DIR})
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
# note libosmium depends on expat and bzip2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
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})
endif()
# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Using ccache to speed up incremental builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
endif()
if( LUAJIT_FOUND )
target_link_libraries(osrm-extract ${LUAJIT_LIBRARIES})
target_link_libraries(osrm-prepare ${LUAJIT_LIBRARIES})
else()
target_link_libraries(osrm-extract ${LUA_LIBRARY})
target_link_libraries(osrm-prepare ${LUA_LIBRARY})
endif()
include_directories(${LUA_INCLUDE_DIR})
find_package(LibXml2 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
target_link_libraries(osrm-extract ${LIBXML2_LIBRARIES})
find_package( Luabind REQUIRED )
include_directories(${LUABIND_INCLUDE_DIR})
target_link_libraries(osrm-extract ${LUABIND_LIBRARY})
target_link_libraries(osrm-prepare ${LUABIND_LIBRARY})
find_package( STXXL REQUIRED )
include_directories(${STXXL_INCLUDE_DIR})
target_link_libraries(OSRM ${STXXL_LIBRARY})
target_link_libraries(osrm-extract ${STXXL_LIBRARY})
target_link_libraries(osrm-prepare ${STXXL_LIBRARY})
find_package( OSMPBF REQUIRED )
include_directories(${OSMPBF_INCLUDE_DIR})
target_link_libraries(osrm-extract ${OSMPBF_LIBRARY})
target_link_libraries(osrm-prepare ${OSMPBF_LIBRARY})
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
target_link_libraries(osrm-extract ${PROTOBUF_LIBRARY})
target_link_libraries(osrm-prepare ${PROTOBUF_LIBRARY})
find_package(BZip2 REQUIRED)
include_directories(${BZIP_INCLUDE_DIRS})
target_link_libraries(osrm-extract ${BZIP2_LIBRARIES})
# even with conan builds we want to link to system zlib
# to ensure that osrm binaries play well with other binaries like nodejs
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(osrm-extract ${ZLIB_LIBRARY})
target_link_libraries(osrm-routed ${ZLIB_LIBRARY})
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
if(WITH_TOOLS)
message(STATUS "Activating OSRM internal tools")
find_package(GDAL)
if(GDAL_FOUND)
add_executable(osrm-components Tools/components.cpp)
include_directories(${GDAL_INCLUDE_DIR})
target_link_libraries(
osrm-components
${GDAL_LIBRARIES} ${Boost_LIBRARIES} UUID GITDESCRIPTION COORDLIB)
endif()
add_executable(osrm-cli Tools/simpleclient.cpp)
target_link_libraries(osrm-cli ${Boost_LIBRARIES} OSRM UUID GITDESCRIPTION)
add_executable(osrm-io-benchmark Tools/io-benchmark.cpp)
target_link_libraries(osrm-io-benchmark ${Boost_LIBRARIES} GITDESCRIPTION)
add_executable(osrm-unlock-all Tools/unlock_all_mutexes.cpp)
target_link_libraries(osrm-unlock-all ${Boost_LIBRARIES} GITDESCRIPTION)
if(UNIX AND NOT APPLE)
target_link_libraries(osrm-unlock-all rt)
endif()
add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
# Workaround for https://github.com/boostorg/phoenix/issues/111
add_dependency_defines(-DBOOST_PHOENIX_STL_TUPLE_H_)
add_definitions(${OSRM_DEFINES})
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
set(BOOST_BASE_LIBRARIES
${Boost_DATE_TIME_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_THREAD_LIBRARY})
set(BOOST_ENGINE_LIBRARIES
${Boost_ZLIB_LIBRARY}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_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})
if (BUILD_ROUTED)
target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY})
endif()
file(GLOB InstallGlob Include/osrm/*.h Library/OSRM.h)
set(EXTRACTOR_LIBRARIES
${BZIP2_LIBRARIES}
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${EXPAT_LIBRARIES}
${LUA_LIBRARIES}
${OSMIUM_LIBRARIES}
${TBB_LIBRARIES}
${ZLIB_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(GUIDANCE_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${LUA_LIBRARIES}
${TBB_LIBRARIES}
${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}
${ZLIB_LIBRARY})
set(CONTRACTOR_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${LUA_LIBRARIES}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(ENGINE_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
set(STORAGE_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES})
set(UTIL_LIBRARIES
${BOOST_BASE_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
# Libraries
target_link_libraries(osrm ${ENGINE_LIBRARIES})
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
target_link_libraries(osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES})
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
# BUILD_COMPONENTS
add_executable(osrm-components src/tools/components.cpp $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_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} ${TBB_LIBRARIES})
install(TARGETS osrm-io-benchmark DESTINATION bin)
endif()
if (ENABLE_ASSERTIONS)
message(STATUS "Enabling assertions")
add_definitions(-DBOOST_ENABLE_ASSERT_HANDLER)
endif()
if (ENABLE_DEBUG_LOGGING)
message(STATUS "Enabling debug logging")
add_definitions(-DENABLE_DEBUG_LOGGING)
endif()
# Add RPATH info to executables so that when they are run after being installed
# (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-prepare 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)
if (BUILD_ROUTED)
set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
install(FILES ${InstallGlob} DESTINATION include/osrm)
file(GLOB FlatbuffersGlob third_party/flatbuffers/include/flatbuffers/*.h)
file(GLOB LibraryGlob include/osrm/*.hpp)
file(GLOB ParametersGlob include/engine/api/*_parameters.hpp)
set(ApiHeader include/engine/api/base_result.hpp)
set(EngineHeader include/engine/status.hpp include/engine/engine_config.hpp include/engine/hint.hpp include/engine/bearing.hpp include/engine/approach.hpp include/engine/phantom_node.hpp)
set(UtilHeader include/util/coordinate.hpp include/util/json_container.hpp include/util/typedefs.hpp include/util/alias.hpp include/util/exception.hpp include/util/bearing.hpp)
set(ExtractorHeader include/extractor/extractor.hpp include/storage/io_config.hpp include/extractor/extractor_config.hpp include/extractor/travel_mode.hpp)
set(PartitionerHeader include/partitioner/partitioner.hpp include/partitioner/partitioner_config.hpp)
set(ContractorHeader include/contractor/contractor.hpp include/contractor/contractor_config.hpp)
set(StorageHeader include/storage/storage.hpp include/storage/io_config.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/partitioner)
install(FILES ${ContractorHeader} DESTINATION include/osrm/contractor)
install(FILES ${LibraryGlob} DESTINATION include/osrm)
install(FILES ${ParametersGlob} DESTINATION include/osrm/engine/api)
install(FILES ${ApiHeader} DESTINATION include/osrm/engine/api)
install(FILES ${FlatbuffersGlob} DESTINATION include/flatbuffers)
install(TARGETS osrm-extract DESTINATION bin)
install(TARGETS osrm-prepare DESTINATION bin)
install(TARGETS osrm-partition DESTINATION bin)
install(TARGETS osrm-customize 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)
list(GET Boost_LIBRARIES 1 BOOST_LIBRARY_FIRST)
get_filename_component(BOOST_LIBRARY_LISTING "${BOOST_LIBRARY_FIRST}" PATH)
set(BOOST_LIBRARY_LISTING "-L${BOOST_LIBRARY_LISTING}")
foreach (lib ${Boost_LIBRARIES})
get_filename_component(BOOST_LIBRARY_NAME "${lib}" NAME_WE)
string(REPLACE "lib" "" BOOST_LIBRARY_NAME ${BOOST_LIBRARY_NAME})
set(BOOST_LIBRARY_LISTING "${BOOST_LIBRARY_LISTING} -l${BOOST_LIBRARY_NAME}")
endforeach ()
if (BUILD_ROUTED)
install(TARGETS osrm-routed DESTINATION bin)
endif()
install(TARGETS osrm DESTINATION lib)
install(TARGETS osrm_extract DESTINATION lib)
install(TARGETS osrm_partition DESTINATION lib)
install(TARGETS osrm_customize DESTINATION lib)
install(TARGETS osrm_update DESTINATION lib)
install(TARGETS osrm_contract DESTINATION lib)
install(TARGETS osrm_store DESTINATION lib)
install(TARGETS osrm_guidance DESTINATION lib)
# Install profiles and support library to /usr/local/share/osrm/profiles by default
set(DefaultProfilesDir profiles)
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
# Install data geojson files to /usr/local/share/osrm/data by default
set(DefaultProfilesDir data)
install(DIRECTORY ${DefaultProfilesDir} DESTINATION share/osrm)
# Setup exporting variables for pkgconfig and subproject
#
if(BUILD_PACKAGE)
include(CPackConfig)
include(CPack)
endif()
function(JOIN VALUES GLUE OUTPUT)
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
JOIN("${OSRM_DEFINES}" " " TMP_OSRM_DEFINES)
set(LibOSRM_CXXFLAGS "${OSRM_CXXFLAGS} ${TMP_OSRM_DEFINES}")
set(LibOSRM_LDFLAGS "${OSRM_LDFLAGS}")
if(BUILD_AS_SUBPROJECT)
set(LibOSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(LibOSRM_LIBRARIES "osrm" PARENT_SCOPE)
set(LibOSRM_DEPENDENT_LIBRARIES "${ENGINE_LIBRARIES}" PARENT_SCOPE)
set(LibOSRM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/include/osrm"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party"
"${DEPENDENCIES_INCLUDE_DIRS}" PARENT_SCOPE)
set(LibOSRM_LIBRARY_DIRS "${LibOSRM_LIBRARY_DIR}" PARENT_SCOPE)
endif()
# pkgconfig defines
set(PKGCONFIG_OSRM_CXXFLAGS "${LibOSRM_CXXFLAGS}")
set(PKGCONFIG_OSRM_LDFLAGS "${LibOSRM_LDFLAGS}")
set(PKGCONFIG_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set(PKGCONFIG_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)
# Boost uses imported targets, we need to use a generator expression to extract
# the link libraries to be written to the pkg-config file.
# Conan & TBB define dependencies as CMake targets too, that's why we do the same for them.
foreach(engine_lib ${ENGINE_LIBRARIES})
if("${engine_lib}" MATCHES "^Boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*")
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$<TARGET_LINKER_FILE:${engine_lib}>")
else()
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}")
endif()
endforeach(engine_lib)
JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY)
file(GENERATE
OUTPUT
${PROJECT_BINARY_DIR}/libosrm.pc
INPUT
${PROJECT_BINARY_DIR}/pkgconfig.configured)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION ${PKGCONFIG_LIBRARY_DIR}/pkgconfig)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake)
# Modular build system: each directory registered here provides its own CMakeLists.txt
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")
set_property(CACHE FUZZ_SANITIZER PROPERTY STRINGS "undefined" "integer" "address" "memory" "thread" "leak")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize-coverage=edge,indirect-calls,8bit-counters -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(OSRM_LDFLAGS "${OSRM_LDFLAGS} -fsanitize=address")
message(STATUS "Using -fsanitize=${FUZZ_SANITIZER} for Fuzz testing")
add_subdirectory(fuzz)
endif ()
# add headers sanity check target that includes all headers independently
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})
if ("${header}" MATCHES ".*/include/nodejs/.*")
# we do not check NodeJS bindings headers
continue()
endif()
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})
configure_file(${CMAKE_SOURCE_DIR}/cmake/pkgconfig.in libosrm.pc @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/libosrm.pc DESTINATION lib/pkgconfig)

3
CODE-OF-CONDUCT.md Normal file
View File

@ -0,0 +1,3 @@
# Code of conduct
Everyone is invited to participate in Project OSRMs open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Project-OSRM organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/).

81
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,81 @@
# Everyone
Please take some time to review our [code of conduct](CODE-OF-CONDUCT.md) to help guide your interactions with others on this project.
# User
Before you open a new issue, please search for older ones that cover the same issue.
In general "me too" comments/issues are frowned upon.
You can add a :+1: emoji reaction to the issue if you want to express interest in this.
# Developer
We use `clang-format` version `15` 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 && ./scripts/error_on_dirty.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).
## Pull Request
Every pull-request that changes the API needs to update the docs in `docs/http.md` and add an entry to `CHANGELOG.md`.
Breaking changes need to have a BREAKING prefix. See the [releasing documentation](docs/releasing.md) on how this affects the version.
Early feedback is also important.
You will see that a lot of the PR have tags like `[not ready]` or `[wip]`.
We like to open PRs as soon as we are starting to work on something to make it visible to the rest of the team.
If your work is going in entirely the wrong direction, there is a good chance someone will pick up on this before it is too late.
Everyone is encouraged to read PRs of other people and give feedback.
For every significant code change we require a pull request review before it is merged.
If your pull request modifies the API this need to be signed of by a team discussion.
This means you will need to find another member of the team with commit access and request a review of your pull request.
Once your pull request is reviewed you can merge it! If you don't have commit access, ping someone that has commit access.
If you do have commit access there are in general two accepted styles to merging:
1. Make sure the branch is up to date with `master`. Run `git rebase master` to find out.
2. Once that is ensured you can either:
- Click the nice green merge button (for a non-fast-forward merge)
- Merge by hand using a fast-forward merge
Which merge you prefer is up to personal preference. In general it is recommended to use fast-forward merges because it creates a history that is sequential and easier to understand.
# Maintainer
## Doing a release
There is an in-depth guide around how to push out a release once it is ready [here](docs/releasing.md).
## The API
Changes to the API need to be discussed and signed off by the team. Breaking changes even more so than additive changes.
## Milestones
If a pull request or an issue is applicable for the current or next milestone, depends on the target version number.
Since we use semantic versioning we restrict breaking changes to major releases.
After a Release Candidate is released we usually don't change the API anymore if it is not critical.
Bigger code changes after a RC was released should also be avoided.

View File

@ -1,963 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CONTRACTOR_H
#define CONTRACTOR_H
#include "TemporaryStorage.h"
#include "../DataStructures/BinaryHeap.h"
#include "../DataStructures/DeallocatingVector.h"
#include "../DataStructures/DynamicGraph.h"
#include "../DataStructures/Percent.h"
#include "../DataStructures/XORFastHash.h"
#include "../DataStructures/XORFastHashStorage.h"
#include "../Util/OpenMPWrapper.h"
#include "../Util/SimpleLogger.h"
#include "../Util/StringUtil.h"
#include <boost/assert.hpp>
#include <algorithm>
#include <limits>
#include <vector>
class Contractor
{
private:
struct ContractorEdgeData
{
ContractorEdgeData()
: distance(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0),
is_original_via_node_ID(false)
{
}
ContractorEdgeData(unsigned _distance,
unsigned _originalEdges,
unsigned _id,
bool _shortcut,
bool _forward,
bool _backward)
: distance(_distance), id(_id),
originalEdges(std::min((unsigned)1 << 28, _originalEdges)), shortcut(_shortcut),
forward(_forward), backward(_backward), is_original_via_node_ID(false)
{
}
unsigned distance;
unsigned id;
unsigned originalEdges : 28;
bool shortcut : 1;
bool forward : 1;
bool backward : 1;
bool is_original_via_node_ID : 1;
} data;
struct ContractorHeapData
{
short hop;
bool target;
ContractorHeapData() : hop(0), target(false) {}
ContractorHeapData(short h, bool t) : hop(h), target(t) {}
};
typedef DynamicGraph<ContractorEdgeData> ContractorGraph;
// typedef BinaryHeap< NodeID, NodeID, int, ContractorHeapData, ArrayStorage<NodeID, NodeID>
// > ContractorHeap;
typedef BinaryHeap<NodeID, NodeID, int, ContractorHeapData, XORFastHashStorage<NodeID, NodeID>>
ContractorHeap;
typedef ContractorGraph::InputEdge ContractorEdge;
struct ContractorThreadData
{
ContractorHeap heap;
std::vector<ContractorEdge> inserted_edges;
std::vector<NodeID> neighbours;
ContractorThreadData(NodeID nodes) : heap(nodes) {}
};
struct NodePriorityData
{
int depth;
NodePriorityData() : depth(0) {}
};
struct ContractionStats
{
int edges_deleted_count;
int edges_added_count;
int original_edges_deleted_count;
int original_edges_added_count;
ContractionStats()
: edges_deleted_count(0), edges_added_count(0), original_edges_deleted_count(0),
original_edges_added_count(0)
{
}
};
struct RemainingNodeData
{
RemainingNodeData() : id(0), is_independent(false) {}
NodeID id : 31;
bool is_independent : 1;
};
public:
template <class ContainerT> Contractor(int nodes, ContainerT &input_edge_list)
{
std::vector<ContractorEdge> edges;
edges.reserve(input_edge_list.size() * 2);
temp_edge_counter = 0;
auto diter = input_edge_list.dbegin();
auto dend = input_edge_list.dend();
ContractorEdge new_edge;
while (diter != dend)
{
new_edge.source = diter->source();
new_edge.target = diter->target();
new_edge.data = ContractorEdgeData((std::max)((int)diter->weight(), 1),
1,
diter->id(),
false,
diter->isForward(),
diter->isBackward());
BOOST_ASSERT_MSG(new_edge.data.distance > 0, "edge distance < 1");
#ifndef NDEBUG
if (new_edge.data.distance > 24 * 60 * 60 * 10)
{
SimpleLogger().Write(logWARNING) << "Edge weight large -> "
<< new_edge.data.distance;
}
#endif
edges.push_back(new_edge);
std::swap(new_edge.source, new_edge.target);
new_edge.data.forward = diter->isBackward();
new_edge.data.backward = diter->isForward();
edges.push_back(new_edge);
++diter;
}
// clear input vector and trim the current set of edges with the well-known swap trick
input_edge_list.clear();
sort(edges.begin(), edges.end());
NodeID edge = 0;
for (NodeID i = 0; i < edges.size();)
{
const NodeID source = edges[i].source;
const NodeID target = edges[i].target;
const NodeID id = edges[i].data.id;
// remove eigenloops
if (source == target)
{
i++;
continue;
}
ContractorEdge forward_edge;
ContractorEdge reverse_edge;
forward_edge.source = reverse_edge.source = source;
forward_edge.target = reverse_edge.target = target;
forward_edge.data.forward = reverse_edge.data.backward = true;
forward_edge.data.backward = reverse_edge.data.forward = false;
forward_edge.data.shortcut = reverse_edge.data.shortcut = false;
forward_edge.data.id = reverse_edge.data.id = id;
forward_edge.data.originalEdges = reverse_edge.data.originalEdges = 1;
forward_edge.data.distance = reverse_edge.data.distance =
std::numeric_limits<int>::max();
// remove parallel edges
while (i < edges.size() && edges[i].source == source && edges[i].target == target)
{
if (edges[i].data.forward)
{
forward_edge.data.distance =
std::min(edges[i].data.distance, forward_edge.data.distance);
}
if (edges[i].data.backward)
{
reverse_edge.data.distance =
std::min(edges[i].data.distance, reverse_edge.data.distance);
}
++i;
}
// merge edges (s,t) and (t,s) into bidirectional edge
if (forward_edge.data.distance == reverse_edge.data.distance)
{
if ((int)forward_edge.data.distance != std::numeric_limits<int>::max())
{
forward_edge.data.backward = true;
edges[edge++] = forward_edge;
}
}
else
{ // insert seperate edges
if (((int)forward_edge.data.distance) != std::numeric_limits<int>::max())
{
edges[edge++] = forward_edge;
}
if ((int)reverse_edge.data.distance != std::numeric_limits<int>::max())
{
edges[edge++] = reverse_edge;
}
}
}
std::cout << "merged " << edges.size() - edge << " edges out of " << edges.size()
<< std::endl;
edges.resize(edge);
contractor_graph = std::make_shared<ContractorGraph>(nodes, edges);
edges.clear();
edges.shrink_to_fit();
BOOST_ASSERT(0 == edges.capacity());
// unsigned maxdegree = 0;
// NodeID highestNode = 0;
//
// for(unsigned i = 0; i < contractor_graph->GetNumberOfNodes(); ++i) {
// unsigned degree = contractor_graph->EndEdges(i) -
// contractor_graph->BeginEdges(i);
// if(degree > maxdegree) {
// maxdegree = degree;
// highestNode = i;
// }
// }
//
// SimpleLogger().Write() << "edges at node with id " << highestNode << " has degree
// " << maxdegree;
// for(unsigned i = contractor_graph->BeginEdges(highestNode); i <
// contractor_graph->EndEdges(highestNode); ++i) {
// SimpleLogger().Write() << " ->(" << highestNode << "," <<
// contractor_graph->GetTarget(i)
// << "); via: " << contractor_graph->GetEdgeData(i).via;
// }
// Create temporary file
edge_storage_slot = TemporaryStorage::GetInstance().AllocateSlot();
std::cout << "contractor finished initalization" << std::endl;
}
~Contractor() { TemporaryStorage::GetInstance().DeallocateSlot(edge_storage_slot); }
void Run()
{
const NodeID number_of_nodes = contractor_graph->GetNumberOfNodes();
Percent p(number_of_nodes);
const unsigned thread_count = omp_get_max_threads();
std::vector<ContractorThreadData *> thread_data_list;
for (unsigned thread_id = 0; thread_id < thread_count; ++thread_id)
{
thread_data_list.push_back(new ContractorThreadData(number_of_nodes));
}
std::cout << "Contractor is using " << thread_count << " threads" << std::endl;
NodeID number_of_contracted_nodes = 0;
std::vector<RemainingNodeData> remaining_nodes(number_of_nodes);
std::vector<float> node_priorities(number_of_nodes);
std::vector<NodePriorityData> node_data(number_of_nodes);
// initialize priorities in parallel
#pragma omp parallel for schedule(guided)
for (int x = 0; x < (int)number_of_nodes; ++x)
{
remaining_nodes[x].id = x;
}
std::cout << "initializing elimination PQ ..." << std::flush;
#pragma omp parallel
{
ContractorThreadData *data = thread_data_list[omp_get_thread_num()];
#pragma omp parallel for schedule(guided)
for (int x = 0; x < (int)number_of_nodes; ++x)
{
node_priorities[x] = EvaluateNodePriority(data, &node_data[x], x);
}
}
std::cout << "ok" << std::endl << "preprocessing " << number_of_nodes << " nodes ..."
<< std::flush;
bool flushed_contractor = false;
while (number_of_nodes > 2 && number_of_contracted_nodes < number_of_nodes)
{
if (!flushed_contractor && (number_of_contracted_nodes > (number_of_nodes * 0.65)))
{
DeallocatingVector<ContractorEdge> new_edge_set; // this one is not explicitely
// cleared since it goes out of
// scope anywa
std::cout << " [flush " << number_of_contracted_nodes << " nodes] " << std::flush;
// Delete old heap data to free memory that we need for the coming operations
for (ContractorThreadData *data : thread_data_list)
{
delete data;
}
thread_data_list.clear();
// Create new priority array
std::vector<float> new_node_priority(remaining_nodes.size());
// this map gives the old IDs from the new ones, necessary to get a consistent graph
// at the end of contraction
orig_node_id_to_new_id_map.resize(remaining_nodes.size());
// this map gives the new IDs from the old ones, necessary to remap targets from the
// remaining graph
std::vector<NodeID> new_node_id_from_orig_id_map(number_of_nodes, UINT_MAX);
// build forward and backward renumbering map and remap ids in remaining_nodes and
// Priorities.
for (unsigned new_node_id = 0; new_node_id < remaining_nodes.size(); ++new_node_id)
{
// create renumbering maps in both directions
orig_node_id_to_new_id_map[new_node_id] = remaining_nodes[new_node_id].id;
new_node_id_from_orig_id_map[remaining_nodes[new_node_id].id] = new_node_id;
new_node_priority[new_node_id] =
node_priorities[remaining_nodes[new_node_id].id];
remaining_nodes[new_node_id].id = new_node_id;
}
TemporaryStorage &temporary_storage = TemporaryStorage::GetInstance();
// walk over all nodes
for (unsigned i = 0; i < contractor_graph->GetNumberOfNodes(); ++i)
{
const NodeID start = i;
for (auto current_edge : contractor_graph->GetAdjacentEdgeRange(start))
{
ContractorGraph::EdgeData &data =
contractor_graph->GetEdgeData(current_edge);
const NodeID target = contractor_graph->GetTarget(current_edge);
if (UINT_MAX == new_node_id_from_orig_id_map[i])
{
// Save edges of this node w/o renumbering.
temporary_storage.WriteToSlot(
edge_storage_slot, (char *)&start, sizeof(NodeID));
temporary_storage.WriteToSlot(
edge_storage_slot, (char *)&target, sizeof(NodeID));
temporary_storage.WriteToSlot(edge_storage_slot,
(char *)&data,
sizeof(ContractorGraph::EdgeData));
++temp_edge_counter;
}
else
{
// node is not yet contracted.
// add (renumbered) outgoing edges to new DynamicGraph.
ContractorEdge new_edge;
new_edge.source = new_node_id_from_orig_id_map[start];
new_edge.target = new_node_id_from_orig_id_map[target];
new_edge.data = data;
new_edge.data.is_original_via_node_ID = true;
BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[start],
"new start id not resolveable");
BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[target],
"new target id not resolveable");
new_edge_set.push_back(new_edge);
}
}
}
// Delete map from old NodeIDs to new ones.
new_node_id_from_orig_id_map.clear();
new_node_id_from_orig_id_map.shrink_to_fit();
// Replace old priorities array by new one
node_priorities.swap(new_node_priority);
// Delete old node_priorities vector
std::vector<float>().swap(new_node_priority);
// old Graph is removed
contractor_graph.reset();
// create new graph
std::sort(new_edge_set.begin(), new_edge_set.end());
contractor_graph =
std::make_shared<ContractorGraph>(remaining_nodes.size(), new_edge_set);
new_edge_set.clear();
flushed_contractor = true;
// INFO: MAKE SURE THIS IS THE LAST OPERATION OF THE FLUSH!
// reinitialize heaps and ThreadData objects with appropriate size
for (unsigned thread_id = 0; thread_id < thread_count; ++thread_id)
{
thread_data_list.push_back(
new ContractorThreadData(contractor_graph->GetNumberOfNodes()));
}
}
const int last = (int)remaining_nodes.size();
#pragma omp parallel
{
// determine independent node set
ContractorThreadData *const data = thread_data_list[omp_get_thread_num()];
#pragma omp for schedule(guided)
for (int i = 0; i < last; ++i)
{
const NodeID node = remaining_nodes[i].id;
remaining_nodes[i].is_independent =
IsNodeIndependent(node_priorities, data, node);
}
}
const auto first = stable_partition(remaining_nodes.begin(),
remaining_nodes.end(),
[](RemainingNodeData node_data)
{ return !node_data.is_independent; });
const int first_independent_node = first - remaining_nodes.begin();
// contract independent nodes
#pragma omp parallel
{
ContractorThreadData *data = thread_data_list[omp_get_thread_num()];
#pragma omp for schedule(guided) nowait
for (int position = first_independent_node; position < last; ++position)
{
NodeID x = remaining_nodes[position].id;
ContractNode<false>(data, x);
}
std::sort(data->inserted_edges.begin(), data->inserted_edges.end());
}
#pragma omp parallel
{
ContractorThreadData *data = thread_data_list[omp_get_thread_num()];
#pragma omp for schedule(guided) nowait
for (int position = first_independent_node; position < last; ++position)
{
NodeID x = remaining_nodes[position].id;
DeleteIncomingEdges(data, x);
}
}
// insert new edges
for (unsigned thread_id = 0; thread_id < thread_count; ++thread_id)
{
ContractorThreadData &data = *thread_data_list[thread_id];
for (const ContractorEdge &edge : data.inserted_edges)
{
auto current_edge_ID = contractor_graph->FindEdge(edge.source, edge.target);
if (current_edge_ID < contractor_graph->EndEdges(edge.source))
{
ContractorGraph::EdgeData &current_data =
contractor_graph->GetEdgeData(current_edge_ID);
if (current_data.shortcut && edge.data.forward == current_data.forward &&
edge.data.backward == current_data.backward &&
edge.data.distance < current_data.distance)
{
// found a duplicate edge with smaller weight, update it.
current_data = edge.data;
continue;
}
}
contractor_graph->InsertEdge(edge.source, edge.target, edge.data);
}
data.inserted_edges.clear();
}
// update priorities
#pragma omp parallel
{
ContractorThreadData *data = thread_data_list[omp_get_thread_num()];
#pragma omp for schedule(guided) nowait
for (int position = first_independent_node; position < last; ++position)
{
NodeID x = remaining_nodes[position].id;
UpdateNodeNeighbours(node_priorities, node_data, data, x);
}
}
// remove contracted nodes from the pool
number_of_contracted_nodes += last - first_independent_node;
remaining_nodes.resize(first_independent_node);
std::vector<RemainingNodeData>(remaining_nodes).swap(remaining_nodes);
// unsigned maxdegree = 0;
// unsigned avgdegree = 0;
// unsigned mindegree = UINT_MAX;
// unsigned quaddegree = 0;
//
// for(unsigned i = 0; i < remaining_nodes.size(); ++i) {
// unsigned degree = contractor_graph->EndEdges(remaining_nodes[i].first)
// -
// contractor_graph->BeginEdges(remaining_nodes[i].first);
// if(degree > maxdegree)
// maxdegree = degree;
// if(degree < mindegree)
// mindegree = degree;
//
// avgdegree += degree;
// quaddegree += (degree*degree);
// }
//
// avgdegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() );
// quaddegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() );
//
// SimpleLogger().Write() << "rest: " << remaining_nodes.size() << ", max: "
// << maxdegree << ", min: " << mindegree << ", avg: " << avgdegree << ",
// quad: " << quaddegree;
p.printStatus(number_of_contracted_nodes);
}
for (ContractorThreadData *data : thread_data_list)
{
delete data;
}
thread_data_list.clear();
}
template <class Edge> inline void GetEdges(DeallocatingVector<Edge> &edges)
{
Percent p(contractor_graph->GetNumberOfNodes());
SimpleLogger().Write() << "Getting edges of minimized graph";
NodeID number_of_nodes = contractor_graph->GetNumberOfNodes();
if (contractor_graph->GetNumberOfNodes())
{
Edge new_edge;
for (NodeID node = 0; node < number_of_nodes; ++node)
{
p.printStatus(node);
for (auto edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const NodeID target = contractor_graph->GetTarget(edge);
const ContractorGraph::EdgeData &data = contractor_graph->GetEdgeData(edge);
if (!orig_node_id_to_new_id_map.empty())
{
new_edge.source = orig_node_id_to_new_id_map[node];
new_edge.target = orig_node_id_to_new_id_map[target];
}
else
{
new_edge.source = node;
new_edge.target = target;
}
BOOST_ASSERT_MSG(UINT_MAX != new_edge.source, "Source id invalid");
BOOST_ASSERT_MSG(UINT_MAX != new_edge.target, "Target id invalid");
new_edge.data.distance = data.distance;
new_edge.data.shortcut = data.shortcut;
if (!data.is_original_via_node_ID && !orig_node_id_to_new_id_map.empty())
{
new_edge.data.id = orig_node_id_to_new_id_map[data.id];
}
else
{
new_edge.data.id = data.id;
}
BOOST_ASSERT_MSG(new_edge.data.id != INT_MAX, // 2^31
"edge id invalid");
new_edge.data.forward = data.forward;
new_edge.data.backward = data.backward;
edges.push_back(new_edge);
}
}
}
contractor_graph.reset();
orig_node_id_to_new_id_map.clear();
orig_node_id_to_new_id_map.shrink_to_fit();
BOOST_ASSERT(0 == orig_node_id_to_new_id_map.capacity());
TemporaryStorage &temporary_storage = TemporaryStorage::GetInstance();
// loads edges of graph before renumbering, no need for further numbering action.
NodeID start;
NodeID target;
ContractorGraph::EdgeData data;
Edge restored_edge;
for (unsigned i = 0; i < temp_edge_counter; ++i)
{
temporary_storage.ReadFromSlot(edge_storage_slot, (char *)&start, sizeof(NodeID));
temporary_storage.ReadFromSlot(edge_storage_slot, (char *)&target, sizeof(NodeID));
temporary_storage.ReadFromSlot(
edge_storage_slot, (char *)&data, sizeof(ContractorGraph::EdgeData));
restored_edge.source = start;
restored_edge.target = target;
restored_edge.data.distance = data.distance;
restored_edge.data.shortcut = data.shortcut;
restored_edge.data.id = data.id;
restored_edge.data.forward = data.forward;
restored_edge.data.backward = data.backward;
edges.push_back(restored_edge);
}
temporary_storage.DeallocateSlot(edge_storage_slot);
}
private:
inline void Dijkstra(const int max_distance,
const unsigned number_of_targets,
const int maxNodes,
ContractorThreadData *const data,
const NodeID middleNode)
{
ContractorHeap &heap = data->heap;
int nodes = 0;
unsigned number_of_targets_found = 0;
while (heap.Size() > 0)
{
const NodeID node = heap.DeleteMin();
const int distance = heap.GetKey(node);
const short current_hop = heap.GetData(node).hop + 1;
if (++nodes > maxNodes)
{
return;
}
// Destination settled?
if (distance > max_distance)
{
return;
}
if (heap.GetData(node).target)
{
++number_of_targets_found;
if (number_of_targets_found >= number_of_targets)
{
return;
}
}
// iterate over all edges of node
for (auto edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &data = contractor_graph->GetEdgeData(edge);
if (!data.forward)
{
continue;
}
const NodeID to = contractor_graph->GetTarget(edge);
if (middleNode == to)
{
continue;
}
const int to_distance = distance + data.distance;
// New Node discovered -> Add to Heap + Node Info Storage
if (!heap.WasInserted(to))
{
heap.Insert(to, to_distance, ContractorHeapData(current_hop, false));
}
// Found a shorter Path -> Update distance
else if (to_distance < heap.GetKey(to))
{
heap.DecreaseKey(to, to_distance);
heap.GetData(to).hop = current_hop;
}
}
}
}
inline float EvaluateNodePriority(ContractorThreadData *const data,
NodePriorityData *const node_data,
const NodeID node)
{
ContractionStats stats;
// perform simulated contraction
ContractNode<true>(data, node, &stats);
// Result will contain the priority
float result;
if (0 == (stats.edges_deleted_count * stats.original_edges_deleted_count))
{
result = 1 * node_data->depth;
}
else
{
result = 2 * (((float)stats.edges_added_count) / stats.edges_deleted_count) +
4 * (((float)stats.original_edges_added_count) /
stats.original_edges_deleted_count) +
1 * node_data->depth;
}
BOOST_ASSERT(result >= 0);
return result;
}
template <bool RUNSIMULATION>
inline bool
ContractNode(ContractorThreadData *data, NodeID node, ContractionStats *stats = NULL)
{
ContractorHeap &heap = data->heap;
int inserted_edges_size = data->inserted_edges.size();
std::vector<ContractorEdge> &inserted_edges = data->inserted_edges;
for (auto in_edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &in_data = contractor_graph->GetEdgeData(in_edge);
const NodeID source = contractor_graph->GetTarget(in_edge);
if (RUNSIMULATION)
{
BOOST_ASSERT(stats != NULL);
++stats->edges_deleted_count;
stats->original_edges_deleted_count += in_data.originalEdges;
}
if (!in_data.backward)
{
continue;
}
heap.Clear();
heap.Insert(source, 0, ContractorHeapData());
int max_distance = 0;
unsigned number_of_targets = 0;
for (auto out_edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &out_data = contractor_graph->GetEdgeData(out_edge);
if (!out_data.forward)
{
continue;
}
const NodeID target = contractor_graph->GetTarget(out_edge);
const int path_distance = in_data.distance + out_data.distance;
max_distance = std::max(max_distance, path_distance);
if (!heap.WasInserted(target))
{
heap.Insert(target, INT_MAX, ContractorHeapData(0, true));
++number_of_targets;
}
}
if (RUNSIMULATION)
{
Dijkstra(max_distance, number_of_targets, 1000, data, node);
}
else
{
Dijkstra(max_distance, number_of_targets, 2000, data, node);
}
for (auto out_edge : contractor_graph->GetAdjacentEdgeRange(node))
{
const ContractorEdgeData &out_data = contractor_graph->GetEdgeData(out_edge);
if (!out_data.forward)
{
continue;
}
const NodeID target = contractor_graph->GetTarget(out_edge);
const int path_distance = in_data.distance + out_data.distance;
const int distance = heap.GetKey(target);
if (path_distance < distance)
{
if (RUNSIMULATION)
{
BOOST_ASSERT(stats != NULL);
stats->edges_added_count += 2;
stats->original_edges_added_count +=
2 * (out_data.originalEdges + in_data.originalEdges);
}
else
{
ContractorEdge new_edge;
new_edge.source = source;
new_edge.target = target;
new_edge.data =
ContractorEdgeData(path_distance,
out_data.originalEdges + in_data.originalEdges,
node /*, 0, in_data.turnInstruction*/,
true,
true,
false);
;
inserted_edges.push_back(new_edge);
std::swap(new_edge.source, new_edge.target);
new_edge.data.forward = false;
new_edge.data.backward = true;
inserted_edges.push_back(new_edge);
}
}
}
}
if (!RUNSIMULATION)
{
int iend = inserted_edges.size();
for (int i = inserted_edges_size; i < iend; ++i)
{
bool found = false;
for (int other = i + 1; other < iend; ++other)
{
if (inserted_edges[other].source != inserted_edges[i].source)
{
continue;
}
if (inserted_edges[other].target != inserted_edges[i].target)
{
continue;
}
if (inserted_edges[other].data.distance != inserted_edges[i].data.distance)
{
continue;
}
if (inserted_edges[other].data.shortcut != inserted_edges[i].data.shortcut)
{
continue;
}
inserted_edges[other].data.forward |= inserted_edges[i].data.forward;
inserted_edges[other].data.backward |= inserted_edges[i].data.backward;
found = true;
break;
}
if (!found)
{
inserted_edges[inserted_edges_size++] = inserted_edges[i];
}
}
inserted_edges.resize(inserted_edges_size);
}
return true;
}
inline void DeleteIncomingEdges(ContractorThreadData *data, const NodeID node)
{
std::vector<NodeID> &neighbours = data->neighbours;
neighbours.clear();
// find all neighbours
for (auto e : contractor_graph->GetAdjacentEdgeRange(node))
{
const NodeID u = contractor_graph->GetTarget(e);
if (u != node)
{
neighbours.push_back(u);
}
}
// eliminate duplicate entries ( forward + backward edges )
std::sort(neighbours.begin(), neighbours.end());
neighbours.resize(std::unique(neighbours.begin(), neighbours.end()) - neighbours.begin());
for (int i = 0, e = (int)neighbours.size(); i < e; ++i)
{
contractor_graph->DeleteEdgesTo(neighbours[i], node);
}
}
inline bool UpdateNodeNeighbours(std::vector<float> &priorities,
std::vector<NodePriorityData> &node_data,
ContractorThreadData *const data,
const NodeID node)
{
std::vector<NodeID> &neighbours = data->neighbours;
neighbours.clear();
// find all neighbours
for (auto e : contractor_graph->GetAdjacentEdgeRange(node))
{
const NodeID u = contractor_graph->GetTarget(e);
if (u == node)
{
continue;
}
neighbours.push_back(u);
node_data[u].depth = (std::max)(node_data[node].depth + 1, node_data[u].depth);
}
// eliminate duplicate entries ( forward + backward edges )
std::sort(neighbours.begin(), neighbours.end());
neighbours.resize(std::unique(neighbours.begin(), neighbours.end()) - neighbours.begin());
// re-evaluate priorities of neighboring nodes
for (const NodeID u : neighbours)
{
priorities[u] = EvaluateNodePriority(data, &(node_data)[u], u);
}
return true;
}
inline bool IsNodeIndependent(
const std::vector<float> &priorities /*, const std::vector< NodePriorityData >& node_data*/,
ContractorThreadData *const data,
NodeID node) const
{
const float priority = priorities[node];
std::vector<NodeID> &neighbours = data->neighbours;
neighbours.clear();
for (auto e : contractor_graph->GetAdjacentEdgeRange(node))
{
const NodeID target = contractor_graph->GetTarget(e);
if (node == target)
{
continue;
}
const float target_priority = priorities[target];
BOOST_ASSERT(target_priority >= 0);
// found a neighbour with lower priority?
if (priority > target_priority)
{
return false;
}
// tie breaking
if (std::abs(priority - target_priority) < std::numeric_limits<float>::epsilon() &&
bias(node, target))
{
return false;
}
neighbours.push_back(target);
}
std::sort(neighbours.begin(), neighbours.end());
neighbours.resize(std::unique(neighbours.begin(), neighbours.end()) - neighbours.begin());
// examine all neighbours that are at most 2 hops away
for (const NodeID u : neighbours)
{
for (auto e : contractor_graph->GetAdjacentEdgeRange(u))
{
const NodeID target = contractor_graph->GetTarget(e);
if (node == target)
{
continue;
}
const float target_priority = priorities[target];
assert(target_priority >= 0);
// found a neighbour with lower priority?
if (priority > target_priority)
{
return false;
}
// tie breaking
if (std::abs(priority - target_priority) < std::numeric_limits<float>::epsilon() &&
bias(node, target))
{
return false;
}
}
}
return true;
}
// This bias function takes up 22 assembly instructions in total on X86
inline bool bias(const NodeID a, const NodeID b) const
{
unsigned short hasha = fast_hash(a);
unsigned short hashb = fast_hash(b);
// The compiler optimizes that to conditional register flags but without branching
// statements!
if (hasha != hashb)
{
return hasha < hashb;
}
return a < b;
}
std::shared_ptr<ContractorGraph> contractor_graph;
std::vector<ContractorGraph::InputEdge> contracted_edge_list;
unsigned edge_storage_slot;
uint64_t temp_edge_counter;
std::vector<NodeID> orig_node_id_to_new_id_map;
XORFastHash fast_hash;
};
#endif // CONTRACTOR_H

View File

@ -1,775 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "EdgeBasedGraphFactory.h"
#include "../Algorithms/BFSComponentExplorer.h"
#include "../DataStructures/Percent.h"
#include "../Util/ComputeAngle.h"
#include "../Util/LuaUtil.h"
#include "../Util/SimpleLogger.h"
#include "../Util/TimingUtil.h"
#include <boost/assert.hpp>
#include <fstream>
#include <limits>
EdgeBasedGraphFactory::EdgeBasedGraphFactory(
const std::shared_ptr<NodeBasedDynamicGraph> &node_based_graph,
std::unique_ptr<RestrictionMap> restriction_map,
std::vector<NodeID> &barrier_node_list,
std::vector<NodeID> &traffic_light_node_list,
std::vector<NodeInfo> &m_node_info_list,
SpeedProfileProperties &speed_profile)
: speed_profile(speed_profile),
m_number_of_edge_based_nodes(std::numeric_limits<unsigned>::max()),
m_node_info_list(m_node_info_list), m_node_based_graph(node_based_graph),
m_restriction_map(std::move(restriction_map)), max_id(0)
{
// insert into unordered sets for fast lookup
m_barrier_nodes.insert(barrier_node_list.begin(), barrier_node_list.end());
m_traffic_lights.insert(traffic_light_node_list.begin(), traffic_light_node_list.end());
}
void EdgeBasedGraphFactory::GetEdgeBasedEdges(DeallocatingVector<EdgeBasedEdge> &output_edge_list)
{
BOOST_ASSERT_MSG(0 == output_edge_list.size(), "Vector is not empty");
m_edge_based_edge_list.swap(output_edge_list);
}
void EdgeBasedGraphFactory::GetEdgeBasedNodes(std::vector<EdgeBasedNode> &nodes)
{
#ifndef NDEBUG
for (const EdgeBasedNode &node : m_edge_based_node_list)
{
BOOST_ASSERT(m_node_info_list.at(node.u).lat != INT_MAX);
BOOST_ASSERT(m_node_info_list.at(node.u).lon != INT_MAX);
BOOST_ASSERT(m_node_info_list.at(node.v).lon != INT_MAX);
BOOST_ASSERT(m_node_info_list.at(node.v).lat != INT_MAX);
}
#endif
nodes.swap(m_edge_based_node_list);
}
void
EdgeBasedGraphFactory::InsertEdgeBasedNode(NodeID u, NodeID v, EdgeID e1, bool belongs_to_tiny_cc)
{
// merge edges together into one EdgeBasedNode
BOOST_ASSERT(u != SPECIAL_NODEID);
BOOST_ASSERT(v != SPECIAL_NODEID);
BOOST_ASSERT(e1 != SPECIAL_EDGEID);
#ifndef NDEBUG
// find forward edge id and
const EdgeID e1b = m_node_based_graph->FindEdge(u, v);
BOOST_ASSERT(e1 == e1b);
#endif
BOOST_ASSERT(e1 != SPECIAL_EDGEID);
const EdgeData &forward_data = m_node_based_graph->GetEdgeData(e1);
// find reverse edge id and
const EdgeID e2 = m_node_based_graph->FindEdge(v, u);
#ifndef NDEBUG
if (e2 == m_node_based_graph->EndEdges(v))
{
SimpleLogger().Write(logWARNING) << "Did not find edge (" << v << "," << u << ")";
}
#endif
BOOST_ASSERT(e2 != SPECIAL_EDGEID);
BOOST_ASSERT(e2 < m_node_based_graph->EndEdges(v));
const EdgeData &reverse_data = m_node_based_graph->GetEdgeData(e2);
if (forward_data.edgeBasedNodeID == SPECIAL_NODEID &&
reverse_data.edgeBasedNodeID == SPECIAL_NODEID)
{
return;
}
BOOST_ASSERT(m_geometry_compressor.HasEntryForID(e1) ==
m_geometry_compressor.HasEntryForID(e2));
if (m_geometry_compressor.HasEntryForID(e1))
{
BOOST_ASSERT(m_geometry_compressor.HasEntryForID(e2));
// reconstruct geometry and put in each individual edge with its offset
const std::vector<GeometryCompressor::CompressedNode> &forward_geometry =
m_geometry_compressor.GetBucketReference(e1);
const std::vector<GeometryCompressor::CompressedNode> &reverse_geometry =
m_geometry_compressor.GetBucketReference(e2);
BOOST_ASSERT(forward_geometry.size() == reverse_geometry.size());
BOOST_ASSERT(0 != forward_geometry.size());
// reconstruct bidirectional edge with individual weights and put each into the NN index
std::vector<int> forward_dist_prefix_sum(forward_geometry.size(), 0);
std::vector<int> reverse_dist_prefix_sum(reverse_geometry.size(), 0);
// quick'n'dirty prefix sum as std::partial_sum needs addtional casts
// TODO: move to lambda function with C++11
int temp_sum = 0;
for (unsigned i = 0; i < forward_geometry.size(); ++i)
{
forward_dist_prefix_sum[i] = temp_sum;
temp_sum += forward_geometry[i].second;
BOOST_ASSERT(forward_data.distance >= temp_sum);
}
temp_sum = 0;
for (unsigned i = 0; i < reverse_geometry.size(); ++i)
{
temp_sum += reverse_geometry[reverse_geometry.size() - 1 - i].second;
reverse_dist_prefix_sum[i] = reverse_data.distance - temp_sum;
BOOST_ASSERT(reverse_data.distance >= temp_sum);
}
BOOST_ASSERT(forward_geometry.size() == reverse_geometry.size());
const unsigned geometry_size = forward_geometry.size();
BOOST_ASSERT(geometry_size > 1);
NodeID current_edge_start_coordinate_id = u;
if (forward_data.edgeBasedNodeID != SPECIAL_NODEID)
{
max_id = std::max(forward_data.edgeBasedNodeID, max_id);
}
if (SPECIAL_NODEID != reverse_data.edgeBasedNodeID)
{
max_id = std::max(reverse_data.edgeBasedNodeID, max_id);
}
// traverse arrays from start and end respectively
for (unsigned i = 0; i < geometry_size; ++i)
{
BOOST_ASSERT(current_edge_start_coordinate_id ==
reverse_geometry[geometry_size - 1 - i].first);
const NodeID current_edge_target_coordinate_id = forward_geometry[i].first;
BOOST_ASSERT(current_edge_target_coordinate_id != current_edge_start_coordinate_id);
// build edges
m_edge_based_node_list.emplace_back(forward_data.edgeBasedNodeID,
reverse_data.edgeBasedNodeID,
current_edge_start_coordinate_id,
current_edge_target_coordinate_id,
forward_data.nameID,
forward_geometry[i].second,
reverse_geometry[i].second,
forward_dist_prefix_sum[i],
reverse_dist_prefix_sum[i],
m_geometry_compressor.GetPositionForID(e1),
i,
belongs_to_tiny_cc);
current_edge_start_coordinate_id = current_edge_target_coordinate_id;
BOOST_ASSERT(m_edge_based_node_list.back().IsCompressed());
BOOST_ASSERT(u != m_edge_based_node_list.back().u ||
v != m_edge_based_node_list.back().v);
BOOST_ASSERT(u != m_edge_based_node_list.back().v ||
v != m_edge_based_node_list.back().u);
}
BOOST_ASSERT(current_edge_start_coordinate_id == v);
BOOST_ASSERT(m_edge_based_node_list.back().IsCompressed());
}
else
{
BOOST_ASSERT(!m_geometry_compressor.HasEntryForID(e2));
if (forward_data.edgeBasedNodeID != SPECIAL_NODEID)
{
BOOST_ASSERT(forward_data.forward);
}
if (reverse_data.edgeBasedNodeID != SPECIAL_NODEID)
{
BOOST_ASSERT(reverse_data.forward);
}
if (forward_data.edgeBasedNodeID == SPECIAL_NODEID)
{
BOOST_ASSERT(!forward_data.forward);
}
if (reverse_data.edgeBasedNodeID == SPECIAL_NODEID)
{
BOOST_ASSERT(!reverse_data.forward);
}
BOOST_ASSERT(forward_data.edgeBasedNodeID != SPECIAL_NODEID ||
reverse_data.edgeBasedNodeID != SPECIAL_NODEID);
m_edge_based_node_list.emplace_back(EdgeBasedNode(forward_data.edgeBasedNodeID,
reverse_data.edgeBasedNodeID,
u,
v,
forward_data.nameID,
forward_data.distance,
reverse_data.distance,
0,
0,
SPECIAL_EDGEID,
0,
belongs_to_tiny_cc));
BOOST_ASSERT(!m_edge_based_node_list.back().IsCompressed());
}
}
void EdgeBasedGraphFactory::FlushVectorToStream(
std::ofstream &edge_data_file, std::vector<OriginalEdgeData> &original_edge_data_vector) const
{
edge_data_file.write((char *)&(original_edge_data_vector[0]),
original_edge_data_vector.size() * sizeof(OriginalEdgeData));
original_edge_data_vector.clear();
}
void EdgeBasedGraphFactory::Run(const std::string &original_edge_data_filename,
const std::string &geometry_filename,
lua_State *lua_state)
{
TIMER_START(geometry);
CompressGeometry();
TIMER_STOP(geometry);
TIMER_START(renumber);
RenumberEdges();
TIMER_STOP(renumber);
TIMER_START(generate_nodes);
GenerateEdgeExpandedNodes();
TIMER_STOP(generate_nodes);
TIMER_START(generate_edges);
GenerateEdgeExpandedEdges(original_edge_data_filename, lua_state);
TIMER_STOP(generate_edges);
m_geometry_compressor.SerializeInternalVector(geometry_filename);
SimpleLogger().Write() << "Timing statistics for edge-expanded graph:";
SimpleLogger().Write() << "Geometry compression: " << TIMER_MSEC(geometry)*0.001 << "s";
SimpleLogger().Write() << "Renumbering edges: " << TIMER_MSEC(renumber)*0.001 << "s";
SimpleLogger().Write() << "Generating nodes: " << TIMER_MSEC(generate_nodes)*0.001 << "s";
SimpleLogger().Write() << "Generating edges: " << TIMER_MSEC(generate_edges)*0.001 << "s";
}
void EdgeBasedGraphFactory::CompressGeometry()
{
SimpleLogger().Write() << "Removing graph geometry while preserving topology";
const unsigned original_number_of_nodes = m_node_based_graph->GetNumberOfNodes();
const unsigned original_number_of_edges = m_node_based_graph->GetNumberOfEdges();
Percent p(original_number_of_nodes);
unsigned removed_node_count = 0;
for (NodeID v = 0; v < original_number_of_nodes; ++v)
{
p.printStatus(v);
// only contract degree 2 vertices
if (2 != m_node_based_graph->GetOutDegree(v))
{
continue;
}
// don't contract barrier node
if (m_barrier_nodes.end() != m_barrier_nodes.find(v))
{
continue;
}
// check if v is a via node for a turn restriction, i.e. a 'directed' barrier node
if (m_restriction_map->IsNodeAViaNode(v))
{
continue;
}
const bool reverse_edge_order =
!(m_node_based_graph->GetEdgeData(m_node_based_graph->BeginEdges(v)).forward);
const EdgeID forward_e2 = m_node_based_graph->BeginEdges(v) + reverse_edge_order;
BOOST_ASSERT(SPECIAL_EDGEID != forward_e2);
const EdgeID reverse_e2 = m_node_based_graph->BeginEdges(v) + 1 - reverse_edge_order;
BOOST_ASSERT(SPECIAL_EDGEID != reverse_e2);
const EdgeData &fwd_edge_data2 = m_node_based_graph->GetEdgeData(forward_e2);
const EdgeData &rev_edge_data2 = m_node_based_graph->GetEdgeData(reverse_e2);
const NodeID w = m_node_based_graph->GetTarget(forward_e2);
BOOST_ASSERT(SPECIAL_NODEID != w);
BOOST_ASSERT(v != w);
const NodeID u = m_node_based_graph->GetTarget(reverse_e2);
BOOST_ASSERT(SPECIAL_NODEID != u);
BOOST_ASSERT(u != v);
const EdgeID forward_e1 = m_node_based_graph->FindEdge(u, v);
BOOST_ASSERT(m_node_based_graph->EndEdges(u) != forward_e1);
BOOST_ASSERT(SPECIAL_EDGEID != forward_e1);
BOOST_ASSERT(v == m_node_based_graph->GetTarget(forward_e1));
const EdgeID reverse_e1 = m_node_based_graph->FindEdge(w, v);
BOOST_ASSERT(SPECIAL_EDGEID != reverse_e1);
BOOST_ASSERT(v == m_node_based_graph->GetTarget(reverse_e1));
const EdgeData &fwd_edge_data1 = m_node_based_graph->GetEdgeData(forward_e1);
const EdgeData &rev_edge_data1 = m_node_based_graph->GetEdgeData(reverse_e1);
if ((m_node_based_graph->FindEdge(u, w) != m_node_based_graph->EndEdges(u)) ||
(m_node_based_graph->FindEdge(w, u) != m_node_based_graph->EndEdges(w)))
{
continue;
}
if ( // TODO: rename to IsCompatibleTo
fwd_edge_data1.IsEqualTo(fwd_edge_data2) &&
rev_edge_data1.IsEqualTo(rev_edge_data2))
{
// Get distances before graph is modified
const int forward_weight1 = m_node_based_graph->GetEdgeData(forward_e1).distance;
const int forward_weight2 = m_node_based_graph->GetEdgeData(forward_e2).distance;
BOOST_ASSERT(0 != forward_weight1);
BOOST_ASSERT(0 != forward_weight2);
const int reverse_weight1 = m_node_based_graph->GetEdgeData(reverse_e1).distance;
const int reverse_weight2 = m_node_based_graph->GetEdgeData(reverse_e2).distance;
BOOST_ASSERT(0 != reverse_weight1);
BOOST_ASSERT(0 != forward_weight2);
const bool add_traffic_signal_penalty =
(m_traffic_lights.find(v) != m_traffic_lights.end());
// add weight of e2's to e1
m_node_based_graph->GetEdgeData(forward_e1).distance += fwd_edge_data2.distance;
m_node_based_graph->GetEdgeData(reverse_e1).distance += rev_edge_data2.distance;
if (add_traffic_signal_penalty)
{
m_node_based_graph->GetEdgeData(forward_e1).distance +=
speed_profile.trafficSignalPenalty;
m_node_based_graph->GetEdgeData(reverse_e1).distance +=
speed_profile.trafficSignalPenalty;
}
// extend e1's to targets of e2's
m_node_based_graph->SetTarget(forward_e1, w);
m_node_based_graph->SetTarget(reverse_e1, u);
// remove e2's (if bidir, otherwise only one)
m_node_based_graph->DeleteEdge(v, forward_e2);
m_node_based_graph->DeleteEdge(v, reverse_e2);
// update any involved turn restrictions
m_restriction_map->FixupStartingTurnRestriction(u, v, w);
m_restriction_map->FixupArrivingTurnRestriction(u, v, w);
m_restriction_map->FixupStartingTurnRestriction(w, v, u);
m_restriction_map->FixupArrivingTurnRestriction(w, v, u);
// store compressed geometry in container
m_geometry_compressor.CompressEdge(
forward_e1,
forward_e2,
v,
w,
forward_weight1 +
(add_traffic_signal_penalty ? speed_profile.trafficSignalPenalty : 0),
forward_weight2);
m_geometry_compressor.CompressEdge(
reverse_e1,
reverse_e2,
v,
u,
reverse_weight1,
reverse_weight2 +
(add_traffic_signal_penalty ? speed_profile.trafficSignalPenalty : 0));
++removed_node_count;
BOOST_ASSERT(m_node_based_graph->GetEdgeData(forward_e1).nameID ==
m_node_based_graph->GetEdgeData(reverse_e1).nameID);
}
}
SimpleLogger().Write() << "removed " << removed_node_count << " nodes";
m_geometry_compressor.PrintStatistics();
unsigned new_node_count = 0;
unsigned new_edge_count = 0;
for (unsigned i = 0; i < m_node_based_graph->GetNumberOfNodes(); ++i)
{
if (m_node_based_graph->GetOutDegree(i) > 0)
{
++new_node_count;
new_edge_count += (m_node_based_graph->EndEdges(i) - m_node_based_graph->BeginEdges(i));
}
}
SimpleLogger().Write() << "new nodes: " << new_node_count << ", edges " << new_edge_count;
SimpleLogger().Write() << "Node compression ratio: " << new_node_count /
(double)original_number_of_nodes;
SimpleLogger().Write() << "Edge compression ratio: " << new_edge_count /
(double)original_number_of_edges;
}
/**
* Writes the id of the edge in the edge expanded graph (into the egde in the node based graph)
*/
void EdgeBasedGraphFactory::RenumberEdges()
{
// renumber edge based node IDs
unsigned numbered_edges_count = 0;
for (NodeID current_node = 0; current_node < m_node_based_graph->GetNumberOfNodes();
++current_node)
{
for (EdgeID current_edge : m_node_based_graph->GetAdjacentEdgeRange(current_node))
{
EdgeData &edge_data = m_node_based_graph->GetEdgeData(current_edge);
if (!edge_data.forward)
{
continue;
}
BOOST_ASSERT(numbered_edges_count < m_node_based_graph->GetNumberOfEdges());
edge_data.edgeBasedNodeID = numbered_edges_count;
++numbered_edges_count;
BOOST_ASSERT(SPECIAL_NODEID != edge_data.edgeBasedNodeID);
}
}
m_number_of_edge_based_nodes = numbered_edges_count;
}
/**
* Creates the nodes in the edge expanded graph from edges in the node-based graph.
*/
void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes()
{
SimpleLogger().Write() << "Identifying components of the road network";
// Run a BFS on the undirected graph and identify small components
BFSComponentExplorer<NodeBasedDynamicGraph> component_explorer(
*m_node_based_graph, *m_restriction_map, m_barrier_nodes);
component_explorer.run();
SimpleLogger().Write() << "identified: " << component_explorer.GetNumberOfComponents()
<< " many components";
SimpleLogger().Write() << "generating edge-expanded nodes";
Percent p(m_node_based_graph->GetNumberOfNodes());
// loop over all edges and generate new set of nodes
for (NodeID u = 0, end = m_node_based_graph->GetNumberOfNodes(); u < end; ++u)
{
BOOST_ASSERT(u != SPECIAL_NODEID);
BOOST_ASSERT(u < m_node_based_graph->GetNumberOfNodes());
p.printIncrement();
for (EdgeID e1 : m_node_based_graph->GetAdjacentEdgeRange(u))
{
const EdgeData &edge_data = m_node_based_graph->GetEdgeData(e1);
if (edge_data.edgeBasedNodeID == SPECIAL_NODEID)
{
// continue;
}
BOOST_ASSERT(e1 != SPECIAL_EDGEID);
const NodeID v = m_node_based_graph->GetTarget(e1);
BOOST_ASSERT(SPECIAL_NODEID != v);
// pick only every other edge
if (u > v)
{
continue;
}
BOOST_ASSERT(u < v);
BOOST_ASSERT(edge_data.type != SHRT_MAX);
// Note: edges that end on barrier nodes or on a turn restriction
// may actually be in two distinct components. We choose the smallest
const unsigned size_of_component = std::min(component_explorer.GetComponentSize(u),
component_explorer.GetComponentSize(v));
const bool component_is_tiny = (size_of_component < 1000);
InsertEdgeBasedNode(u, v, e1, component_is_tiny);
}
}
SimpleLogger().Write() << "Generated " << m_edge_based_node_list.size()
<< " nodes in edge-expanded graph";
}
/**
* Actually it also generates OriginalEdgeData and serializes them...
*/
void
EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(const std::string &original_edge_data_filename,
lua_State *lua_state)
{
SimpleLogger().Write() << "generating edge-expanded edges";
unsigned node_based_edge_counter = 0;
unsigned original_edges_counter = 0;
std::ofstream edge_data_file(original_edge_data_filename.c_str(), std::ios::binary);
// writes a dummy value that is updated later
edge_data_file.write((char *)&original_edges_counter, sizeof(unsigned));
std::vector<OriginalEdgeData> original_edge_data_vector;
original_edge_data_vector.reserve(1024 * 1024);
// Loop over all turns and generate new set of edges.
// Three nested loop look super-linear, but we are dealing with a (kind of)
// linear number of turns only.
unsigned restricted_turns_counter = 0;
unsigned skipped_uturns_counter = 0;
unsigned skipped_barrier_turns_counter = 0;
unsigned compressed = 0;
Percent p(m_node_based_graph->GetNumberOfNodes());
for (NodeID u = 0, end = m_node_based_graph->GetNumberOfNodes(); u < end; ++u)
{
for (EdgeID e1 : m_node_based_graph->GetAdjacentEdgeRange(u))
{
if (!m_node_based_graph->GetEdgeData(e1).forward)
{
continue;
}
++node_based_edge_counter;
const NodeID v = m_node_based_graph->GetTarget(e1);
const NodeID to_node_of_only_restriction =
m_restriction_map->CheckForEmanatingIsOnlyTurn(u, v);
const bool is_barrier_node = (m_barrier_nodes.find(v) != m_barrier_nodes.end());
for (EdgeID e2 : m_node_based_graph->GetAdjacentEdgeRange(v))
{
if (!m_node_based_graph->GetEdgeData(e2).forward)
{
continue;
}
const NodeID w = m_node_based_graph->GetTarget(e2);
if ((to_node_of_only_restriction != SPECIAL_NODEID) &&
(w != to_node_of_only_restriction))
{
// We are at an only_-restriction but not at the right turn.
++restricted_turns_counter;
continue;
}
if (is_barrier_node)
{
if (u != w)
{
++skipped_barrier_turns_counter;
continue;
}
}
else
{
if ((u == w) && (m_node_based_graph->GetOutDegree(v) > 1))
{
++skipped_uturns_counter;
continue;
}
}
// only add an edge if turn is not a U-turn except when it is
// at the end of a dead-end street
if (m_restriction_map->CheckIfTurnIsRestricted(u, v, w) &&
(to_node_of_only_restriction == SPECIAL_NODEID) &&
(w != to_node_of_only_restriction))
{
++restricted_turns_counter;
continue;
}
// only add an edge if turn is not prohibited
const EdgeData &edge_data1 = m_node_based_graph->GetEdgeData(e1);
const EdgeData &edge_data2 = m_node_based_graph->GetEdgeData(e2);
BOOST_ASSERT(edge_data1.edgeBasedNodeID != edge_data2.edgeBasedNodeID);
BOOST_ASSERT(edge_data1.forward);
BOOST_ASSERT(edge_data2.forward);
// the following is the core of the loop.
unsigned distance = edge_data1.distance;
if (m_traffic_lights.find(v) != m_traffic_lights.end())
{
distance += speed_profile.trafficSignalPenalty;
}
const double angle = GetAngleBetweenThreeFixedPointCoordinates(
m_node_info_list[u], m_node_info_list[v], m_node_info_list[w]);
const int turn_penalty = GetTurnPenalty(angle, lua_state);
TurnInstruction turn_instruction = AnalyzeTurn(u, v, w, angle);
if (turn_instruction == TurnInstruction::UTurn)
{
distance += speed_profile.uTurnPenalty;
}
distance += turn_penalty;
const bool edge_is_compressed = m_geometry_compressor.HasEntryForID(e1);
if (edge_is_compressed)
{
++compressed;
}
original_edge_data_vector.emplace_back(
(edge_is_compressed ? m_geometry_compressor.GetPositionForID(e1) : v),
edge_data1.nameID,
turn_instruction,
edge_is_compressed);
++original_edges_counter;
if (original_edge_data_vector.size() > 1024 * 1024 * 10)
{
FlushVectorToStream(edge_data_file, original_edge_data_vector);
}
BOOST_ASSERT(SPECIAL_NODEID != edge_data1.edgeBasedNodeID);
BOOST_ASSERT(SPECIAL_NODEID != edge_data2.edgeBasedNodeID);
m_edge_based_edge_list.emplace_back(EdgeBasedEdge(edge_data1.edgeBasedNodeID,
edge_data2.edgeBasedNodeID,
m_edge_based_edge_list.size(),
distance,
true,
false));
}
}
p.printIncrement();
}
FlushVectorToStream(edge_data_file, original_edge_data_vector);
edge_data_file.seekp(std::ios::beg);
edge_data_file.write((char *)&original_edges_counter, sizeof(unsigned));
edge_data_file.close();
SimpleLogger().Write() << "Generated " << m_edge_based_node_list.size() << " edge based nodes";
SimpleLogger().Write() << "Node-based graph contains " << node_based_edge_counter << " edges";
SimpleLogger().Write() << "Edge-expanded graph ...";
SimpleLogger().Write() << " contains " << m_edge_based_edge_list.size() << " edges";
SimpleLogger().Write() << " skips " << restricted_turns_counter << " turns, "
"defined by "
<< m_restriction_map->size() << " restrictions";
SimpleLogger().Write() << " skips " << skipped_uturns_counter << " U turns";
SimpleLogger().Write() << " skips " << skipped_barrier_turns_counter << " turns over barriers";
}
int EdgeBasedGraphFactory::GetTurnPenalty(double angle, lua_State *lua_state) const
{
if (speed_profile.has_turn_penalty_function)
{
try
{
// call lua profile to compute turn penalty
return luabind::call_function<int>(lua_state, "turn_function", 180. - angle);
}
catch (const luabind::error &er) { SimpleLogger().Write(logWARNING) << er.what(); }
}
return 0;
}
TurnInstruction EdgeBasedGraphFactory::AnalyzeTurn(const NodeID u,
const NodeID v,
const NodeID w,
double angle)
const
{
if (u == w)
{
return TurnInstruction::UTurn;
}
const EdgeID edge1 = m_node_based_graph->FindEdge(u, v);
const EdgeID edge2 = m_node_based_graph->FindEdge(v, w);
const EdgeData &data1 = m_node_based_graph->GetEdgeData(edge1);
const EdgeData &data2 = m_node_based_graph->GetEdgeData(edge2);
if (!data1.contraFlow && data2.contraFlow)
{
return TurnInstruction::EnterAgainstAllowedDirection;
}
if (data1.contraFlow && !data2.contraFlow)
{
return TurnInstruction::LeaveAgainstAllowedDirection;
}
// roundabouts need to be handled explicitely
if (data1.roundabout && data2.roundabout)
{
// Is a turn possible? If yes, we stay on the roundabout!
if (1 == m_node_based_graph->GetDirectedOutDegree(v))
{
// No turn possible.
return TurnInstruction::NoTurn;
}
return TurnInstruction::StayOnRoundAbout;
}
// Does turn start or end on roundabout?
if (data1.roundabout || data2.roundabout)
{
// We are entering the roundabout
if ((!data1.roundabout) && data2.roundabout)
{
return TurnInstruction::EnterRoundAbout;
}
// We are leaving the roundabout
if (data1.roundabout && (!data2.roundabout))
{
return TurnInstruction::LeaveRoundAbout;
}
}
// If street names stay the same and if we are certain that it is not a
// a segment of a roundabout, we skip it.
if (data1.nameID == data2.nameID)
{
// TODO: Here we should also do a small graph exploration to check for
// more complex situations
if (0 != data1.nameID)
{
return TurnInstruction::NoTurn;
}
else if (m_node_based_graph->GetOutDegree(v) <= 2)
{
return TurnInstruction::NoTurn;
}
}
return TurnInstructionsClass::GetTurnDirectionOfInstruction(angle);
}
unsigned EdgeBasedGraphFactory::GetNumberOfEdgeBasedNodes() const
{
return m_number_of_edge_based_nodes;
}

View File

@ -1,128 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// This class constructs the edge-expanded routing graph
#ifndef EDGEBASEDGRAPHFACTORY_H_
#define EDGEBASEDGRAPHFACTORY_H_
#include "../typedefs.h"
#include "../DataStructures/DeallocatingVector.h"
#include "../DataStructures/DynamicGraph.h"
#include "../DataStructures/EdgeBasedNode.h"
#include "../DataStructures/OriginalEdgeData.h"
#include "../DataStructures/QueryNode.h"
#include "../DataStructures/TurnInstructions.h"
#include "../DataStructures/Restriction.h"
#include "../DataStructures/NodeBasedGraph.h"
#include "../DataStructures/RestrictionMap.h"
#include "GeometryCompressor.h"
#include <algorithm>
#include <iosfwd>
#include <memory>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
struct lua_State;
class EdgeBasedGraphFactory
{
public:
EdgeBasedGraphFactory() = delete;
EdgeBasedGraphFactory(const EdgeBasedGraphFactory &) = delete;
struct SpeedProfileProperties;
explicit EdgeBasedGraphFactory(const std::shared_ptr<NodeBasedDynamicGraph> &node_based_graph,
std::unique_ptr<RestrictionMap> restricion_map,
std::vector<NodeID> &barrier_node_list,
std::vector<NodeID> &traffic_light_node_list,
std::vector<NodeInfo> &m_node_info_list,
SpeedProfileProperties &speed_profile);
void Run(const std::string &original_edge_data_filename,
const std::string &geometry_filename,
lua_State *lua_state);
void GetEdgeBasedEdges(DeallocatingVector<EdgeBasedEdge> &edges);
void GetEdgeBasedNodes(std::vector<EdgeBasedNode> &nodes);
TurnInstruction AnalyzeTurn(const NodeID u, const NodeID v, const NodeID w, double angle) const;
int GetTurnPenalty(double angle, lua_State *lua_state) const;
unsigned GetNumberOfEdgeBasedNodes() const;
struct SpeedProfileProperties
{
SpeedProfileProperties()
: trafficSignalPenalty(0), uTurnPenalty(0), has_turn_penalty_function(false)
{
}
int trafficSignalPenalty;
int uTurnPenalty;
bool has_turn_penalty_function;
} speed_profile;
private:
typedef NodeBasedDynamicGraph::EdgeData EdgeData;
unsigned m_number_of_edge_based_nodes;
std::vector<NodeInfo> m_node_info_list;
std::vector<EdgeBasedNode> m_edge_based_node_list;
DeallocatingVector<EdgeBasedEdge> m_edge_based_edge_list;
std::shared_ptr<NodeBasedDynamicGraph> m_node_based_graph;
std::unordered_set<NodeID> m_barrier_nodes;
std::unordered_set<NodeID> m_traffic_lights;
std::unique_ptr<RestrictionMap> m_restriction_map;
GeometryCompressor m_geometry_compressor;
void CompressGeometry();
void RenumberEdges();
void GenerateEdgeExpandedNodes();
void GenerateEdgeExpandedEdges(const std::string &original_edge_data_filename,
lua_State *lua_state);
void InsertEdgeBasedNode(NodeID u, NodeID v, EdgeID e1, bool belongsToTinyComponent);
void FlushVectorToStream(std::ofstream &edge_data_file,
std::vector<OriginalEdgeData> &original_edge_data_vector) const;
unsigned max_id;
};
#endif /* EDGEBASEDGRAPHFACTORY_H_ */

View File

@ -1,225 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "GeometryCompressor.h"
#include "../Util/SimpleLogger.h"
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <limits>
#include <string>
int current_free_list_maximum = 0;
int UniqueNumber() { return ++current_free_list_maximum; }
GeometryCompressor::GeometryCompressor()
{
m_free_list.reserve(100);
IncreaseFreeList();
}
void GeometryCompressor::IncreaseFreeList()
{
m_compressed_geometries.resize(m_compressed_geometries.size() + 100);
for (unsigned i = 100; i > 0; --i)
{
m_free_list.emplace_back(current_free_list_maximum);
++current_free_list_maximum;
}
}
bool GeometryCompressor::HasEntryForID(const EdgeID edge_id) const
{
return (m_edge_id_to_list_index_map.find(edge_id) != m_edge_id_to_list_index_map.end());
}
unsigned GeometryCompressor::GetPositionForID(const EdgeID edge_id) const
{
auto map_iterator = m_edge_id_to_list_index_map.find(edge_id);
BOOST_ASSERT(map_iterator != m_edge_id_to_list_index_map.end());
BOOST_ASSERT(map_iterator->second < m_compressed_geometries.size());
return map_iterator->second;
}
void GeometryCompressor::SerializeInternalVector(const std::string &path) const
{
boost::filesystem::fstream geometry_out_stream(path, std::ios::binary | std::ios::out);
const unsigned number_of_compressed_geometries = m_compressed_geometries.size() + 1;
BOOST_ASSERT(std::numeric_limits<unsigned>::max() != number_of_compressed_geometries);
geometry_out_stream.write((char *)&number_of_compressed_geometries, sizeof(unsigned));
// write indices array
unsigned prefix_sum_of_list_indices = 0;
for (const auto &elem : m_compressed_geometries)
{
geometry_out_stream.write((char *)&prefix_sum_of_list_indices, sizeof(unsigned));
const std::vector<CompressedNode> &current_vector = elem;
const unsigned unpacked_size = current_vector.size();
BOOST_ASSERT(std::numeric_limits<unsigned>::max() != unpacked_size);
prefix_sum_of_list_indices += unpacked_size;
}
// sentinel element
geometry_out_stream.write((char *)&prefix_sum_of_list_indices, sizeof(unsigned));
// number of geometry entries to follow, it is the (inclusive) prefix sum
geometry_out_stream.write((char *)&prefix_sum_of_list_indices, sizeof(unsigned));
unsigned control_sum = 0;
// write compressed geometries
for (auto &elem : m_compressed_geometries)
{
const std::vector<CompressedNode> &current_vector = elem;
const unsigned unpacked_size = current_vector.size();
control_sum += unpacked_size;
BOOST_ASSERT(std::numeric_limits<unsigned>::max() != unpacked_size);
for (const CompressedNode current_node : current_vector)
{
geometry_out_stream.write((char *)&(current_node.first), sizeof(NodeID));
}
}
BOOST_ASSERT(control_sum == prefix_sum_of_list_indices);
// all done, let's close the resource
geometry_out_stream.close();
}
void GeometryCompressor::CompressEdge(const EdgeID edge_id_1,
const EdgeID edge_id_2,
const NodeID via_node_id,
const NodeID target_node_id,
const EdgeWeight weight1,
const EdgeWeight weight2)
{
// remove super-trivial geometries
BOOST_ASSERT(SPECIAL_EDGEID != edge_id_1);
BOOST_ASSERT(SPECIAL_EDGEID != edge_id_2);
BOOST_ASSERT(SPECIAL_NODEID != via_node_id);
BOOST_ASSERT(SPECIAL_NODEID != target_node_id);
BOOST_ASSERT(INVALID_EDGE_WEIGHT != weight1);
BOOST_ASSERT(INVALID_EDGE_WEIGHT != weight2);
// append list of removed edge_id plus via node to surviving edge id:
// <surv_1, .. , surv_n, via_node_id, rem_1, .. rem_n
//
// General scheme:
// 1. append via node id to list of edge_id_1
// 2. find list for edge_id_2, if yes add all elements and delete it
// Add via node id. List is created if it does not exist
if (!HasEntryForID(edge_id_1))
{
// create a new entry in the map
if (0 == m_free_list.size())
{
// make sure there is a place to put the entries
IncreaseFreeList();
}
BOOST_ASSERT(!m_free_list.empty());
m_edge_id_to_list_index_map[edge_id_1] = m_free_list.back();
m_free_list.pop_back();
}
const auto iter = m_edge_id_to_list_index_map.find(edge_id_1);
BOOST_ASSERT(iter != m_edge_id_to_list_index_map.end());
const unsigned edge_bucket_id1 = iter->second;
BOOST_ASSERT(edge_bucket_id1 == GetPositionForID(edge_id_1));
BOOST_ASSERT(edge_bucket_id1 < m_compressed_geometries.size());
std::vector<CompressedNode> &edge_bucket_list1 = m_compressed_geometries[edge_bucket_id1];
if (edge_bucket_list1.empty())
{
edge_bucket_list1.emplace_back(via_node_id, weight1);
}
BOOST_ASSERT(0 < edge_bucket_list1.size());
BOOST_ASSERT(!edge_bucket_list1.empty());
if (HasEntryForID(edge_id_2))
{
// second edge is not atomic anymore
const unsigned list_to_remove_index = GetPositionForID(edge_id_2);
BOOST_ASSERT(list_to_remove_index < m_compressed_geometries.size());
std::vector<CompressedNode> &edge_bucket_list2 =
m_compressed_geometries[list_to_remove_index];
// found an existing list, append it to the list of edge_id_1
edge_bucket_list1.insert(
edge_bucket_list1.end(), edge_bucket_list2.begin(), edge_bucket_list2.end());
// remove the list of edge_id_2
m_edge_id_to_list_index_map.erase(edge_id_2);
BOOST_ASSERT(m_edge_id_to_list_index_map.end() ==
m_edge_id_to_list_index_map.find(edge_id_2));
edge_bucket_list2.clear();
BOOST_ASSERT(0 == edge_bucket_list2.size());
m_free_list.emplace_back(list_to_remove_index);
BOOST_ASSERT(list_to_remove_index == m_free_list.back());
}
else
{
// we are certain that the second edge is atomic.
edge_bucket_list1.emplace_back(target_node_id, weight2);
}
}
void GeometryCompressor::PrintStatistics() const
{
const uint64_t compressed_edges = m_compressed_geometries.size();
BOOST_ASSERT(0 == compressed_edges % 2);
BOOST_ASSERT(m_compressed_geometries.size() + m_free_list.size() > 0);
uint64_t number_of_compressed_geometries = 0;
uint64_t longest_chain_length = 0;
for (const std::vector<CompressedNode> &current_vector : m_compressed_geometries)
{
number_of_compressed_geometries += current_vector.size();
longest_chain_length = std::max(longest_chain_length, (uint64_t)current_vector.size());
}
SimpleLogger().Write() << "Geometry successfully removed:"
"\n compressed edges: " << compressed_edges
<< "\n compressed geometries: " << number_of_compressed_geometries
<< "\n longest chain length: " << longest_chain_length
<< "\n cmpr ratio: "
<< ((float)compressed_edges /
std::max(number_of_compressed_geometries, (uint64_t)1))
<< "\n avg chain length: "
<< (float)number_of_compressed_geometries /
std::max((uint64_t)1, compressed_edges);
}
const std::vector<GeometryCompressor::CompressedNode> &
GeometryCompressor::GetBucketReference(const EdgeID edge_id) const
{
const unsigned index = m_edge_id_to_list_index_map.at(edge_id);
return m_compressed_geometries.at(index);
}

View File

@ -1,65 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "../typedefs.h"
#include <unordered_map>
#include <string>
#include <vector>
#ifndef GEOMETRY_COMPRESSOR_H
#define GEOMETRY_COMPRESSOR_H
class GeometryCompressor
{
public:
typedef std::pair<NodeID, EdgeWeight> CompressedNode;
GeometryCompressor();
void CompressEdge(const EdgeID surviving_edge_id,
const EdgeID removed_edge_id,
const NodeID via_node_id,
const NodeID target_node,
const EdgeWeight weight1,
const EdgeWeight weight2);
bool HasEntryForID(const EdgeID edge_id) const;
void PrintStatistics() const;
void SerializeInternalVector(const std::string &path) const;
unsigned GetPositionForID(const EdgeID edge_id) const;
const std::vector<GeometryCompressor::CompressedNode> &
GetBucketReference(const EdgeID edge_id) const;
private:
void IncreaseFreeList();
std::vector<std::vector<CompressedNode>> m_compressed_geometries;
std::vector<unsigned> m_free_list;
std::unordered_map<EdgeID, unsigned> m_edge_id_to_list_index_map;
};
#endif // GEOMETRY_COMPRESSOR_H

View File

@ -1,172 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "TemporaryStorage.h"
StreamData::StreamData()
: write_mode(true), temp_path(boost::filesystem::unique_path(temp_directory.append(
TemporaryFilePattern.begin(), TemporaryFilePattern.end()))),
temp_file(new boost::filesystem::fstream(
temp_path, std::ios::in | std::ios::out | std::ios::trunc | std::ios::binary)),
readWriteMutex(std::make_shared<boost::mutex>())
{
if (temp_file->fail())
{
throw OSRMException("temporary file could not be created");
}
}
TemporaryStorage::TemporaryStorage() { temp_directory = boost::filesystem::temp_directory_path(); }
TemporaryStorage &TemporaryStorage::GetInstance()
{
static TemporaryStorage static_instance;
return static_instance;
}
TemporaryStorage::~TemporaryStorage() { RemoveAll(); }
void TemporaryStorage::RemoveAll()
{
boost::mutex::scoped_lock lock(mutex);
for (unsigned slot_id = 0; slot_id < stream_data_list.size(); ++slot_id)
{
DeallocateSlot(slot_id);
}
stream_data_list.clear();
}
int TemporaryStorage::AllocateSlot()
{
boost::mutex::scoped_lock lock(mutex);
try { stream_data_list.push_back(StreamData()); }
catch (boost::filesystem::filesystem_error &e) { Abort(e); }
CheckIfTemporaryDeviceFull();
return stream_data_list.size() - 1;
}
void TemporaryStorage::DeallocateSlot(const int slot_id)
{
try
{
StreamData &data = stream_data_list[slot_id];
boost::mutex::scoped_lock lock(*data.readWriteMutex);
if (!boost::filesystem::exists(data.temp_path))
{
return;
}
if (data.temp_file->is_open())
{
data.temp_file->close();
}
boost::filesystem::remove(data.temp_path);
}
catch (boost::filesystem::filesystem_error &e) { Abort(e); }
}
void TemporaryStorage::WriteToSlot(const int slot_id, char *pointer, const std::size_t size)
{
try
{
StreamData &data = stream_data_list[slot_id];
BOOST_ASSERT(data.write_mode);
boost::mutex::scoped_lock lock(*data.readWriteMutex);
BOOST_ASSERT_MSG(data.write_mode, "Writing after first read is not allowed");
if (1073741824 < data.buffer.size())
{
data.temp_file->write(&data.buffer[0], data.buffer.size());
// data.temp_file->write(pointer, size);
data.buffer.clear();
CheckIfTemporaryDeviceFull();
}
data.buffer.insert(data.buffer.end(), pointer, pointer + size);
}
catch (boost::filesystem::filesystem_error &e) { Abort(e); }
}
void TemporaryStorage::ReadFromSlot(const int slot_id, char *pointer, const std::size_t size)
{
try
{
StreamData &data = stream_data_list[slot_id];
boost::mutex::scoped_lock lock(*data.readWriteMutex);
if (data.write_mode)
{
data.write_mode = false;
data.temp_file->write(&data.buffer[0], data.buffer.size());
data.buffer.clear();
data.temp_file->seekg(data.temp_file->beg);
BOOST_ASSERT(data.temp_file->beg == data.temp_file->tellg());
}
BOOST_ASSERT(!data.write_mode);
data.temp_file->read(pointer, size);
}
catch (boost::filesystem::filesystem_error &e) { Abort(e); }
}
uint64_t TemporaryStorage::GetFreeBytesOnTemporaryDevice()
{
uint64_t value = -1;
try
{
boost::filesystem::path p = boost::filesystem::temp_directory_path();
boost::filesystem::space_info s = boost::filesystem::space(p);
value = s.free;
}
catch (boost::filesystem::filesystem_error &e) { Abort(e); }
return value;
}
void TemporaryStorage::CheckIfTemporaryDeviceFull()
{
boost::filesystem::path p = boost::filesystem::temp_directory_path();
boost::filesystem::space_info s = boost::filesystem::space(p);
if ((1024 * 1024) > s.free)
{
throw OSRMException("temporary device is full");
}
}
boost::filesystem::fstream::pos_type TemporaryStorage::Tell(const int slot_id)
{
boost::filesystem::fstream::pos_type position;
try
{
StreamData &data = stream_data_list[slot_id];
boost::mutex::scoped_lock lock(*data.readWriteMutex);
position = data.temp_file->tellp();
}
catch (boost::filesystem::filesystem_error &e) { Abort(e); }
return position;
}
void TemporaryStorage::Abort(const boost::filesystem::filesystem_error &e)
{
RemoveAll();
throw OSRMException(e.what());
}

View File

@ -1,96 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TEMPORARYSTORAGE_H_
#define TEMPORARYSTORAGE_H_
#include "../Util/BoostFileSystemFix.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/thread/mutex.hpp>
#include <cstdint>
#include <vector>
#include <fstream>
#include <memory>
struct StreamData
{
bool write_mode;
boost::filesystem::path temp_path;
std::shared_ptr<boost::filesystem::fstream> temp_file;
std::shared_ptr<boost::mutex> readWriteMutex;
std::vector<char> buffer;
StreamData();
};
// This class implements a singleton file storage for temporary data.
// temporary slots can be accessed by other objects through an int
// On deallocation every slot gets deallocated
//
// Access is sequential, which means, that there is no random access
// -> Data is written in first phase and reread in second.
static boost::filesystem::path temp_directory;
static std::string TemporaryFilePattern("OSRM-%%%%-%%%%-%%%%");
class TemporaryStorage
{
public:
static TemporaryStorage &GetInstance();
virtual ~TemporaryStorage();
int AllocateSlot();
void DeallocateSlot(const int slot_id);
void WriteToSlot(const int slot_id, char *pointer, const std::size_t size);
void ReadFromSlot(const int slot_id, char *pointer, const std::size_t size);
// returns the number of free bytes
uint64_t GetFreeBytesOnTemporaryDevice();
boost::filesystem::fstream::pos_type Tell(const int slot_id);
void RemoveAll();
private:
TemporaryStorage();
TemporaryStorage(TemporaryStorage const &) {};
TemporaryStorage &operator=(TemporaryStorage const &) { return *this; }
void Abort(const boost::filesystem::filesystem_error &e);
void CheckIfTemporaryDeviceFull();
// vector of file streams that is used to store temporary data
boost::mutex mutex;
std::vector<StreamData> stream_data_list;
};
#endif /* TEMPORARYSTORAGE_H_ */

View File

@ -1,289 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BINARY_HEAP_H
#define BINARY_HEAP_H
#include <boost/assert.hpp>
#include <algorithm>
#include <limits>
#include <map>
#include <type_traits>
#include <unordered_map>
#include <vector>
template <typename NodeID, typename Key> class ArrayStorage
{
public:
explicit ArrayStorage(size_t size) : positions(new Key[size])
{
memset(positions, 0, size * sizeof(Key));
}
~ArrayStorage() { delete[] positions; }
Key &operator[](NodeID node) { return positions[node]; }
void Clear() {}
private:
Key *positions;
};
template <typename NodeID, typename Key> class MapStorage
{
public:
explicit MapStorage(size_t) {}
Key &operator[](NodeID node) { return nodes[node]; }
void Clear() { nodes.clear(); }
private:
std::map<NodeID, Key> nodes;
};
template <typename NodeID, typename Key> class UnorderedMapStorage
{
public:
explicit UnorderedMapStorage(size_t) { nodes.rehash(1000); }
Key &operator[](const NodeID node) { return nodes[node]; }
Key const &operator[](const NodeID node) const
{
auto iter = nodes.find(node);
return iter->second;
}
void Clear() { nodes.clear(); }
private:
std::unordered_map<NodeID, Key> nodes;
};
template <typename NodeID,
typename Key,
typename Weight,
typename Data,
typename IndexStorage = ArrayStorage<NodeID, NodeID>>
class BinaryHeap
{
private:
BinaryHeap(const BinaryHeap &right);
void operator=(const BinaryHeap &right);
public:
typedef Weight WeightType;
typedef Data DataType;
explicit BinaryHeap(size_t maxID) : node_index(maxID) { Clear(); }
void Clear()
{
heap.resize(1);
inserted_nodes.clear();
heap[0].weight = std::numeric_limits<Weight>::min();
node_index.Clear();
}
std::size_t Size() const { return (heap.size() - 1); }
bool Empty() const { return 0 == Size(); }
void Insert(NodeID node, Weight weight, const Data &data)
{
HeapElement element;
element.index = static_cast<NodeID>(inserted_nodes.size());
element.weight = weight;
const Key key = static_cast<Key>(heap.size());
heap.emplace_back(element);
inserted_nodes.emplace_back(node, key, weight, data);
node_index[node] = element.index;
Upheap(key);
CheckHeap();
}
Data &GetData(NodeID node)
{
const Key index = node_index[node];
return inserted_nodes[index].data;
}
Data const &GetData(NodeID node) const
{
const Key index = node_index[node];
return inserted_nodes[index].data;
}
Weight &GetKey(NodeID node)
{
const Key index = node_index[node];
return inserted_nodes[index].weight;
}
bool WasRemoved(const NodeID node)
{
BOOST_ASSERT(WasInserted(node));
const Key index = node_index[node];
return inserted_nodes[index].key == 0;
}
bool WasInserted(const NodeID node)
{
const Key index = node_index[node];
if (index >= static_cast<Key>(inserted_nodes.size()))
{
return false;
}
return inserted_nodes[index].node == node;
}
NodeID Min() const
{
BOOST_ASSERT(heap.size() > 1);
return inserted_nodes[heap[1].index].node;
}
NodeID DeleteMin()
{
BOOST_ASSERT(heap.size() > 1);
const Key removedIndex = heap[1].index;
heap[1] = heap[heap.size() - 1];
heap.pop_back();
if (heap.size() > 1)
{
Downheap(1);
}
inserted_nodes[removedIndex].key = 0;
CheckHeap();
return inserted_nodes[removedIndex].node;
}
void DeleteAll()
{
auto iend = heap.end();
for (typename std::vector<HeapElement>::iterator i = heap.begin() + 1; i != iend; ++i)
{
inserted_nodes[i->index].key = 0;
}
heap.resize(1);
heap[0].weight = (std::numeric_limits<Weight>::min)();
}
void DecreaseKey(NodeID node, Weight weight)
{
BOOST_ASSERT(std::numeric_limits<NodeID>::max() != node);
const Key &index = node_index[node];
Key &key = inserted_nodes[index].key;
BOOST_ASSERT(key >= 0);
inserted_nodes[index].weight = weight;
heap[key].weight = weight;
Upheap(key);
CheckHeap();
}
private:
class HeapNode
{
public:
HeapNode(NodeID n, Key k, Weight w, Data d) : node(n), key(k), weight(w), data(d) {}
NodeID node;
Key key;
Weight weight;
Data data;
};
struct HeapElement
{
Key index;
Weight weight;
};
std::vector<HeapNode> inserted_nodes;
std::vector<HeapElement> heap;
IndexStorage node_index;
void Downheap(Key key)
{
const Key droppingIndex = heap[key].index;
const Weight weight = heap[key].weight;
Key nextKey = key << 1;
while (nextKey < static_cast<Key>(heap.size()))
{
const Key nextKeyOther = nextKey + 1;
if ((nextKeyOther < static_cast<Key>(heap.size())) &&
(heap[nextKey].weight > heap[nextKeyOther].weight))
{
nextKey = nextKeyOther;
}
if (weight <= heap[nextKey].weight)
{
break;
}
heap[key] = heap[nextKey];
inserted_nodes[heap[key].index].key = key;
key = nextKey;
nextKey <<= 1;
}
heap[key].index = droppingIndex;
heap[key].weight = weight;
inserted_nodes[droppingIndex].key = key;
}
void Upheap(Key key)
{
const Key risingIndex = heap[key].index;
const Weight weight = heap[key].weight;
Key nextKey = key >> 1;
while (heap[nextKey].weight > weight)
{
BOOST_ASSERT(nextKey != 0);
heap[key] = heap[nextKey];
inserted_nodes[heap[key].index].key = key;
key = nextKey;
nextKey >>= 1;
}
heap[key].index = risingIndex;
heap[key].weight = weight;
inserted_nodes[risingIndex].key = key;
}
void CheckHeap()
{
#ifndef NDEBUG
for (Key i = 2; i < (Key)heap.size(); ++i)
{
BOOST_ASSERT(heap[i].weight >= heap[i >> 1].weight);
}
#endif
}
};
#endif // BINARY_HEAP_H

View File

@ -1,88 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CONCURRENT_QUEUE_H
#define CONCURRENT_QUEUE_H
#include "../typedefs.h"
#include <boost/circular_buffer.hpp>
#include <condition_variable>
#include <mutex>
template <typename Data> class ConcurrentQueue
{
public:
explicit ConcurrentQueue(const size_t max_size) : m_internal_queue(max_size) {}
inline void push(const Data &data)
{
std::unique_lock<std::mutex> lock(m_mutex);
m_not_full.wait(lock,
[this]
{ return m_internal_queue.size() < m_internal_queue.capacity(); });
m_internal_queue.push_back(data);
m_mutex.unlock();
m_not_empty.notify_one();
}
inline bool empty() const { return m_internal_queue.empty(); }
inline void wait_and_pop(Data &popped_value)
{
std::unique_lock<std::mutex> lock(m_mutex);
m_not_empty.wait(lock,
[this]
{ return !m_internal_queue.empty(); });
popped_value = m_internal_queue.front();
m_internal_queue.pop_front();
m_mutex.unlock();
m_not_full.notify_one();
}
inline bool try_pop(Data &popped_value)
{
std::unique_lock<std::mutex> lock(m_mutex);
if (m_internal_queue.empty())
{
return false;
}
popped_value = m_internal_queue.front();
m_internal_queue.pop_front();
m_mutex.unlock();
m_not_full.notify_one();
return true;
}
private:
boost::circular_buffer<Data> m_internal_queue;
std::mutex m_mutex;
std::condition_variable m_not_empty;
std::condition_variable m_not_full;
};
#endif // CONCURRENT_QUEUE_H

View File

@ -1,380 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <osrm/Coordinate.h>
#include "../Util/MercatorUtil.h"
#include "../Util/SimpleLogger.h"
#include "../Util/StringUtil.h"
#include "../Util/TrigonometryTables.h"
#include <boost/assert.hpp>
#ifndef NDEBUG
#include <bitset>
#endif
#include <iostream>
#include <limits>
FixedPointCoordinate::FixedPointCoordinate()
: lat(std::numeric_limits<int>::min()), lon(std::numeric_limits<int>::min())
{
}
FixedPointCoordinate::FixedPointCoordinate(int lat, int lon) : lat(lat), lon(lon)
{
#ifndef NDEBUG
if (0 != (std::abs(lat) >> 30))
{
std::bitset<32> y(lat);
SimpleLogger().Write(logDEBUG) << "broken lat: " << lat << ", bits: " << y;
}
if (0 != (std::abs(lon) >> 30))
{
std::bitset<32> x(lon);
SimpleLogger().Write(logDEBUG) << "broken lon: " << lon << ", bits: " << x;
}
#endif
}
void FixedPointCoordinate::Reset()
{
lat = std::numeric_limits<int>::min();
lon = std::numeric_limits<int>::min();
}
bool FixedPointCoordinate::isSet() const
{
return (std::numeric_limits<int>::min() != lat) && (std::numeric_limits<int>::min() != lon);
}
bool FixedPointCoordinate::isValid() const
{
if (lat > 90 * COORDINATE_PRECISION || lat < -90 * COORDINATE_PRECISION ||
lon > 180 * COORDINATE_PRECISION || lon < -180 * COORDINATE_PRECISION)
{
return false;
}
return true;
}
bool FixedPointCoordinate::operator==(const FixedPointCoordinate &other) const
{
return lat == other.lat && lon == other.lon;
}
double FixedPointCoordinate::ApproximateDistance(const int lat1,
const int lon1,
const int lat2,
const int lon2)
{
BOOST_ASSERT(lat1 != std::numeric_limits<int>::min());
BOOST_ASSERT(lon1 != std::numeric_limits<int>::min());
BOOST_ASSERT(lat2 != std::numeric_limits<int>::min());
BOOST_ASSERT(lon2 != std::numeric_limits<int>::min());
double RAD = 0.017453292519943295769236907684886;
double lt1 = lat1 / COORDINATE_PRECISION;
double ln1 = lon1 / COORDINATE_PRECISION;
double lt2 = lat2 / COORDINATE_PRECISION;
double ln2 = lon2 / COORDINATE_PRECISION;
double dlat1 = lt1 * (RAD);
double dlong1 = ln1 * (RAD);
double dlat2 = lt2 * (RAD);
double dlong2 = ln2 * (RAD);
double dLong = dlong1 - dlong2;
double dLat = dlat1 - dlat2;
double aHarv = pow(sin(dLat / 2.0), 2.0) + cos(dlat1) * cos(dlat2) * pow(sin(dLong / 2.), 2);
double cHarv = 2. * atan2(sqrt(aHarv), sqrt(1.0 - aHarv));
// earth radius varies between 6,356.750-6,378.135 km (3,949.901-3,963.189mi)
// The IUGG value for the equatorial radius is 6378.137 km (3963.19 miles)
const double earth = 6372797.560856;
return earth * cHarv;
}
double FixedPointCoordinate::ApproximateDistance(const FixedPointCoordinate &c1,
const FixedPointCoordinate &c2)
{
return ApproximateDistance(c1.lat, c1.lon, c2.lat, c2.lon);
}
float FixedPointCoordinate::ApproximateEuclideanDistance(const FixedPointCoordinate &c1,
const FixedPointCoordinate &c2)
{
return ApproximateEuclideanDistance(c1.lat, c1.lon, c2.lat, c2.lon);
}
float FixedPointCoordinate::ApproximateEuclideanDistance(const int lat1,
const int lon1,
const int lat2,
const int lon2)
{
BOOST_ASSERT(lat1 != std::numeric_limits<int>::min());
BOOST_ASSERT(lon1 != std::numeric_limits<int>::min());
BOOST_ASSERT(lat2 != std::numeric_limits<int>::min());
BOOST_ASSERT(lon2 != std::numeric_limits<int>::min());
const float RAD = 0.017453292519943295769236907684886;
const float float_lat1 = (lat1 / COORDINATE_PRECISION) * RAD;
const float float_lon1 = (lon1 / COORDINATE_PRECISION) * RAD;
const float float_lat2 = (lat2 / COORDINATE_PRECISION) * RAD;
const float float_lon2 = (lon2 / COORDINATE_PRECISION) * RAD;
const float x = (float_lon2 - float_lon1) * cos((float_lat1 + float_lat2) / 2.);
const float y = (float_lat2 - float_lat1);
const float earth_radius = 6372797.560856;
return sqrt(x * x + y * y) * earth_radius;
}
float FixedPointCoordinate::ComputePerpendicularDistance(const FixedPointCoordinate &point,
const FixedPointCoordinate &segA,
const FixedPointCoordinate &segB)
{
const float x = lat2y(point.lat / COORDINATE_PRECISION);
const float y = point.lon / COORDINATE_PRECISION;
const float a = lat2y(segA.lat / COORDINATE_PRECISION);
const float b = segA.lon / COORDINATE_PRECISION;
const float c = lat2y(segB.lat / COORDINATE_PRECISION);
const float d = segB.lon / COORDINATE_PRECISION;
float p, q, nY;
if (std::abs(a - c) > std::numeric_limits<float>::epsilon())
{
const float m = (d - b) / (c - a); // slope
// Projection of (x,y) on line joining (a,b) and (c,d)
p = ((x + (m * y)) + (m * m * a - m * b)) / (1. + m * m);
q = b + m * (p - a);
}
else
{
p = c;
q = y;
}
nY = (d * p - c * q) / (a * d - b * c);
// discretize the result to coordinate precision. it's a hack!
if (std::abs(nY) < (1. / COORDINATE_PRECISION))
{
nY = 0.;
}
float r = (p - nY * a) / c;
if (std::isnan(r))
{
r = ((segB.lat == point.lat) && (segB.lon == point.lon)) ? 1. : 0.;
}
else if (std::abs(r) <= std::numeric_limits<float>::epsilon())
{
r = 0.;
}
else if (std::abs(r - 1.) <= std::numeric_limits<float>::epsilon())
{
r = 1.;
}
FixedPointCoordinate nearest_location;
BOOST_ASSERT(!std::isnan(r));
if (r <= 0.)
{ // point is "left" of edge
nearest_location.lat = segA.lat;
nearest_location.lon = segA.lon;
}
else if (r >= 1.)
{ // point is "right" of edge
nearest_location.lat = segB.lat;
nearest_location.lon = segB.lon;
}
else
{ // point lies in between
nearest_location.lat = y2lat(p) * COORDINATE_PRECISION;
nearest_location.lon = q * COORDINATE_PRECISION;
}
BOOST_ASSERT(nearest_location.isValid());
const float approximated_distance =
FixedPointCoordinate::ApproximateEuclideanDistance(point, nearest_location);
BOOST_ASSERT(0. <= approximated_distance);
return approximated_distance;
}
float FixedPointCoordinate::ComputePerpendicularDistance(const FixedPointCoordinate &coord_a,
const FixedPointCoordinate &coord_b,
const FixedPointCoordinate &query_location,
FixedPointCoordinate &nearest_location,
float &r)
{
BOOST_ASSERT(query_location.isValid());
const float x = lat2y(query_location.lat / COORDINATE_PRECISION);
const float y = query_location.lon / COORDINATE_PRECISION;
const float a = lat2y(coord_a.lat / COORDINATE_PRECISION);
const float b = coord_a.lon / COORDINATE_PRECISION;
const float c = lat2y(coord_b.lat / COORDINATE_PRECISION);
const float d = coord_b.lon / COORDINATE_PRECISION;
float p, q /*,mX*/, nY;
if (std::abs(a - c) > std::numeric_limits<float>::epsilon())
{
const float m = (d - b) / (c - a); // slope
// Projection of (x,y) on line joining (a,b) and (c,d)
p = ((x + (m * y)) + (m * m * a - m * b)) / (1. + m * m);
q = b + m * (p - a);
}
else
{
p = c;
q = y;
}
nY = (d * p - c * q) / (a * d - b * c);
// discretize the result to coordinate precision. it's a hack!
if (std::abs(nY) < (1. / COORDINATE_PRECISION))
{
nY = 0.;
}
r = (p - nY * a) / c; // These values are actually n/m+n and m/m+n , we need
// not calculate the explicit values of m an n as we
// are just interested in the ratio
if (std::isnan(r))
{
r = ((coord_b.lat == query_location.lat) && (coord_b.lon == query_location.lon)) ? 1. : 0.;
}
else if (std::abs(r) <= std::numeric_limits<float>::epsilon())
{
r = 0.;
}
else if (std::abs(r - 1.) <= std::numeric_limits<float>::epsilon())
{
r = 1.;
}
BOOST_ASSERT(!std::isnan(r));
if (r <= 0.)
{
nearest_location = coord_a;
}
else if (r >= 1.)
{
nearest_location = coord_b;
}
else
{
// point lies in between
nearest_location.lat = y2lat(p) * COORDINATE_PRECISION;
nearest_location.lon = q * COORDINATE_PRECISION;
}
BOOST_ASSERT(nearest_location.isValid());
// TODO: Replace with euclidean approximation when k-NN search is done
// const float approximated_distance = FixedPointCoordinate::ApproximateEuclideanDistance(
const float approximated_distance =
FixedPointCoordinate::ApproximateEuclideanDistance(query_location, nearest_location);
BOOST_ASSERT(0. <= approximated_distance);
return approximated_distance;
}
void FixedPointCoordinate::convertInternalLatLonToString(const int value, std::string &output)
{
char buffer[12];
buffer[11] = 0; // zero termination
output = printInt<11, 6>(buffer, value);
}
void FixedPointCoordinate::convertInternalCoordinateToString(const FixedPointCoordinate &coord,
std::string &output)
{
std::string tmp;
tmp.reserve(23);
convertInternalLatLonToString(coord.lon, tmp);
output = tmp;
output += ",";
convertInternalLatLonToString(coord.lat, tmp);
output += tmp;
}
void
FixedPointCoordinate::convertInternalReversedCoordinateToString(const FixedPointCoordinate &coord,
std::string &output)
{
std::string tmp;
tmp.reserve(23);
convertInternalLatLonToString(coord.lat, tmp);
output = tmp;
output += ",";
convertInternalLatLonToString(coord.lon, tmp);
output += tmp;
}
void FixedPointCoordinate::Output(std::ostream &out) const
{
out << "(" << lat / COORDINATE_PRECISION << "," << lon / COORDINATE_PRECISION << ")";
}
float FixedPointCoordinate::GetBearing(const FixedPointCoordinate &A, const FixedPointCoordinate &B)
{
const float delta_long = DegreeToRadian(B.lon / COORDINATE_PRECISION - A.lon / COORDINATE_PRECISION);
const float lat1 = DegreeToRadian(A.lat / COORDINATE_PRECISION);
const float lat2 = DegreeToRadian(B.lat / COORDINATE_PRECISION);
const float y = sin(delta_long) * cos(lat2);
const float x = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(delta_long);
float result = RadianToDegree(std::atan2(y, x));
while (result < 0.f)
{
result += 360.f;
}
while (result >= 360.f)
{
result -= 360.f;
}
return result;
}
float FixedPointCoordinate::GetBearing(const FixedPointCoordinate &other) const
{
const float delta_long = DegreeToRadian(lon / COORDINATE_PRECISION - other.lon / COORDINATE_PRECISION);
const float lat1 = DegreeToRadian(other.lat / COORDINATE_PRECISION);
const float lat2 = DegreeToRadian(lat / COORDINATE_PRECISION);
const float y = std::sin(delta_long) * std::cos(lat2);
const float x = std::cos(lat1) * std::sin(lat2) - std::sin(lat1) * std::cos(lat2) * std::cos(delta_long);
float result = RadianToDegree(std::atan2(y, x));
while (result < 0.f)
{
result += 360.f;
}
while (result >= 360.f)
{
result -= 360.f;
}
return result;
}
float FixedPointCoordinate::DegreeToRadian(const float degree)
{
return degree * (M_PI / 180.f);
}
float FixedPointCoordinate::RadianToDegree(const float radian)
{
return radian * (180.f / M_PI);
}

View File

@ -1,401 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DEALLOCATINGVECTOR_H_
#define DEALLOCATINGVECTOR_H_
#include <boost/assert.hpp>
#include <cstring>
#include <vector>
template <typename ElementT,
std::size_t bucketSizeC = 8388608 / sizeof(ElementT),
bool DeallocateC = false>
class DeallocatingVectorIterator : public std::iterator<std::random_access_iterator_tag, ElementT>
{
protected:
class DeallocatingVectorIteratorState
{
private:
// make constructors explicit, so we do not mix random access and deallocation iterators.
DeallocatingVectorIteratorState();
public:
explicit DeallocatingVectorIteratorState(const DeallocatingVectorIteratorState &r)
: index(r.index), bucket_list(r.bucket_list)
{
}
explicit DeallocatingVectorIteratorState(const std::size_t idx,
std::vector<ElementT *> &input_list)
: index(idx), bucket_list(input_list)
{
}
std::size_t index;
std::vector<ElementT *> &bucket_list;
inline bool operator!=(const DeallocatingVectorIteratorState &other)
{
return index != other.index;
}
inline bool operator==(const DeallocatingVectorIteratorState &other)
{
return index == other.index;
}
bool operator<(const DeallocatingVectorIteratorState &other) const
{
return index < other.index;
}
bool operator>(const DeallocatingVectorIteratorState &other) const
{
return index > other.index;
}
bool operator>=(const DeallocatingVectorIteratorState &other) const
{
return index >= other.index;
}
// This is a hack to make assignment operator possible with reference member
inline DeallocatingVectorIteratorState &operator=(const DeallocatingVectorIteratorState &a)
{
if (this != &a)
{
this->DeallocatingVectorIteratorState::
~DeallocatingVectorIteratorState(); // explicit non-virtual destructor
new (this) DeallocatingVectorIteratorState(a); // placement new
}
return *this;
}
};
DeallocatingVectorIteratorState current_state;
public:
typedef std::random_access_iterator_tag iterator_category;
typedef typename std::iterator<std::random_access_iterator_tag, ElementT>::value_type
value_type;
typedef typename std::iterator<std::random_access_iterator_tag, ElementT>::difference_type
difference_type;
typedef typename std::iterator<std::random_access_iterator_tag, ElementT>::reference reference;
typedef typename std::iterator<std::random_access_iterator_tag, ElementT>::pointer pointer;
DeallocatingVectorIterator() {}
template <typename T2>
explicit DeallocatingVectorIterator(const DeallocatingVectorIterator<T2> &r)
: current_state(r.current_state)
{
}
DeallocatingVectorIterator(std::size_t idx, std::vector<ElementT *> &input_list)
: current_state(idx, input_list)
{
}
explicit DeallocatingVectorIterator(const DeallocatingVectorIteratorState &r) : current_state(r) {}
template <typename T2>
DeallocatingVectorIterator &operator=(const DeallocatingVectorIterator<T2> &r)
{
if (DeallocateC)
{
BOOST_ASSERT(false);
}
current_state = r.current_state;
return *this;
}
inline DeallocatingVectorIterator &operator++()
{ // prefix
++current_state.index;
return *this;
}
inline DeallocatingVectorIterator &operator--()
{ // prefix
if (DeallocateC)
{
BOOST_ASSERT(false);
}
--current_state.index;
return *this;
}
inline DeallocatingVectorIterator operator++(int)
{ // postfix
DeallocatingVectorIteratorState my_state(current_state);
current_state.index++;
return DeallocatingVectorIterator(my_state);
}
inline DeallocatingVectorIterator operator--(int)
{ // postfix
if (DeallocateC)
{
BOOST_ASSERT(false);
}
DeallocatingVectorIteratorState my_state(current_state);
current_state.index--;
return DeallocatingVectorIterator(my_state);
}
inline DeallocatingVectorIterator operator+(const difference_type &n) const
{
DeallocatingVectorIteratorState my_state(current_state);
my_state.index += n;
return DeallocatingVectorIterator(my_state);
}
inline DeallocatingVectorIterator &operator+=(const difference_type &n)
{
current_state.index += n;
return *this;
}
inline DeallocatingVectorIterator operator-(const difference_type &n) const
{
if (DeallocateC)
{
BOOST_ASSERT(false);
}
DeallocatingVectorIteratorState my_state(current_state);
my_state.index -= n;
return DeallocatingVectorIterator(my_state);
}
inline DeallocatingVectorIterator &operator-=(const difference_type &n) const
{
if (DeallocateC)
{
BOOST_ASSERT(false);
}
current_state.index -= n;
return *this;
}
inline reference operator*() const
{
std::size_t current_bucket = current_state.index / bucketSizeC;
std::size_t current_index = current_state.index % bucketSizeC;
return (current_state.bucket_list[current_bucket][current_index]);
}
inline pointer operator->() const
{
std::size_t current_bucket = current_state.index / bucketSizeC;
std::size_t current_index = current_state.index % bucketSizeC;
return &(current_state.bucket_list[current_bucket][current_index]);
}
inline bool operator!=(const DeallocatingVectorIterator &other)
{
return current_state != other.current_state;
}
inline bool operator==(const DeallocatingVectorIterator &other)
{
return current_state == other.current_state;
}
inline bool operator<(const DeallocatingVectorIterator &other) const
{
return current_state < other.current_state;
}
inline bool operator>(const DeallocatingVectorIterator &other) const
{
return current_state > other.current_state;
}
inline bool operator>=(const DeallocatingVectorIterator &other) const
{
return current_state >= other.current_state;
}
difference_type operator-(const DeallocatingVectorIterator &other)
{
if (DeallocateC)
{
BOOST_ASSERT(false);
}
return current_state.index - other.current_state.index;
}
};
template <typename ElementT, std::size_t bucketSizeC = 8388608 / sizeof(ElementT)>
class DeallocatingVector
{
private:
std::size_t current_size;
std::vector<ElementT *> bucket_list;
public:
typedef ElementT value_type;
typedef DeallocatingVectorIterator<ElementT, bucketSizeC, false> iterator;
typedef DeallocatingVectorIterator<ElementT, bucketSizeC, false> const_iterator;
// this iterator deallocates all buckets that have been visited. Iterators to visited objects
// become invalid.
typedef DeallocatingVectorIterator<ElementT, bucketSizeC, true> deallocation_iterator;
DeallocatingVector() : current_size(0)
{
// initial bucket
bucket_list.emplace_back(new ElementT[bucketSizeC]);
}
~DeallocatingVector() { clear(); }
inline void swap(DeallocatingVector<ElementT, bucketSizeC> &other)
{
std::swap(current_size, other.current_size);
bucket_list.swap(other.bucket_list);
}
inline void clear()
{
// Delete[]'ing ptr's to all Buckets
for (unsigned i = 0; i < bucket_list.size(); ++i)
{
if (nullptr != bucket_list[i])
{
delete[] bucket_list[i];
bucket_list[i] = nullptr;
}
}
// Removing all ptrs from vector
std::vector<ElementT *>().swap(bucket_list);
current_size = 0;
}
inline void push_back(const ElementT &element)
{
const std::size_t current_capacity = capacity();
if (current_size == current_capacity)
{
bucket_list.push_back(new ElementT[bucketSizeC]);
}
std::size_t current_index = size() % bucketSizeC;
bucket_list.back()[current_index] = element;
++current_size;
}
inline void emplace_back(const ElementT &&element)
{
const std::size_t current_capacity = capacity();
if (current_size == current_capacity)
{
bucket_list.push_back(new ElementT[bucketSizeC]);
}
const std::size_t current_index = size() % bucketSizeC;
bucket_list.back()[current_index] = element;
++current_size;
}
inline void reserve(const std::size_t) const
{
// don't do anything
}
inline void resize(const std::size_t new_size)
{
if (new_size > current_size)
{
while (capacity() < new_size)
{
bucket_list.push_back(new ElementT[bucketSizeC]);
}
current_size = new_size;
}
if (new_size < current_size)
{
const std::size_t number_of_necessary_buckets = 1 + (new_size / bucketSizeC);
for (unsigned i = number_of_necessary_buckets; i < bucket_list.size(); ++i)
{
delete[] bucket_list[i];
}
bucket_list.resize(number_of_necessary_buckets);
current_size = new_size;
}
}
inline std::size_t size() const { return current_size; }
inline std::size_t capacity() const { return bucket_list.size() * bucketSizeC; }
inline iterator begin() { return iterator(static_cast<std::size_t>(0), bucket_list); }
inline iterator end() { return iterator(size(), bucket_list); }
inline deallocation_iterator dbegin()
{
return deallocation_iterator(static_cast<std::size_t>(0), bucket_list);
}
inline deallocation_iterator dend() { return deallocation_iterator(size(), bucket_list); }
inline const_iterator begin() const
{
return const_iterator(static_cast<std::size_t>(0), bucket_list);
}
inline const_iterator end() const { return const_iterator(size(), bucket_list); }
inline ElementT &operator[](const std::size_t index)
{
std::size_t _bucket = index / bucketSizeC;
std::size_t _index = index % bucketSizeC;
return (bucket_list[_bucket][_index]);
}
const inline ElementT &operator[](const std::size_t index) const
{
std::size_t _bucket = index / bucketSizeC;
std::size_t _index = index % bucketSizeC;
return (bucket_list[_bucket][_index]);
}
inline ElementT &back()
{
std::size_t _bucket = current_size / bucketSizeC;
std::size_t _index = current_size % bucketSizeC;
return (bucket_list[_bucket][_index]);
}
const inline ElementT &back() const
{
std::size_t _bucket = current_size / bucketSizeC;
std::size_t _index = current_size % bucketSizeC;
return (bucket_list[_bucket][_index]);
}
};
#endif /* DEALLOCATINGVECTOR_H_ */

View File

@ -1,281 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DYNAMICGRAPH_H
#define DYNAMICGRAPH_H
#include "../DataStructures/DeallocatingVector.h"
#include <boost/assert.hpp>
#include <boost/range/irange.hpp>
#include <cstdint>
#include <algorithm>
#include <limits>
#include <vector>
template <typename EdgeDataT> class DynamicGraph
{
public:
typedef decltype(boost::irange(0u,0u)) EdgeRange;
typedef EdgeDataT EdgeData;
typedef unsigned NodeIterator;
typedef unsigned EdgeIterator;
class InputEdge
{
public:
NodeIterator source;
NodeIterator target;
EdgeDataT data;
bool operator<(const InputEdge &right) const
{
if (source != right.source)
return source < right.source;
return target < right.target;
}
};
// Constructs an empty graph with a given number of nodes.
explicit DynamicGraph(int32_t nodes) : m_numNodes(nodes), m_numEdges(0)
{
m_nodes.reserve(m_numNodes);
m_nodes.resize(m_numNodes);
m_edges.reserve(m_numNodes * 1.1);
m_edges.resize(m_numNodes);
}
template <class ContainerT> DynamicGraph(const int32_t nodes, const ContainerT &graph)
{
m_numNodes = nodes;
m_numEdges = (EdgeIterator)graph.size();
m_nodes.reserve(m_numNodes + 1);
m_nodes.resize(m_numNodes + 1);
EdgeIterator edge = 0;
EdgeIterator position = 0;
for (NodeIterator node = 0; node < m_numNodes; ++node)
{
EdgeIterator lastEdge = edge;
while (edge < m_numEdges && graph[edge].source == node)
{
++edge;
}
m_nodes[node].firstEdge = position;
m_nodes[node].edges = edge - lastEdge;
position += m_nodes[node].edges;
}
m_nodes.back().firstEdge = position;
m_edges.reserve(position * 1.1);
m_edges.resize(position);
edge = 0;
for (NodeIterator node = 0; node < m_numNodes; ++node)
{
for (EdgeIterator i = m_nodes[node].firstEdge,
e = m_nodes[node].firstEdge + m_nodes[node].edges;
i != e;
++i)
{
m_edges[i].target = graph[edge].target;
m_edges[i].data = graph[edge].data;
BOOST_ASSERT_MSG(graph[edge].data.distance > 0, "edge distance invalid");
++edge;
}
}
}
~DynamicGraph() {}
unsigned GetNumberOfNodes() const { return m_numNodes; }
unsigned GetNumberOfEdges() const { return m_numEdges; }
unsigned GetOutDegree(const NodeIterator n) const { return m_nodes[n].edges; }
unsigned GetDirectedOutDegree(const NodeIterator n) const
{
unsigned degree = 0;
for(EdgeIterator edge = BeginEdges(n); edge < EndEdges(n); ++edge)
{
if (GetEdgeData(edge).forward)
{
++degree;
}
}
return degree;
}
NodeIterator GetTarget(const EdgeIterator e) const { return NodeIterator(m_edges[e].target); }
void SetTarget(const EdgeIterator e, const NodeIterator n) { m_edges[e].target = n; }
EdgeDataT &GetEdgeData(const EdgeIterator e) { return m_edges[e].data; }
const EdgeDataT &GetEdgeData(const EdgeIterator e) const { return m_edges[e].data; }
EdgeIterator BeginEdges(const NodeIterator n) const
{
return EdgeIterator(m_nodes[n].firstEdge);
}
EdgeIterator EndEdges(const NodeIterator n) const
{
return EdgeIterator(m_nodes[n].firstEdge + m_nodes[n].edges);
}
EdgeRange GetAdjacentEdgeRange(const NodeIterator node) const
{
return boost::irange(BeginEdges(node), EndEdges(node));
}
// adds an edge. Invalidates edge iterators for the source node
EdgeIterator InsertEdge(const NodeIterator from, const NodeIterator to, const EdgeDataT &data)
{
Node &node = m_nodes[from];
EdgeIterator newFirstEdge = node.edges + node.firstEdge;
if (newFirstEdge >= m_edges.size() || !isDummy(newFirstEdge))
{
if (node.firstEdge != 0 && isDummy(node.firstEdge - 1))
{
node.firstEdge--;
m_edges[node.firstEdge] = m_edges[node.firstEdge + node.edges];
}
else
{
EdgeIterator newFirstEdge = (EdgeIterator)m_edges.size();
unsigned newSize = node.edges * 1.1 + 2;
EdgeIterator requiredCapacity = newSize + m_edges.size();
EdgeIterator oldCapacity = m_edges.capacity();
if (requiredCapacity >= oldCapacity)
{
m_edges.reserve(requiredCapacity * 1.1);
}
m_edges.resize(m_edges.size() + newSize);
for (EdgeIterator i = 0; i < node.edges; ++i)
{
m_edges[newFirstEdge + i] = m_edges[node.firstEdge + i];
makeDummy(node.firstEdge + i);
}
for (EdgeIterator i = node.edges + 1; i < newSize; ++i)
makeDummy(newFirstEdge + i);
node.firstEdge = newFirstEdge;
}
}
Edge &edge = m_edges[node.firstEdge + node.edges];
edge.target = to;
edge.data = data;
++m_numEdges;
++node.edges;
return EdgeIterator(node.firstEdge + node.edges);
}
// removes an edge. Invalidates edge iterators for the source node
void DeleteEdge(const NodeIterator source, const EdgeIterator e)
{
Node &node = m_nodes[source];
#pragma omp atomic
--m_numEdges;
--node.edges;
BOOST_ASSERT(std::numeric_limits<unsigned>::max() != node.edges);
const unsigned last = node.firstEdge + node.edges;
BOOST_ASSERT(std::numeric_limits<unsigned>::max() != last);
// swap with last edge
m_edges[e] = m_edges[last];
makeDummy(last);
}
// removes all edges (source,target)
int32_t DeleteEdgesTo(const NodeIterator source, const NodeIterator target)
{
int32_t deleted = 0;
for (EdgeIterator i = BeginEdges(source), iend = EndEdges(source); i < iend - deleted; ++i)
{
if (m_edges[i].target == target)
{
do
{
deleted++;
m_edges[i] = m_edges[iend - deleted];
makeDummy(iend - deleted);
} while (i < iend - deleted && m_edges[i].target == target);
}
}
#pragma omp atomic
m_numEdges -= deleted;
m_nodes[source].edges -= deleted;
return deleted;
}
// searches for a specific edge
EdgeIterator FindEdge(const NodeIterator from, const NodeIterator to) const
{
for (EdgeIterator i = BeginEdges(from), iend = EndEdges(from); i != iend; ++i)
{
if (to == m_edges[i].target)
{
return i;
}
}
return EndEdges(from);
}
protected:
bool isDummy(const EdgeIterator edge) const
{
return m_edges[edge].target == (std::numeric_limits<NodeIterator>::max)();
}
void makeDummy(const EdgeIterator edge)
{
m_edges[edge].target = (std::numeric_limits<NodeIterator>::max)();
}
struct Node
{
// index of the first edge
EdgeIterator firstEdge;
// amount of edges
unsigned edges;
};
struct Edge
{
NodeIterator target;
EdgeDataT data;
};
NodeIterator m_numNodes;
EdgeIterator m_numEdges;
std::vector<Node> m_nodes;
DeallocatingVector<Edge> m_edges;
};
#endif // DYNAMICGRAPH_H

View File

@ -1,90 +0,0 @@
#ifndef EDGE_BASED_NODE_H
#define EDGE_BASED_NODE_H
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <boost/assert.hpp>
#include <limits>
struct EdgeBasedNode
{
EdgeBasedNode() :
forward_edge_based_node_id(SPECIAL_NODEID),
reverse_edge_based_node_id(SPECIAL_NODEID),
u(SPECIAL_NODEID),
v(SPECIAL_NODEID),
name_id(0),
forward_weight(INVALID_EDGE_WEIGHT >> 1),
reverse_weight(INVALID_EDGE_WEIGHT >> 1),
forward_offset(0),
reverse_offset(0),
packed_geometry_id(SPECIAL_EDGEID),
fwd_segment_position( std::numeric_limits<unsigned short>::max() ),
is_in_tiny_cc(false)
{ }
explicit EdgeBasedNode(
NodeID forward_edge_based_node_id,
NodeID reverse_edge_based_node_id,
NodeID u,
NodeID v,
unsigned name_id,
int forward_weight,
int reverse_weight,
int forward_offset,
int reverse_offset,
unsigned packed_geometry_id,
unsigned short fwd_segment_position,
bool belongs_to_tiny_component
) :
forward_edge_based_node_id(forward_edge_based_node_id),
reverse_edge_based_node_id(reverse_edge_based_node_id),
u(u),
v(v),
name_id(name_id),
forward_weight(forward_weight),
reverse_weight(reverse_weight),
forward_offset(forward_offset),
reverse_offset(reverse_offset),
packed_geometry_id(packed_geometry_id),
fwd_segment_position(fwd_segment_position),
is_in_tiny_cc(belongs_to_tiny_component)
{
BOOST_ASSERT((forward_edge_based_node_id != SPECIAL_NODEID) ||
(reverse_edge_based_node_id != SPECIAL_NODEID));
}
static inline FixedPointCoordinate Centroid(const FixedPointCoordinate & a, const FixedPointCoordinate & b)
{
FixedPointCoordinate centroid;
//The coordinates of the midpoint are given by:
centroid.lat = (a.lat + b.lat)/2;
centroid.lon = (a.lon + b.lon)/2;
return centroid;
}
bool IsCompressed() const
{
return packed_geometry_id != SPECIAL_EDGEID;
}
NodeID forward_edge_based_node_id; // needed for edge-expanded graph
NodeID reverse_edge_based_node_id; // needed for edge-expanded graph
NodeID u; // indices into the coordinates array
NodeID v; // indices into the coordinates array
unsigned name_id; // id of the edge name
int forward_weight; // weight of the edge
int reverse_weight; // weight in the other direction (may be different)
int forward_offset; // prefix sum of the weight up the edge TODO: short must suffice
int reverse_offset; // prefix sum of the weight from the edge TODO: short must suffice
unsigned packed_geometry_id; // if set, then the edge represents a packed geometry
unsigned short fwd_segment_position; // segment id in a compressed geometry
bool is_in_tiny_cc;
};
#endif //EDGE_BASED_NODE_H

View File

@ -1,65 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HASH_TABLE_H
#define HASH_TABLE_H
#include <unordered_map>
template <typename Key, typename Value> class HashTable : public std::unordered_map<Key, Value>
{
private:
typedef std::unordered_map<Key, Value> super;
public:
HashTable() : super() {}
explicit HashTable(const unsigned size) : super(size) {}
inline void Add(Key const &key, Value const &value) { super::emplace(key, value); }
inline const Value Find(Key const &key) const
{
auto iter = super::find(key);
if (iter == super::end())
{
return Value();
}
return iter->second;
}
inline const bool Holds(Key const &key) const
{
if (super::find(key) == super::end())
{
return false;
}
return true;
}
};
#endif /* HASH_TABLE_H */

View File

@ -1,100 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "HilbertValue.h"
#include <osrm/Coordinate.h>
uint64_t HilbertCode::operator()(const FixedPointCoordinate &current_coordinate) const
{
unsigned location[2];
location[0] = current_coordinate.lat + (90 * COORDINATE_PRECISION);
location[1] = current_coordinate.lon + (180 * COORDINATE_PRECISION);
TransposeCoordinate(location);
return BitInterleaving(location[0], location[1]);
}
uint64_t HilbertCode::BitInterleaving(const uint32_t latitude, const uint32_t longitude) const
{
uint64_t result = 0;
for (int8_t index = 31; index >= 0; --index)
{
result |= (latitude >> index) & 1;
result <<= 1;
result |= (longitude >> index) & 1;
if (0 != index)
{
result <<= 1;
}
}
return result;
}
void HilbertCode::TransposeCoordinate(uint32_t *X) const
{
uint32_t M = 1 << (32 - 1), P, Q, t;
int i;
// Inverse undo
for (Q = M; Q > 1; Q >>= 1)
{
P = Q - 1;
for (i = 0; i < 2; ++i)
{
const bool condition = (X[i] & Q);
if (condition)
{
X[0] ^= P; // invert
}
else
{
t = (X[0] ^ X[i]) & P;
X[0] ^= t;
X[i] ^= t;
}
} // exchange
}
// Gray encode
for (i = 1; i < 2; ++i)
{
X[i] ^= X[i - 1];
}
t = 0;
for (Q = M; Q > 1; Q >>= 1)
{
const bool condition = (X[2 - 1] & Q);
if (condition)
{
t ^= Q - 1;
}
} // check if this for loop is wrong
for (i = 0; i < 2; ++i)
{
X[i] ^= t;
}
}

View File

@ -1,49 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HILBERTVALUE_H_
#define HILBERTVALUE_H_
#include <cstdint>
// computes a 64 bit value that corresponds to the hilbert space filling curve
struct FixedPointCoordinate;
class HilbertCode
{
public:
uint64_t operator()(const FixedPointCoordinate &current_coordinate) const;
HilbertCode() {}
HilbertCode(const HilbertCode &) = delete;
private:
inline uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const;
inline void TransposeCoordinate(uint32_t *X) const;
};
#endif /* HILBERTVALUE_H_ */

View File

@ -1,178 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IMPORT_EDGE_H
#define IMPORT_EDGE_H
#include "../Util/OSRMException.h"
#include "../typedefs.h"
#include <boost/assert.hpp>
class NodeBasedEdge
{
public:
bool operator<(const NodeBasedEdge &e) const
{
if (source() == e.source())
{
if (target() == e.target())
{
if (weight() == e.weight())
{
return (isForward() && isBackward() && ((!e.isForward()) || (!e.isBackward())));
}
return (weight() < e.weight());
}
return (target() < e.target());
}
return (source() < e.source());
}
explicit NodeBasedEdge(NodeID s,
NodeID t,
NodeID n,
EdgeWeight w,
bool f,
bool b,
short ty,
bool ra,
bool ig,
bool ar,
bool cf,
bool is_split)
: _source(s), _target(t), _name(n), _weight(w), _type(ty), forward(f), backward(b),
_roundabout(ra), _ignoreInGrid(ig), _accessRestricted(ar), _contraFlow(cf),
is_split(is_split)
{
if (ty < 0)
{
throw OSRMException("negative edge type");
}
}
NodeID target() const { return _target; }
NodeID source() const { return _source; }
NodeID name() const { return _name; }
EdgeWeight weight() const { return _weight; }
short type() const
{
BOOST_ASSERT_MSG(_type >= 0, "type of ImportEdge invalid");
return _type;
}
bool isBackward() const { return backward; }
bool isForward() const { return forward; }
bool isLocatable() const { return _type != 14; }
bool isRoundabout() const { return _roundabout; }
bool ignoreInGrid() const { return _ignoreInGrid; }
bool isAccessRestricted() const { return _accessRestricted; }
bool isContraFlow() const { return _contraFlow; }
bool IsSplit() const { return is_split; }
// TODO: names need to be fixed.
NodeID _source;
NodeID _target;
NodeID _name;
EdgeWeight _weight;
short _type;
bool forward : 1;
bool backward : 1;
bool _roundabout : 1;
bool _ignoreInGrid : 1;
bool _accessRestricted : 1;
bool _contraFlow : 1;
bool is_split : 1;
private:
NodeBasedEdge() {}
};
class EdgeBasedEdge
{
public:
bool operator<(const EdgeBasedEdge &e) const
{
if (source() == e.source())
{
if (target() == e.target())
{
if (weight() == e.weight())
{
return (isForward() && isBackward() && ((!e.isForward()) || (!e.isBackward())));
}
return (weight() < e.weight());
}
return (target() < e.target());
}
return (source() < e.source());
}
template <class EdgeT>
explicit EdgeBasedEdge(const EdgeT &myEdge)
: m_source(myEdge.source), m_target(myEdge.target), m_edgeID(myEdge.data.via),
m_weight(myEdge.data.distance), m_forward(myEdge.data.forward),
m_backward(myEdge.data.backward)
{
}
/** Default constructor. target and weight are set to 0.*/
EdgeBasedEdge()
: m_source(0), m_target(0), m_edgeID(0), m_weight(0), m_forward(false), m_backward(false)
{
}
explicit EdgeBasedEdge(const NodeID s,
const NodeID t,
const NodeID v,
const EdgeWeight w,
const bool f,
const bool b)
: m_source(s), m_target(t), m_edgeID(v), m_weight(w), m_forward(f), m_backward(b)
{
}
NodeID target() const { return m_target; }
NodeID source() const { return m_source; }
EdgeWeight weight() const { return m_weight; }
NodeID id() const { return m_edgeID; }
bool isBackward() const { return m_backward; }
bool isForward() const { return m_forward; }
private:
NodeID m_source;
NodeID m_target;
NodeID m_edgeID;
EdgeWeight m_weight : 30;
bool m_forward : 1;
bool m_backward : 1;
};
typedef NodeBasedEdge ImportEdge;
#endif /* IMPORT_EDGE_H */

View File

@ -1,123 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef INPUT_READER_FACTORY_H
#define INPUT_READER_FACTORY_H
#include <boost/assert.hpp>
#include <bzlib.h>
#include <libxml/xmlreader.h>
struct BZ2Context
{
FILE *file;
BZFILE *bz2;
int error;
int nUnused;
char unused[BZ_MAX_UNUSED];
};
int readFromBz2Stream(void *pointer, char *buffer, int len)
{
void *unusedTmpVoid = NULL;
char *unusedTmp = NULL;
BZ2Context *context = (BZ2Context *)pointer;
int read = 0;
while (0 == read &&
!(BZ_STREAM_END == context->error && 0 == context->nUnused && feof(context->file)))
{
read = BZ2_bzRead(&context->error, context->bz2, buffer, len);
if (BZ_OK == context->error)
{
return read;
}
else if (BZ_STREAM_END == context->error)
{
BZ2_bzReadGetUnused(&context->error, context->bz2, &unusedTmpVoid, &context->nUnused);
BOOST_ASSERT_MSG(BZ_OK == context->error, "Could not BZ2_bzReadGetUnused");
unusedTmp = (char *)unusedTmpVoid;
for (int i = 0; i < context->nUnused; i++)
{
context->unused[i] = unusedTmp[i];
}
BZ2_bzReadClose(&context->error, context->bz2);
BOOST_ASSERT_MSG(BZ_OK == context->error, "Could not BZ2_bzReadClose");
context->error = BZ_STREAM_END; // set to the stream end for next call to this function
if (0 == context->nUnused && feof(context->file))
{
return read;
}
else
{
context->bz2 = BZ2_bzReadOpen(
&context->error, context->file, 0, 0, context->unused, context->nUnused);
BOOST_ASSERT_MSG(NULL != context->bz2, "Could not open file");
}
}
else
{
BOOST_ASSERT_MSG(false, "Could not read bz2 file");
}
}
return read;
}
int closeBz2Stream(void *pointer)
{
BZ2Context *context = (BZ2Context *)pointer;
fclose(context->file);
delete context;
return 0;
}
xmlTextReaderPtr inputReaderFactory(const char *name)
{
std::string inputName(name);
if (inputName.find(".osm.bz2") != std::string::npos)
{
BZ2Context *context = new BZ2Context();
context->error = false;
context->file = fopen(name, "r");
int error;
context->bz2 =
BZ2_bzReadOpen(&error, context->file, 0, 0, context->unused, context->nUnused);
if (context->bz2 == NULL || context->file == NULL)
{
delete context;
return NULL;
}
return xmlReaderForIO(readFromBz2Stream, closeBz2Stream, (void *)context, NULL, NULL, 0);
}
else
{
return xmlNewTextReaderFilename(name);
}
}
#endif // INPUT_READER_FACTORY_H

View File

@ -1,237 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// based on https://svn.apache.org/repos/asf/mesos/tags/release-0.9.0-incubating-RC0/src/common/json.hpp
#ifndef JSON_CONTAINER_H
#define JSON_CONTAINER_H
#include "../Util/StringUtil.h"
#include <boost/variant.hpp>
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
namespace JSON
{
struct String;
struct Number;
struct Object;
struct Array;
struct True;
struct False;
struct Null;
typedef boost::variant<boost::recursive_wrapper<String>,
boost::recursive_wrapper<Number>,
boost::recursive_wrapper<Object>,
boost::recursive_wrapper<Array>,
boost::recursive_wrapper<True>,
boost::recursive_wrapper<False>,
boost::recursive_wrapper<Null> > Value;
struct String
{
String() {}
String(const char *value) : value(value) {}
String(const std::string &value) : value(value) {}
std::string value;
};
struct Number
{
Number() {}
Number(double value) : value(value) {}
double value;
};
struct Object
{
std::unordered_map<std::string, Value> values;
};
struct Array
{
std::vector<Value> values;
};
struct True
{
};
struct False
{
};
struct Null
{
};
struct Renderer : boost::static_visitor<>
{
Renderer(std::ostream &_out) : out(_out) {}
void operator()(const String &string) const { out << "\"" << string.value << "\""; }
void operator()(const Number &number) const
{
out.precision(10);
out << number.value;
}
void operator()(const Object &object) const
{
out << "{";
auto iterator = object.values.begin();
while (iterator != object.values.end())
{
out << "\"" << (*iterator).first << "\":";
boost::apply_visitor(Renderer(out), (*iterator).second);
if (++iterator != object.values.end())
{
out << ",";
}
}
out << "}";
}
void operator()(const Array &array) const
{
out << "[";
std::vector<Value>::const_iterator iterator;
iterator = array.values.begin();
while (iterator != array.values.end())
{
boost::apply_visitor(Renderer(out), *iterator);
if (++iterator != array.values.end())
{
out << ",";
}
}
out << "]";
}
void operator()(const True &) const { out << "true"; }
void operator()(const False &) const { out << "false"; }
void operator()(const Null &) const { out << "null"; }
private:
std::ostream &out;
};
struct ArrayRenderer : boost::static_visitor<>
{
ArrayRenderer(std::vector<char> &_out) : out(_out) {}
void operator()(const String &string) const {
out.push_back('\"');
out.insert(out.end(), string.value.begin(), string.value.end());
out.push_back('\"');
}
void operator()(const Number &number) const
{
const std::string number_string = FixedDoubleToString(number.value);
out.insert(out.end(), number_string.begin(), number_string.end());
}
void operator()(const Object &object) const
{
out.push_back('{');
auto iterator = object.values.begin();
while (iterator != object.values.end())
{
out.push_back('\"');
out.insert(out.end(), (*iterator).first.begin(), (*iterator).first.end());
out.push_back('\"');
out.push_back(':');
boost::apply_visitor(ArrayRenderer(out), (*iterator).second);
if (++iterator != object.values.end())
{
out.push_back(',');
}
}
out.push_back('}');
}
void operator()(const Array &array) const
{
out.push_back('[');
std::vector<Value>::const_iterator iterator;
iterator = array.values.begin();
while (iterator != array.values.end())
{
boost::apply_visitor(ArrayRenderer(out), *iterator);
if (++iterator != array.values.end())
{
out.push_back(',');
}
}
out.push_back(']');
}
void operator()(const True &) const {
const std::string temp("true");
out.insert(out.end(), temp.begin(), temp.end());
}
void operator()(const False &) const {
const std::string temp("false");
out.insert(out.end(), temp.begin(), temp.end());
}
void operator()(const Null &) const {
const std::string temp("null");
out.insert(out.end(), temp.begin(), temp.end());
}
private:
std::vector<char> &out;
};
inline void render(std::ostream &out, const Object &object)
{
Value value = object;
boost::apply_visitor(Renderer(out), value);
}
inline void render(std::vector<char> &out, const Object &object)
{
Value value = object;
boost::apply_visitor(ArrayRenderer(out), value);
}
} // namespace JSON
#endif // JSON_CONTAINER_H

View File

@ -1,97 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LRUCACHE_H
#define LRUCACHE_H
#include <list>
#include <unordered_map>
template <typename KeyT, typename ValueT> class LRUCache
{
private:
struct CacheEntry
{
CacheEntry(KeyT k, ValueT v) : key(k), value(v) {}
KeyT key;
ValueT value;
};
unsigned capacity;
std::list<CacheEntry> itemsInCache;
std::unordered_map<KeyT, typename std::list<CacheEntry>::iterator> positionMap;
public:
explicit LRUCache(unsigned c) : capacity(c) {}
bool Holds(KeyT key)
{
if (positionMap.find(key) != positionMap.end())
{
return true;
}
return false;
}
void Insert(const KeyT key, ValueT &value)
{
itemsInCache.push_front(CacheEntry(key, value));
positionMap.insert(std::make_pair(key, itemsInCache.begin()));
if (itemsInCache.size() > capacity)
{
positionMap.erase(itemsInCache.back().key);
itemsInCache.pop_back();
}
}
void Insert(const KeyT key, ValueT value)
{
itemsInCache.push_front(CacheEntry(key, value));
positionMap.insert(std::make_pair(key, itemsInCache.begin()));
if (itemsInCache.size() > capacity)
{
positionMap.erase(itemsInCache.back().key);
itemsInCache.pop_back();
}
}
bool Fetch(const KeyT key, ValueT &result)
{
if (Holds(key))
{
CacheEntry e = *(positionMap.find(key)->second);
result = e.value;
// move to front
itemsInCache.splice(positionMap.find(key)->second, itemsInCache, itemsInCache.begin());
positionMap.find(key)->second = itemsInCache.begin();
return true;
}
return false;
}
unsigned Size() const { return itemsInCache.size(); }
};
#endif // LRUCACHE_H

View File

@ -1,110 +0,0 @@
#ifndef __NODE_BASED_GRAPH_H__
#define __NODE_BASED_GRAPH_H__
#include "DynamicGraph.h"
#include "ImportEdge.h"
#include <memory>
struct NodeBasedEdgeData
{
NodeBasedEdgeData()
: distance(INVALID_EDGE_WEIGHT), edgeBasedNodeID(SPECIAL_NODEID),
nameID(std::numeric_limits<unsigned>::max()), type(std::numeric_limits<short>::max()),
isAccessRestricted(false), shortcut(false), forward(false), backward(false),
roundabout(false), ignore_in_grid(false), contraFlow(false)
{
}
int distance;
unsigned edgeBasedNodeID;
unsigned nameID;
short type;
bool isAccessRestricted : 1;
bool shortcut : 1;
bool forward : 1;
bool backward : 1;
bool roundabout : 1;
bool ignore_in_grid : 1;
bool contraFlow : 1;
void SwapDirectionFlags()
{
bool temp_flag = forward;
forward = backward;
backward = temp_flag;
}
bool IsEqualTo(const NodeBasedEdgeData &other) const
{
return (forward == other.forward) && (backward == other.backward) &&
(nameID == other.nameID) && (ignore_in_grid == other.ignore_in_grid) &&
(contraFlow == other.contraFlow);
}
};
typedef DynamicGraph<NodeBasedEdgeData> NodeBasedDynamicGraph;
// Factory method to create NodeBasedDynamicGraph from ImportEdges
inline std::shared_ptr<NodeBasedDynamicGraph>
NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector<ImportEdge> &input_edge_list)
{
static_assert(sizeof(NodeBasedEdgeData) == 16, "changing node based edge data size changes memory consumption");
std::sort(input_edge_list.begin(), input_edge_list.end());
// TODO: remove duplicate edges
DeallocatingVector<NodeBasedDynamicGraph::InputEdge> edges_list;
NodeBasedDynamicGraph::InputEdge edge;
for (const ImportEdge &import_edge : input_edge_list)
{
// TODO: give ImportEdge a proper c'tor to use emplace_back's below
if (!import_edge.isForward())
{
edge.source = import_edge.target();
edge.target = import_edge.source();
edge.data.backward = import_edge.isForward();
edge.data.forward = import_edge.isBackward();
}
else
{
edge.source = import_edge.source();
edge.target = import_edge.target();
edge.data.forward = import_edge.isForward();
edge.data.backward = import_edge.isBackward();
}
if (edge.source == edge.target)
{
continue;
}
edge.data.distance = (std::max)((int)import_edge.weight(), 1);
BOOST_ASSERT(edge.data.distance > 0);
edge.data.shortcut = false;
edge.data.roundabout = import_edge.isRoundabout();
edge.data.ignore_in_grid = import_edge.ignoreInGrid();
edge.data.nameID = import_edge.name();
edge.data.type = import_edge.type();
edge.data.isAccessRestricted = import_edge.isAccessRestricted();
edge.data.contraFlow = import_edge.isContraFlow();
edges_list.push_back(edge);
if (!import_edge.IsSplit())
{
using std::swap; // enable ADL
swap(edge.source, edge.target);
edge.data.SwapDirectionFlags();
edges_list.push_back(edge);
}
}
std::sort(edges_list.begin(), edges_list.end());
auto graph = std::make_shared<NodeBasedDynamicGraph>(number_of_nodes, edges_list);
edges_list.clear();
BOOST_ASSERT(0 == edges_list.size());
return graph;
}
#endif // __NODE_BASED_GRAPH_H__

View File

@ -1,60 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ORIGINAL_EDGE_DATA_H
#define ORIGINAL_EDGE_DATA_H
#include "TurnInstructions.h"
#include "../typedefs.h"
#include <limits>
struct OriginalEdgeData
{
explicit OriginalEdgeData(NodeID via_node,
unsigned name_id,
TurnInstruction turn_instruction,
bool compressed_geometry)
: via_node(via_node), name_id(name_id), turn_instruction(turn_instruction),
compressed_geometry(compressed_geometry)
{
}
OriginalEdgeData()
: via_node(std::numeric_limits<unsigned>::max()),
name_id(std::numeric_limits<unsigned>::max()),
turn_instruction(TurnInstruction::NoTurn), compressed_geometry(false)
{
}
NodeID via_node;
unsigned name_id;
TurnInstruction turn_instruction;
bool compressed_geometry;
};
#endif // ORIGINAL_EDGE_DATA_H

View File

@ -1,103 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PERCENT_H
#define PERCENT_H
#include "../Util/OpenMPWrapper.h"
#include <iostream>
class Percent
{
public:
explicit Percent(unsigned max_value, unsigned step = 5) { reinit(max_value, step); }
// Reinitializes
void reinit(unsigned max_value, unsigned step = 5)
{
m_max_value = max_value;
m_current_value = 0;
m_percent_interval = m_max_value / 100;
m_next_threshold = m_percent_interval;
m_last_percent = 0;
m_step = step;
}
// If there has been significant progress, display it.
void printStatus(unsigned current_value)
{
if (current_value >= m_next_threshold)
{
m_next_threshold += m_percent_interval;
printPercent(current_value / (double)m_max_value * 100);
}
if (current_value + 1 == m_max_value)
std::cout << " 100%" << std::endl;
}
void printIncrement()
{
#pragma omp atomic
++m_current_value;
printStatus(m_current_value);
}
void printAddition(const unsigned addition)
{
#pragma omp atomic
m_current_value += addition;
printStatus(m_current_value);
}
private:
unsigned m_current_value;
unsigned m_max_value;
unsigned m_percent_interval;
unsigned m_next_threshold;
unsigned m_last_percent;
unsigned m_step;
// Displays progress.
void printPercent(double percent)
{
while (percent >= m_last_percent + m_step)
{
m_last_percent += m_step;
if (m_last_percent % 10 == 0)
{
std::cout << " " << m_last_percent << "% ";
}
else
{
std::cout << ".";
}
std::cout.flush();
}
}
};
#endif // PERCENT_H

View File

@ -1,180 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PHANTOM_NODES_H
#define PHANTOM_NODES_H
#include <osrm/Coordinate.h>
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
struct PhantomNode
{
PhantomNode() :
forward_node_id(SPECIAL_NODEID),
reverse_node_id(SPECIAL_NODEID),
name_id(std::numeric_limits<unsigned>::max()),
forward_weight(INVALID_EDGE_WEIGHT),
reverse_weight(INVALID_EDGE_WEIGHT),
forward_offset(0),
reverse_offset(0),
packed_geometry_id(SPECIAL_EDGEID),
fwd_segment_position(0)
{ }
NodeID forward_node_id;
NodeID reverse_node_id;
unsigned name_id;
int forward_weight;
int reverse_weight;
int forward_offset;
int reverse_offset;
unsigned packed_geometry_id;
FixedPointCoordinate location;
unsigned short fwd_segment_position;
int GetForwardWeightPlusOffset() const
{
if (SPECIAL_NODEID == forward_node_id)
{
return 0;
}
const int result = (forward_offset + forward_weight);
return result;
}
int GetReverseWeightPlusOffset() const
{
if (SPECIAL_NODEID == reverse_node_id)
{
return 0;
}
const int result = (reverse_offset + reverse_weight);
return result;
}
void Reset()
{
forward_node_id = SPECIAL_NODEID;
name_id = SPECIAL_NODEID;
forward_weight = INVALID_EDGE_WEIGHT;
reverse_weight = INVALID_EDGE_WEIGHT;
forward_offset = 0;
reverse_offset = 0;
location.Reset();
}
bool isBidirected() const
{
return (forward_node_id != SPECIAL_NODEID) &&
(reverse_node_id != SPECIAL_NODEID);
}
bool IsCompressed() const
{
return (forward_offset != 0) || (reverse_offset != 0);
}
bool isValid(const unsigned numberOfNodes) const
{
return
location.isValid() &&
(
(forward_node_id < numberOfNodes) ||
(reverse_node_id < numberOfNodes)
) &&
(
(forward_weight != INVALID_EDGE_WEIGHT) ||
(reverse_weight != INVALID_EDGE_WEIGHT)
) &&
(name_id != std::numeric_limits<unsigned>::max()
);
}
bool isValid() const
{
return location.isValid() &&
(name_id != std::numeric_limits<unsigned>::max());
}
bool operator==(const PhantomNode & other) const
{
return location == other.location;
}
};
struct PhantomNodes
{
PhantomNode source_phantom;
PhantomNode target_phantom;
void Reset()
{
source_phantom.Reset();
target_phantom.Reset();
}
bool PhantomsAreOnSameNodeBasedEdge() const
{
return (source_phantom.forward_node_id == target_phantom.forward_node_id);
}
bool AtLeastOnePhantomNodeIsInvalid() const
{
return ((source_phantom.forward_node_id == SPECIAL_NODEID) && (source_phantom.reverse_node_id == SPECIAL_NODEID)) ||
((target_phantom.forward_node_id == SPECIAL_NODEID) && (target_phantom.reverse_node_id == SPECIAL_NODEID));
}
bool PhantomNodesHaveEqualLocation() const
{
return source_phantom == target_phantom;
}
};
inline std::ostream& operator<<(std::ostream &out, const PhantomNodes & pn)
{
out << "source_coord: " << pn.source_phantom.location << "\n";
out << "target_coord: " << pn.target_phantom.location << std::endl;
return out;
}
inline std::ostream& operator<<(std::ostream &out, const PhantomNode & pn)
{
out << "node1: " << pn.forward_node_id << ", " <<
"node2: " << pn.reverse_node_id << ", " <<
"name: " << pn.name_id << ", " <<
"fwd-w: " << pn.forward_weight << ", " <<
"rev-w: " << pn.reverse_weight << ", " <<
"fwd-o: " << pn.forward_offset << ", " <<
"rev-o: " << pn.reverse_offset << ", " <<
"geom: " << pn.packed_geometry_id << ", " <<
"pos: " << pn.fwd_segment_position << ", " <<
"loc: " << pn.location;
return out;
}
#endif // PHANTOM_NODES_H

View File

@ -1,64 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef QUERYEDGE_H_
#define QUERYEDGE_H_
#include "../typedefs.h"
struct QueryEdge
{
NodeID source;
NodeID target;
struct EdgeData
{
NodeID id : 31;
bool shortcut : 1;
int distance : 30;
bool forward : 1;
bool backward : 1;
} data;
bool operator<(const QueryEdge &right) const
{
if (source != right.source)
{
return source < right.source;
}
return target < right.target;
}
bool operator==(const QueryEdge &right) const
{
return (source == right.source && target == right.target &&
data.distance == right.data.distance && data.shortcut == right.data.shortcut &&
data.forward == right.data.forward && data.backward == right.data.backward &&
data.id == right.data.id);
}
};
#endif /* QUERYEDGE_H_ */

View File

@ -1,85 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef QUERY_NODE_H
#define QUERY_NODE_H
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <boost/assert.hpp>
#include <limits>
struct NodeInfo
{
typedef NodeID key_type; // type of NodeID
typedef int value_type; // type of lat,lons
NodeInfo(int lat, int lon, NodeID id) : lat(lat), lon(lon), id(id) {}
NodeInfo()
: lat(std::numeric_limits<int>::max()), lon(std::numeric_limits<int>::max()),
id(std::numeric_limits<unsigned>::max())
{
}
int lat;
int lon;
NodeID id;
static NodeInfo min_value()
{
return NodeInfo(-90 * COORDINATE_PRECISION,
-180 * COORDINATE_PRECISION,
std::numeric_limits<NodeID>::min());
}
static NodeInfo max_value()
{
return NodeInfo(90 * COORDINATE_PRECISION,
180 * COORDINATE_PRECISION,
std::numeric_limits<NodeID>::max());
}
value_type operator[](const std::size_t n) const
{
switch (n)
{
case 1:
return lat;
case 0:
return lon;
default:
break;
}
BOOST_ASSERT_MSG(false, "should not happen");
return std::numeric_limits<unsigned>::max();
}
};
#endif // QUERY_NODE_H

View File

@ -1,84 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RAW_ROUTE_DATA_H
#define RAW_ROUTE_DATA_H
#include "../DataStructures/PhantomNodes.h"
#include "../DataStructures/TurnInstructions.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <limits>
#include <vector>
struct PathData
{
PathData()
: node(std::numeric_limits<unsigned>::max()), name_id(std::numeric_limits<unsigned>::max()),
segment_duration(std::numeric_limits<unsigned>::max()),
turn_instruction(TurnInstruction::NoTurn)
{
}
PathData(NodeID node, unsigned name_id, TurnInstruction turn_instruction, unsigned segment_duration)
: node(node), name_id(name_id), segment_duration(segment_duration), turn_instruction(turn_instruction)
{
}
NodeID node;
unsigned name_id;
unsigned segment_duration;
TurnInstruction turn_instruction;
};
struct RawRouteData
{
std::vector<std::vector<PathData>> unpacked_path_segments;
std::vector<PathData> unpacked_alternative;
std::vector<PhantomNodes> segment_end_coordinates;
std::vector<FixedPointCoordinate> raw_via_node_coordinates;
unsigned check_sum;
int shortest_path_length;
int alternative_path_length;
bool source_traversed_in_reverse;
bool target_traversed_in_reverse;
bool alt_source_traversed_in_reverse;
bool alt_target_traversed_in_reverse;
RawRouteData()
: check_sum(std::numeric_limits<unsigned>::max()),
shortest_path_length(std::numeric_limits<int>::max()),
alternative_path_length(std::numeric_limits<int>::max()),
source_traversed_in_reverse(false), target_traversed_in_reverse(false),
alt_source_traversed_in_reverse(false), alt_target_traversed_in_reverse(false)
{
}
};
#endif // RAW_ROUTE_DATA_H

View File

@ -1,126 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RESTRICTION_H
#define RESTRICTION_H
#include "../typedefs.h"
#include <limits>
struct TurnRestriction
{
NodeID viaNode;
NodeID fromNode;
NodeID toNode;
struct Bits
{ // mostly unused
Bits()
: isOnly(false), unused1(false), unused2(false), unused3(false), unused4(false),
unused5(false), unused6(false), unused7(false)
{
}
bool isOnly : 1;
bool unused1 : 1;
bool unused2 : 1;
bool unused3 : 1;
bool unused4 : 1;
bool unused5 : 1;
bool unused6 : 1;
bool unused7 : 1;
} flags;
explicit TurnRestriction(NodeID viaNode)
: viaNode(viaNode), fromNode(std::numeric_limits<unsigned>::max()),
toNode(std::numeric_limits<unsigned>::max())
{
}
explicit TurnRestriction(const bool isOnly = false)
: viaNode(std::numeric_limits<unsigned>::max()),
fromNode(std::numeric_limits<unsigned>::max()),
toNode(std::numeric_limits<unsigned>::max())
{
flags.isOnly = isOnly;
}
};
struct InputRestrictionContainer
{
EdgeID fromWay;
EdgeID toWay;
unsigned viaNode;
TurnRestriction restriction;
InputRestrictionContainer(EdgeID fromWay, EdgeID toWay, NodeID vn, unsigned vw)
: fromWay(fromWay), toWay(toWay), viaNode(vw)
{
restriction.viaNode = vn;
}
explicit InputRestrictionContainer(bool isOnly = false)
: fromWay(std::numeric_limits<unsigned>::max()),
toWay(std::numeric_limits<unsigned>::max()), viaNode(std::numeric_limits<unsigned>::max())
{
restriction.flags.isOnly = isOnly;
}
static InputRestrictionContainer min_value() { return InputRestrictionContainer(0, 0, 0, 0); }
static InputRestrictionContainer max_value()
{
return InputRestrictionContainer(std::numeric_limits<unsigned>::max(),
std::numeric_limits<unsigned>::max(),
std::numeric_limits<unsigned>::max(),
std::numeric_limits<unsigned>::max());
}
};
struct CmpRestrictionContainerByFrom
{
typedef InputRestrictionContainer value_type;
inline bool operator()(const InputRestrictionContainer &a, const InputRestrictionContainer &b)
const
{
return a.fromWay < b.fromWay;
}
inline value_type max_value() const { return InputRestrictionContainer::max_value(); }
inline value_type min_value() const { return InputRestrictionContainer::min_value(); }
};
struct CmpRestrictionContainerByTo
{
typedef InputRestrictionContainer value_type;
inline bool operator()(const InputRestrictionContainer &a, const InputRestrictionContainer &b)
const
{
return a.toWay < b.toWay;
}
value_type max_value() const { return InputRestrictionContainer::max_value(); }
value_type min_value() const { return InputRestrictionContainer::min_value(); }
};
#endif // RESTRICTION_H

View File

@ -1,215 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "RestrictionMap.h"
#include "NodeBasedGraph.h"
#include "../Util/SimpleLogger.h"
bool RestrictionMap::IsNodeAViaNode(const NodeID node) const
{
return m_no_turn_via_node_set.find(node) != m_no_turn_via_node_set.end();
}
RestrictionMap::RestrictionMap(const std::shared_ptr<NodeBasedDynamicGraph> &graph,
const std::vector<TurnRestriction> &input_restrictions_list)
: m_count(0), m_graph(graph)
{
// decompose restriction consisting of a start, via and end node into a
// a pair of starting edge and a list of all end nodes
for (auto &restriction : input_restrictions_list)
{
m_restriction_start_nodes.insert(restriction.fromNode);
m_no_turn_via_node_set.insert(restriction.viaNode);
std::pair<NodeID, NodeID> restriction_source = {restriction.fromNode, restriction.viaNode};
unsigned index;
auto restriction_iter = m_restriction_map.find(restriction_source);
if (restriction_iter == m_restriction_map.end())
{
index = m_restriction_bucket_list.size();
m_restriction_bucket_list.resize(index + 1);
m_restriction_map.emplace(restriction_source, index);
}
else
{
index = restriction_iter->second;
// Map already contains an is_only_*-restriction
if (m_restriction_bucket_list.at(index).begin()->second)
{
continue;
}
else if (restriction.flags.isOnly)
{
// We are going to insert an is_only_*-restriction. There can be only one.
m_count -= m_restriction_bucket_list.at(index).size();
m_restriction_bucket_list.at(index).clear();
}
}
++m_count;
m_restriction_bucket_list.at(index)
.emplace_back(restriction.toNode, restriction.flags.isOnly);
}
}
// Replace end v with w in each turn restriction containing u as via node
void RestrictionMap::FixupArrivingTurnRestriction(const NodeID u, const NodeID v, const NodeID w)
{
BOOST_ASSERT(u != SPECIAL_NODEID);
BOOST_ASSERT(v != SPECIAL_NODEID);
BOOST_ASSERT(w != SPECIAL_NODEID);
if (!RestrictionStartsAtNode(u))
{
return;
}
// find all potential start edges
// it is more efficent to get a (small) list of potential start edges than iterating over all buckets
std::vector<NodeID> predecessors;
for (const EdgeID current_edge_id : m_graph->GetAdjacentEdgeRange(u))
{
const EdgeData &edge_data = m_graph->GetEdgeData(current_edge_id);
const NodeID target = m_graph->GetTarget(current_edge_id);
if (edge_data.backward && (v != target))
{
predecessors.push_back(target);
}
}
for (const NodeID x : predecessors)
{
auto restriction_iterator = m_restriction_map.find({x, u});
if (restriction_iterator == m_restriction_map.end())
{
continue;
}
const unsigned index = restriction_iterator->second;
auto &bucket = m_restriction_bucket_list.at(index);
for (RestrictionTarget &restriction_target : bucket)
{
if (v == restriction_target.first)
{
restriction_target.first = w;
}
}
}
}
// Replaces start edge (v, w) with (u, w). Only start node changes.
void RestrictionMap::FixupStartingTurnRestriction(const NodeID u, const NodeID v, const NodeID w)
{
BOOST_ASSERT(u != SPECIAL_NODEID);
BOOST_ASSERT(v != SPECIAL_NODEID);
BOOST_ASSERT(w != SPECIAL_NODEID);
if (!RestrictionStartsAtNode(u))
{
return;
}
const auto restriction_iterator = m_restriction_map.find({v, w});
if (restriction_iterator != m_restriction_map.end())
{
const unsigned index = restriction_iterator->second;
// remove old restriction start (v,w)
m_restriction_map.erase(restriction_iterator);
// insert new restriction start (u,w) (point to index)
RestrictionSource new_source = {u, w};
m_restriction_map.emplace(new_source, index);
}
}
// Check if edge (u, v) is the start of any turn restriction.
// If so returns id of first target node.
NodeID RestrictionMap::CheckForEmanatingIsOnlyTurn(const NodeID u, const NodeID v) const
{
BOOST_ASSERT(u != SPECIAL_NODEID);
BOOST_ASSERT(v != SPECIAL_NODEID);
if (!RestrictionStartsAtNode(u))
{
return SPECIAL_NODEID;
}
auto restriction_iter = m_restriction_map.find({u, v});
if (restriction_iter != m_restriction_map.end())
{
const unsigned index = restriction_iter->second;
auto &bucket = m_restriction_bucket_list.at(index);
for (const RestrictionSource &restriction_target : bucket)
{
if (restriction_target.second)
{
return restriction_target.first;
}
}
}
return SPECIAL_NODEID;
}
// Checks if turn <u,v,w> is actually a turn restriction.
bool RestrictionMap::CheckIfTurnIsRestricted(const NodeID u, const NodeID v, const NodeID w) const
{
BOOST_ASSERT(u != SPECIAL_NODEID);
BOOST_ASSERT(v != SPECIAL_NODEID);
BOOST_ASSERT(w != SPECIAL_NODEID);
if (!RestrictionStartsAtNode(u))
{
return false;
}
auto restriction_iter = m_restriction_map.find({u, v});
if (restriction_iter != m_restriction_map.end())
{
const unsigned index = restriction_iter->second;
const auto &bucket = m_restriction_bucket_list.at(index);
for (const RestrictionTarget &restriction_target : bucket)
{
if ((w == restriction_target.first) && // target found
(!restriction_target.second)) // and not an only_-restr.
{
return true;
}
}
}
return false;
}
// check of node is the start of any restriction
bool RestrictionMap::RestrictionStartsAtNode(const NodeID node) const
{
if (m_restriction_start_nodes.find(node) == m_restriction_start_nodes.end())
{
return false;
}
return true;
}

View File

@ -1,74 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __RESTRICTION_MAP_H__
#define __RESTRICTION_MAP_H__
#include <memory>
#include "DynamicGraph.h"
#include "Restriction.h"
#include "NodeBasedGraph.h"
#include "../Util/StdHashExtensions.h"
#include "../typedefs.h"
#include <unordered_map>
#include <unordered_set>
// Efficent look up if an edge is the start + via node of a TurnRestriction
// EdgeBasedEdgeFactory decides by it if edges are inserted or geometry is compressed
class RestrictionMap
{
public:
RestrictionMap(const std::shared_ptr<NodeBasedDynamicGraph> &graph,
const std::vector<TurnRestriction> &input_restrictions_list);
void FixupArrivingTurnRestriction(const NodeID u, const NodeID v, const NodeID w);
void FixupStartingTurnRestriction(const NodeID u, const NodeID v, const NodeID w);
NodeID CheckForEmanatingIsOnlyTurn(const NodeID u, const NodeID v) const;
bool CheckIfTurnIsRestricted(const NodeID u, const NodeID v, const NodeID w) const;
bool IsNodeAViaNode(const NodeID node) const;
unsigned size() { return m_count; }
private:
bool RestrictionStartsAtNode(const NodeID node) const;
typedef std::pair<NodeID, NodeID> RestrictionSource;
typedef std::pair<NodeID, bool> RestrictionTarget;
typedef std::vector<RestrictionTarget> EmanatingRestrictionsVector;
typedef NodeBasedDynamicGraph::EdgeData EdgeData;
unsigned m_count;
std::shared_ptr<NodeBasedDynamicGraph> m_graph;
//! index -> list of (target, isOnly)
std::vector<EmanatingRestrictionsVector> m_restriction_bucket_list;
//! maps (start, via) -> bucket index
std::unordered_map<RestrictionSource, unsigned> m_restriction_map;
std::unordered_set<NodeID> m_restriction_start_nodes;
std::unordered_set<NodeID> m_no_turn_via_node_set;
};
#endif

View File

@ -1,82 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <osrm/RouteParameters.h>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/sequence/intrinsic.hpp>
#include <boost/fusion/include/at_c.hpp>
RouteParameters::RouteParameters()
: zoom_level(18), print_instructions(false), alternate_route(true), geometry(true),
compression(true), deprecatedAPI(false), check_sum(-1)
{
}
void RouteParameters::setZoomLevel(const short level)
{
if (18 >= level && 0 <= level)
{
zoom_level = level;
}
}
void RouteParameters::setAlternateRouteFlag(const bool flag) { alternate_route = flag; }
void RouteParameters::setDeprecatedAPIFlag(const std::string &) { deprecatedAPI = true; }
void RouteParameters::setChecksum(const unsigned sum) { check_sum = sum; }
void RouteParameters::setInstructionFlag(const bool flag) { print_instructions = flag; }
void RouteParameters::setService(const std::string &service_string) { service = service_string; }
void RouteParameters::setOutputFormat(const std::string &format) { output_format = format; }
void RouteParameters::setJSONpParameter(const std::string &parameter) { jsonp_parameter = parameter; }
void RouteParameters::addHint(const std::string &hint)
{
hints.resize(coordinates.size());
if (!hints.empty())
{
hints.back() = hint;
}
}
void RouteParameters::setLanguage(const std::string &language_string) { language = language_string; }
void RouteParameters::setGeometryFlag(const bool flag) { geometry = flag; }
void RouteParameters::setCompressionFlag(const bool flag) { compression = flag; }
void RouteParameters::addCoordinate(const boost::fusion::vector<double, double> &transmitted_coordinates)
{
const int lat = COORDINATE_PRECISION * boost::fusion::at_c<0>(transmitted_coordinates);
const int lon = COORDINATE_PRECISION * boost::fusion::at_c<1>(transmitted_coordinates);
coordinates.emplace_back(lat, lon);
}

View File

@ -1,60 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SEARCHENGINE_H
#define SEARCHENGINE_H
#include "SearchEngineData.h"
#include "../RoutingAlgorithms/AlternativePathRouting.h"
#include "../RoutingAlgorithms/ManyToManyRouting.h"
#include "../RoutingAlgorithms/ShortestPathRouting.h"
#include <type_traits>
template <class DataFacadeT> class SearchEngine
{
private:
DataFacadeT *facade;
SearchEngineData engine_working_data;
public:
ShortestPathRouting<DataFacadeT> shortest_path;
AlternativeRouting<DataFacadeT> alternative_path;
ManyToManyRouting<DataFacadeT> distance_table;
explicit SearchEngine(DataFacadeT *facade)
: facade(facade), shortest_path(facade, engine_working_data),
alternative_path(facade, engine_working_data), distance_table(facade, engine_working_data)
{
static_assert(!std::is_pointer<DataFacadeT>(), "don't instantiate with ptr type");
static_assert(std::is_object<DataFacadeT>(), "don't instantiate with void, function, or reference");
}
~SearchEngine() {}
};
#endif // SEARCHENGINE_H

View File

@ -1,91 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SearchEngineData.h"
void SearchEngineData::InitializeOrClearFirstThreadLocalStorage(const unsigned number_of_nodes)
{
if (forwardHeap.get())
{
forwardHeap->Clear();
}
else
{
forwardHeap.reset(new QueryHeap(number_of_nodes));
}
if (backwardHeap.get())
{
backwardHeap->Clear();
}
else
{
backwardHeap.reset(new QueryHeap(number_of_nodes));
}
}
void SearchEngineData::InitializeOrClearSecondThreadLocalStorage(const unsigned number_of_nodes)
{
if (forwardHeap2.get())
{
forwardHeap2->Clear();
}
else
{
forwardHeap2.reset(new QueryHeap(number_of_nodes));
}
if (backwardHeap2.get())
{
backwardHeap2->Clear();
}
else
{
backwardHeap2.reset(new QueryHeap(number_of_nodes));
}
}
void SearchEngineData::InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes)
{
if (forwardHeap3.get())
{
forwardHeap3->Clear();
}
else
{
forwardHeap3.reset(new QueryHeap(number_of_nodes));
}
if (backwardHeap3.get())
{
backwardHeap3->Clear();
}
else
{
backwardHeap3.reset(new QueryHeap(number_of_nodes));
}
}

View File

@ -1,66 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SEARCH_ENGINE_DATA_H
#define SEARCH_ENGINE_DATA_H
#include "BinaryHeap.h"
#include "QueryEdge.h"
#include "StaticGraph.h"
#include "../typedefs.h"
#include <boost/thread.hpp>
#include <vector>
struct HeapData
{
NodeID parent;
/* explicit */ HeapData(NodeID p) : parent(p) {}
};
struct SearchEngineData
{
typedef BinaryHeap<NodeID, NodeID, int, HeapData, UnorderedMapStorage<NodeID, int>> QueryHeap;
typedef boost::thread_specific_ptr<QueryHeap> SearchEngineHeapPtr;
static SearchEngineHeapPtr forwardHeap;
static SearchEngineHeapPtr backwardHeap;
static SearchEngineHeapPtr forwardHeap2;
static SearchEngineHeapPtr backwardHeap2;
static SearchEngineHeapPtr forwardHeap3;
static SearchEngineHeapPtr backwardHeap3;
void InitializeOrClearFirstThreadLocalStorage(const unsigned number_of_nodes);
void InitializeOrClearSecondThreadLocalStorage(const unsigned number_of_nodes);
void InitializeOrClearThirdThreadLocalStorage(const unsigned number_of_nodes);
};
#endif // SEARCH_ENGINE_DATA_H

View File

@ -1,70 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SEGMENT_INFORMATION_H
#define SEGMENT_INFORMATION_H
#include "TurnInstructions.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
// Struct fits everything in one cache line
struct SegmentInformation
{
FixedPointCoordinate location;
NodeID name_id;
unsigned duration;
double length;
short bearing; // more than enough [0..3600] fits into 12 bits
TurnInstruction turn_instruction;
bool necessary;
explicit SegmentInformation(const FixedPointCoordinate &location,
const NodeID name_id,
const unsigned duration,
const double length,
const TurnInstruction turn_instruction,
const bool necessary)
: location(location), name_id(name_id), duration(duration), length(length), bearing(0),
turn_instruction(turn_instruction), necessary(necessary)
{
}
explicit SegmentInformation(const FixedPointCoordinate &location,
const NodeID name_id,
const unsigned duration,
const double length,
const TurnInstruction turn_instruction)
: location(location), name_id(name_id), duration(duration), length(length), bearing(0),
turn_instruction(turn_instruction), necessary(turn_instruction != TurnInstruction::NoTurn)
{
}
};
#endif /* SEGMENT_INFORMATION_H */

View File

@ -1,233 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SHARED_MEMORY_FACTORY_H
#define SHARED_MEMORY_FACTORY_H
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <boost/interprocess/xsi_shared_memory.hpp>
#ifdef __linux__
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
// #include <cstring>
#include <cstdint>
#include <algorithm>
#include <exception>
struct OSRMLockFile
{
boost::filesystem::path operator()()
{
boost::filesystem::path temp_dir = boost::filesystem::temp_directory_path();
boost::filesystem::path lock_file = temp_dir / "osrm.lock";
return lock_file;
}
};
class SharedMemory
{
// Remove shared memory on destruction
class shm_remove
{
private:
int m_shmid;
bool m_initialized;
public:
void SetID(int shmid)
{
m_shmid = shmid;
m_initialized = true;
}
shm_remove() : m_shmid(INT_MIN), m_initialized(false) {}
shm_remove(const shm_remove &) = delete;
~shm_remove()
{
if (m_initialized)
{
SimpleLogger().Write(logDEBUG) << "automatic memory deallocation";
if (!boost::interprocess::xsi_shared_memory::remove(m_shmid))
{
SimpleLogger().Write(logDEBUG) << "could not deallocate id " << m_shmid;
}
}
}
};
public:
void *Ptr() const { return region.get_address(); }
SharedMemory() = delete;
SharedMemory(const SharedMemory &) = delete;
template <typename IdentifierT>
SharedMemory(const boost::filesystem::path &lock_file,
const IdentifierT id,
const uint64_t size = 0,
bool read_write = false,
bool remove_prev = true)
: key(lock_file.string().c_str(), id)
{
if (0 == size)
{ // read_only
shm = boost::interprocess::xsi_shared_memory(boost::interprocess::open_only, key);
region = boost::interprocess::mapped_region(
shm,
(read_write ? boost::interprocess::read_write : boost::interprocess::read_only));
}
else
{ // writeable pointer
// remove previously allocated mem
if (remove_prev)
{
Remove(key);
}
shm = boost::interprocess::xsi_shared_memory(
boost::interprocess::open_or_create, key, size);
#ifdef __linux__
if (-1 == shmctl(shm.get_shmid(), SHM_LOCK, 0))
{
if (ENOMEM == errno)
{
SimpleLogger().Write(logWARNING) << "could not lock shared memory to RAM";
}
}
#endif
region = boost::interprocess::mapped_region(shm, boost::interprocess::read_write);
remover.SetID(shm.get_shmid());
SimpleLogger().Write(logDEBUG) << "writeable memory allocated " << size << " bytes";
}
}
template <typename IdentifierT> static bool RegionExists(const IdentifierT id)
{
bool result = true;
try
{
OSRMLockFile lock_file;
boost::interprocess::xsi_key key(lock_file().string().c_str(), id);
result = RegionExists(key);
}
catch (...) { result = false; }
return result;
}
template <typename IdentifierT> static bool Remove(const IdentifierT id)
{
OSRMLockFile lock_file;
boost::interprocess::xsi_key key(lock_file().string().c_str(), id);
return Remove(key);
}
private:
static bool RegionExists(const boost::interprocess::xsi_key &key)
{
bool result = true;
try { boost::interprocess::xsi_shared_memory shm(boost::interprocess::open_only, key); }
catch (...) { result = false; }
return result;
}
static bool Remove(const boost::interprocess::xsi_key &key)
{
bool ret = false;
try
{
SimpleLogger().Write(logDEBUG) << "deallocating prev memory";
boost::interprocess::xsi_shared_memory xsi(boost::interprocess::open_only, key);
ret = boost::interprocess::xsi_shared_memory::remove(xsi.get_shmid());
}
catch (const boost::interprocess::interprocess_exception &e)
{
if (e.get_error_code() != boost::interprocess::not_found_error)
{
throw;
}
}
return ret;
}
boost::interprocess::xsi_key key;
boost::interprocess::xsi_shared_memory shm;
boost::interprocess::mapped_region region;
shm_remove remover;
};
template <class LockFileT = OSRMLockFile> class SharedMemoryFactory_tmpl
{
public:
template <typename IdentifierT>
static SharedMemory *Get(const IdentifierT &id,
const uint64_t size = 0,
bool read_write = false,
bool remove_prev = true)
{
try
{
LockFileT lock_file;
if (!boost::filesystem::exists(lock_file()))
{
if (0 == size)
{
throw OSRMException("lock file does not exist, exiting");
}
else
{
boost::filesystem::ofstream ofs(lock_file());
ofs.close();
}
}
return new SharedMemory(lock_file(), id, size, read_write, remove_prev);
}
catch (const boost::interprocess::interprocess_exception &e)
{
SimpleLogger().Write(logWARNING) << "caught exception: " << e.what() << ", code "
<< e.get_error_code();
throw OSRMException(e.what());
}
}
SharedMemoryFactory_tmpl() = delete;
SharedMemoryFactory_tmpl(const SharedMemoryFactory_tmpl &) = delete;
};
typedef SharedMemoryFactory_tmpl<> SharedMemoryFactory;
#endif /* SHARED_MEMORY_POINTER_FACTORY_H */

View File

@ -1,156 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SHARED_MEMORY_VECTOR_WRAPPER_H
#define SHARED_MEMORY_VECTOR_WRAPPER_H
#include "../Util/SimpleLogger.h"
#include <boost/assert.hpp>
#include <algorithm>
#include <iterator>
#include <type_traits>
#include <vector>
template <typename DataT> class ShMemIterator : public std::iterator<std::input_iterator_tag, DataT>
{
DataT *p;
public:
explicit ShMemIterator(DataT *x) : p(x) {}
ShMemIterator(const ShMemIterator &mit) : p(mit.p) {}
ShMemIterator &operator++()
{
++p;
return *this;
}
ShMemIterator operator++(int)
{
ShMemIterator tmp(*this);
operator++();
return tmp;
}
ShMemIterator operator+(std::ptrdiff_t diff)
{
ShMemIterator tmp(p + diff);
return tmp;
}
bool operator==(const ShMemIterator &rhs) { return p == rhs.p; }
bool operator!=(const ShMemIterator &rhs) { return p != rhs.p; }
DataT &operator*() { return *p; }
};
template <typename DataT> class SharedMemoryWrapper
{
private:
DataT *m_ptr;
std::size_t m_size;
public:
SharedMemoryWrapper() : m_ptr(nullptr), m_size(0) {}
SharedMemoryWrapper(DataT *ptr, std::size_t size) : m_ptr(ptr), m_size(size) {}
void swap(SharedMemoryWrapper<DataT> &other)
{
BOOST_ASSERT_MSG(m_size != 0 || other.size() != 0, "size invalid");
std::swap(m_size, other.m_size);
std::swap(m_ptr, other.m_ptr);
}
DataT &at(const std::size_t index) { return m_ptr[index]; }
const DataT &at(const std::size_t index) const { return m_ptr[index]; }
ShMemIterator<DataT> begin() const { return ShMemIterator<DataT>(m_ptr); }
ShMemIterator<DataT> end() const { return ShMemIterator<DataT>(m_ptr + m_size); }
std::size_t size() const { return m_size; }
bool empty() const { return 0 == size(); }
DataT &operator[](const unsigned index)
{
BOOST_ASSERT_MSG(index < m_size, "invalid size");
return m_ptr[index];
}
const DataT &operator[](const unsigned index) const
{
BOOST_ASSERT_MSG(index < m_size, "invalid size");
return m_ptr[index];
}
};
template <> class SharedMemoryWrapper<bool>
{
private:
unsigned *m_ptr;
std::size_t m_size;
public:
SharedMemoryWrapper() : m_ptr(nullptr), m_size(0) {}
SharedMemoryWrapper(unsigned *ptr, std::size_t size) : m_ptr(ptr), m_size(size) {}
void swap(SharedMemoryWrapper<bool> &other)
{
BOOST_ASSERT_MSG(m_size != 0 || other.size() != 0, "size invalid");
std::swap(m_size, other.m_size);
std::swap(m_ptr, other.m_ptr);
}
bool at(const std::size_t index) const
{
const unsigned bucket = index / 32;
const unsigned offset = index % 32;
return m_ptr[bucket] & (1 << offset);
}
std::size_t size() const { return m_size; }
bool empty() const { return 0 == size(); }
bool operator[](const unsigned index)
{
BOOST_ASSERT_MSG(index < m_size, "invalid size");
const unsigned bucket = index / 32;
const unsigned offset = index % 32;
return m_ptr[bucket] & (1 << offset);
}
};
template <typename DataT, bool UseSharedMemory> struct ShM
{
typedef typename std::conditional<UseSharedMemory,
SharedMemoryWrapper<DataT>,
std::vector<DataT>>::type vector;
};
#endif // SHARED_MEMORY_VECTOR_WRAPPER_H

View File

@ -1,229 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STATIC_GRAPH_H
#define STATIC_GRAPH_H
#include "../DataStructures/Percent.h"
#include "../DataStructures/SharedMemoryVectorWrapper.h"
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
#include <boost/range/irange.hpp>
#include <algorithm>
#include <limits>
#include <vector>
template <typename EdgeDataT, bool UseSharedMemory = false> class StaticGraph
{
public:
typedef decltype(boost::irange(0u,0u)) EdgeRange;
typedef NodeID NodeIterator;
typedef NodeID EdgeIterator;
typedef EdgeDataT EdgeData;
class InputEdge
{
public:
EdgeDataT data;
NodeIterator source;
NodeIterator target;
bool operator<(const InputEdge &right) const
{
if (source != right.source)
{
return source < right.source;
}
return target < right.target;
}
};
struct NodeArrayEntry
{
// index of the first edge
EdgeIterator first_edge;
};
struct EdgeArrayEntry
{
NodeID target;
EdgeDataT data;
};
EdgeRange GetAdjacentEdgeRange(const NodeID node) const
{
return boost::irange(BeginEdges(node), EndEdges(node));
}
StaticGraph(const int nodes, std::vector<InputEdge> &graph)
{
std::sort(graph.begin(), graph.end());
number_of_nodes = nodes;
number_of_edges = (EdgeIterator)graph.size();
node_array.resize(number_of_nodes + 1);
EdgeIterator edge = 0;
EdgeIterator position = 0;
for (NodeIterator node = 0; node <= number_of_nodes; ++node)
{
EdgeIterator last_edge = edge;
while (edge < number_of_edges && graph[edge].source == node)
{
++edge;
}
node_array[node].first_edge = position; //=edge
position += edge - last_edge; // remove
}
edge_array.resize(position); //(edge)
edge = 0;
for (NodeIterator node = 0; node < number_of_nodes; ++node)
{
EdgeIterator e = node_array[node + 1].first_edge;
for (EdgeIterator i = node_array[node].first_edge; i != e; ++i)
{
edge_array[i].target = graph[edge].target;
edge_array[i].data = graph[edge].data;
assert(edge_array[i].data.distance > 0);
edge++;
}
}
}
StaticGraph(typename ShM<NodeArrayEntry, UseSharedMemory>::vector &nodes,
typename ShM<EdgeArrayEntry, UseSharedMemory>::vector &edges)
{
number_of_nodes = nodes.size() - 1;
number_of_edges = edges.size();
node_array.swap(nodes);
edge_array.swap(edges);
#ifndef NDEBUG
Percent p(GetNumberOfNodes());
for (unsigned u = 0; u < GetNumberOfNodes(); ++u)
{
for (auto eid : GetAdjacentEdgeRange(u))
{
const unsigned v = GetTarget(eid);
const EdgeData &data = GetEdgeData(eid);
if (data.shortcut)
{
const EdgeID first_edge_id = FindEdgeInEitherDirection(u, data.id);
if (SPECIAL_EDGEID == first_edge_id)
{
SimpleLogger().Write(logWARNING) << "cannot find first segment of edge ("
<< u << "," << data.id << "," << v
<< "), eid: " << eid;
BOOST_ASSERT(false);
}
const EdgeID second_edge_id = FindEdgeInEitherDirection(data.id, v);
if (SPECIAL_EDGEID == second_edge_id)
{
SimpleLogger().Write(logWARNING) << "cannot find second segment of edge ("
<< u << "," << data.id << "," << v
<< "), eid: " << eid;
BOOST_ASSERT(false);
}
}
}
p.printIncrement();
}
#endif
}
unsigned GetNumberOfNodes() const { return number_of_nodes -1; }
unsigned GetNumberOfEdges() const { return number_of_edges; }
unsigned GetOutDegree(const NodeIterator n) const { return BeginEdges(n) - EndEdges(n) - 1; }
inline NodeIterator GetTarget(const EdgeIterator e) const
{
return NodeIterator(edge_array[e].target);
}
inline EdgeDataT &GetEdgeData(const EdgeIterator e) { return edge_array[e].data; }
const EdgeDataT &GetEdgeData(const EdgeIterator e) const { return edge_array[e].data; }
EdgeIterator BeginEdges(const NodeIterator n) const
{
return EdgeIterator(node_array.at(n).first_edge);
}
EdgeIterator EndEdges(const NodeIterator n) const
{
return EdgeIterator(node_array.at(n + 1).first_edge);
}
// searches for a specific edge
EdgeIterator FindEdge(const NodeIterator from, const NodeIterator to) const
{
EdgeIterator smallest_edge = SPECIAL_EDGEID;
EdgeWeight smallest_weight = INVALID_EDGE_WEIGHT;
for (auto edge : GetAdjacentEdgeRange(from))
{
const NodeID target = GetTarget(edge);
const EdgeWeight weight = GetEdgeData(edge).distance;
if (target == to && weight < smallest_weight)
{
smallest_edge = edge;
smallest_weight = weight;
}
}
return smallest_edge;
}
EdgeIterator FindEdgeInEitherDirection(const NodeIterator from, const NodeIterator to) const
{
EdgeIterator tmp = FindEdge(from, to);
return (SPECIAL_NODEID != tmp ? tmp : FindEdge(to, from));
}
EdgeIterator
FindEdgeIndicateIfReverse(const NodeIterator from, const NodeIterator to, bool &result) const
{
EdgeIterator current_iterator = FindEdge(from, to);
if (SPECIAL_NODEID == current_iterator)
{
current_iterator = FindEdge(to, from);
if (SPECIAL_NODEID != current_iterator)
{
result = true;
}
}
return current_iterator;
}
private:
NodeIterator number_of_nodes;
EdgeIterator number_of_edges;
typename ShM<NodeArrayEntry, UseSharedMemory>::vector node_array;
typename ShM<EdgeArrayEntry, UseSharedMemory>::vector edge_array;
};
#endif // STATIC_GRAPH_H

View File

@ -1,260 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// KD Tree coded by Christian Vetter, Monav Project
#ifndef STATICKDTREE_H_INCLUDED
#define STATICKDTREE_H_INCLUDED
#include <boost/assert.hpp>
#include <vector>
#include <algorithm>
#include <stack>
#include <limits>
namespace KDTree
{
#define KDTREE_BASESIZE (8)
template <unsigned k, typename T> class BoundingBox
{
public:
BoundingBox()
{
for (unsigned dim = 0; dim < k; ++dim)
{
min[dim] = std::numeric_limits<T>::min();
max[dim] = std::numeric_limits<T>::max();
}
}
T min[k];
T max[k];
};
struct NoData
{
};
template <unsigned k, typename T> class EuclidianMetric
{
public:
double operator()(const T left[k], const T right[k])
{
double result = 0;
for (unsigned i = 0; i < k; ++i)
{
double temp = (double)left[i] - (double)right[i];
result += temp * temp;
}
return result;
}
double operator()(const BoundingBox<k, T> &box, const T point[k])
{
T nearest[k];
for (unsigned dim = 0; dim < k; ++dim)
{
if (point[dim] < box.min[dim])
nearest[dim] = box.min[dim];
else if (point[dim] > box.max[dim])
nearest[dim] = box.max[dim];
else
nearest[dim] = point[dim];
}
return operator()(point, nearest);
}
};
template <unsigned k, typename T, typename Data = NoData, typename Metric = EuclidianMetric<k, T>>
class StaticKDTree
{
public:
struct InputPoint
{
T coordinates[k];
Data data;
bool operator==(const InputPoint &right)
{
for (int i = 0; i < k; i++)
{
if (coordinates[i] != right.coordinates[i])
return false;
}
return true;
}
};
explicit StaticKDTree(std::vector<InputPoint> *points)
{
BOOST_ASSERT(k > 0);
BOOST_ASSERT(points->size() > 0);
size = points->size();
kdtree = new InputPoint[size];
for (Iterator i = 0; i != size; ++i)
{
kdtree[i] = points->at(i);
for (unsigned dim = 0; dim < k; ++dim)
{
if (kdtree[i].coordinates[dim] < boundingBox.min[dim])
boundingBox.min[dim] = kdtree[i].coordinates[dim];
if (kdtree[i].coordinates[dim] > boundingBox.max[dim])
boundingBox.max[dim] = kdtree[i].coordinates[dim];
}
}
std::stack<Tree> s;
s.push(Tree(0, size, 0));
while (!s.empty())
{
Tree tree = s.top();
s.pop();
if (tree.right - tree.left < KDTREE_BASESIZE)
continue;
Iterator middle = tree.left + (tree.right - tree.left) / 2;
std::nth_element(
kdtree + tree.left, kdtree + middle, kdtree + tree.right, Less(tree.dimension));
s.push(Tree(tree.left, middle, (tree.dimension + 1) % k));
s.push(Tree(middle + 1, tree.right, (tree.dimension + 1) % k));
}
}
~StaticKDTree() { delete[] kdtree; }
bool NearestNeighbor(InputPoint *result, const InputPoint &point)
{
Metric distance;
bool found = false;
double nearestDistance = std::numeric_limits<T>::max();
std::stack<NNTree> s;
s.push(NNTree(0, size, 0, boundingBox));
while (!s.empty())
{
NNTree tree = s.top();
s.pop();
if (distance(tree.box, point.coordinates) >= nearestDistance)
continue;
if (tree.right - tree.left < KDTREE_BASESIZE)
{
for (unsigned i = tree.left; i < tree.right; i++)
{
double newDistance = distance(kdtree[i].coordinates, point.coordinates);
if (newDistance < nearestDistance)
{
nearestDistance = newDistance;
*result = kdtree[i];
found = true;
}
}
continue;
}
Iterator middle = tree.left + (tree.right - tree.left) / 2;
double newDistance = distance(kdtree[middle].coordinates, point.coordinates);
if (newDistance < nearestDistance)
{
nearestDistance = newDistance;
*result = kdtree[middle];
found = true;
}
Less comperator(tree.dimension);
if (!comperator(point, kdtree[middle]))
{
NNTree first(middle + 1, tree.right, (tree.dimension + 1) % k, tree.box);
NNTree second(tree.left, middle, (tree.dimension + 1) % k, tree.box);
first.box.min[tree.dimension] = kdtree[middle].coordinates[tree.dimension];
second.box.max[tree.dimension] = kdtree[middle].coordinates[tree.dimension];
s.push(second);
s.push(first);
}
else
{
NNTree first(middle + 1, tree.right, (tree.dimension + 1) % k, tree.box);
NNTree second(tree.left, middle, (tree.dimension + 1) % k, tree.box);
first.box.min[tree.dimension] = kdtree[middle].coordinates[tree.dimension];
second.box.max[tree.dimension] = kdtree[middle].coordinates[tree.dimension];
s.push(first);
s.push(second);
}
}
return found;
}
private:
typedef unsigned Iterator;
struct Tree
{
Iterator left;
Iterator right;
unsigned dimension;
Tree() {}
Tree(Iterator l, Iterator r, unsigned d) : left(l), right(r), dimension(d) {}
};
struct NNTree
{
Iterator left;
Iterator right;
unsigned dimension;
BoundingBox<k, T> box;
NNTree() {}
NNTree(Iterator l, Iterator r, unsigned d, const BoundingBox<k, T> &b)
: left(l), right(r), dimension(d), box(b)
{
}
};
class Less
{
public:
explicit Less(unsigned d)
{
dimension = d;
BOOST_ASSERT(dimension < k);
}
bool operator()(const InputPoint &left, const InputPoint &right)
{
BOOST_ASSERT(dimension < k);
return left.coordinates[dimension] < right.coordinates[dimension];
}
private:
unsigned dimension;
};
BoundingBox<k, T> boundingBox;
InputPoint *kdtree;
Iterator size;
};
}
#endif // STATICKDTREE_H_INCLUDED

View File

@ -1,781 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STATICRTREE_H
#define STATICRTREE_H
#include "DeallocatingVector.h"
#include "HilbertValue.h"
#include "PhantomNodes.h"
#include "QueryNode.h"
#include "SharedMemoryFactory.h"
#include "SharedMemoryVectorWrapper.h"
#include "../Util/MercatorUtil.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/thread.hpp>
#include <algorithm>
#include <array>
#include <chrono>
#include <limits>
#include <memory>
#include <queue>
#include <string>
#include <vector>
// tuning parameters
const static uint32_t RTREE_BRANCHING_FACTOR = 64;
const static uint32_t RTREE_LEAF_NODE_SIZE = 1024;
static boost::thread_specific_ptr<boost::filesystem::ifstream> thread_local_rtree_stream;
// Implements a static, i.e. packed, R-tree
template <class DataT,
class CoordinateListT = std::vector<FixedPointCoordinate>,
bool UseSharedMemory = false>
class StaticRTree
{
public:
struct RectangleInt2D
{
RectangleInt2D() : min_lon(INT_MAX), max_lon(INT_MIN), min_lat(INT_MAX), max_lat(INT_MIN) {}
int32_t min_lon, max_lon;
int32_t min_lat, max_lat;
inline void InitializeMBRectangle(const std::array<DataT, RTREE_LEAF_NODE_SIZE> &objects,
const uint32_t element_count,
const std::vector<NodeInfo> &coordinate_list)
{
for (uint32_t i = 0; i < element_count; ++i)
{
min_lon = std::min(min_lon,
std::min(coordinate_list.at(objects[i].u).lon,
coordinate_list.at(objects[i].v).lon));
max_lon = std::max(max_lon,
std::max(coordinate_list.at(objects[i].u).lon,
coordinate_list.at(objects[i].v).lon));
min_lat = std::min(min_lat,
std::min(coordinate_list.at(objects[i].u).lat,
coordinate_list.at(objects[i].v).lat));
max_lat = std::max(max_lat,
std::max(coordinate_list.at(objects[i].u).lat,
coordinate_list.at(objects[i].v).lat));
}
}
inline void AugmentMBRectangle(const RectangleInt2D &other)
{
min_lon = std::min(min_lon, other.min_lon);
max_lon = std::max(max_lon, other.max_lon);
min_lat = std::min(min_lat, other.min_lat);
max_lat = std::max(max_lat, other.max_lat);
}
inline FixedPointCoordinate Centroid() const
{
FixedPointCoordinate centroid;
// The coordinates of the midpoints are given by:
// x = (x1 + x2) /2 and y = (y1 + y2) /2.
centroid.lon = (min_lon + max_lon) / 2;
centroid.lat = (min_lat + max_lat) / 2;
return centroid;
}
inline bool Intersects(const RectangleInt2D &other) const
{
FixedPointCoordinate upper_left(other.max_lat, other.min_lon);
FixedPointCoordinate upper_right(other.max_lat, other.max_lon);
FixedPointCoordinate lower_right(other.min_lat, other.max_lon);
FixedPointCoordinate lower_left(other.min_lat, other.min_lon);
return (Contains(upper_left) || Contains(upper_right) || Contains(lower_right) ||
Contains(lower_left));
}
inline float GetMinDist(const FixedPointCoordinate &location) const
{
bool is_contained = Contains(location);
if (is_contained)
{
return 0.;
}
float min_dist = std::numeric_limits<float>::max();
min_dist = std::min(min_dist,
FixedPointCoordinate::ApproximateEuclideanDistance(
location.lat, location.lon, max_lat, min_lon));
min_dist = std::min(min_dist,
FixedPointCoordinate::ApproximateEuclideanDistance(
location.lat, location.lon, max_lat, max_lon));
min_dist = std::min(min_dist,
FixedPointCoordinate::ApproximateEuclideanDistance(
location.lat, location.lon, min_lat, max_lon));
min_dist = std::min(min_dist,
FixedPointCoordinate::ApproximateEuclideanDistance(
location.lat, location.lon, min_lat, min_lon));
return min_dist;
}
inline float GetMinMaxDist(const FixedPointCoordinate &location) const
{
float min_max_dist = std::numeric_limits<float>::max();
// Get minmax distance to each of the four sides
FixedPointCoordinate upper_left(max_lat, min_lon);
FixedPointCoordinate upper_right(max_lat, max_lon);
FixedPointCoordinate lower_right(min_lat, max_lon);
FixedPointCoordinate lower_left(min_lat, min_lon);
min_max_dist = std::min(
min_max_dist,
std::max(
FixedPointCoordinate::ApproximateEuclideanDistance(location, upper_left),
FixedPointCoordinate::ApproximateEuclideanDistance(location, upper_right)));
min_max_dist = std::min(
min_max_dist,
std::max(
FixedPointCoordinate::ApproximateEuclideanDistance(location, upper_right),
FixedPointCoordinate::ApproximateEuclideanDistance(location, lower_right)));
min_max_dist = std::min(
min_max_dist,
std::max(FixedPointCoordinate::ApproximateEuclideanDistance(location, lower_right),
FixedPointCoordinate::ApproximateEuclideanDistance(location, lower_left)));
min_max_dist = std::min(
min_max_dist,
std::max(FixedPointCoordinate::ApproximateEuclideanDistance(location, lower_left),
FixedPointCoordinate::ApproximateEuclideanDistance(location, upper_left)));
return min_max_dist;
}
inline bool Contains(const FixedPointCoordinate &location) const
{
const bool lats_contained = (location.lat > min_lat) && (location.lat < max_lat);
const bool lons_contained = (location.lon > min_lon) && (location.lon < max_lon);
return lats_contained && lons_contained;
}
inline friend std::ostream &operator<<(std::ostream &out, const RectangleInt2D &rect)
{
out << rect.min_lat / COORDINATE_PRECISION << "," << rect.min_lon / COORDINATE_PRECISION
<< " " << rect.max_lat / COORDINATE_PRECISION << ","
<< rect.max_lon / COORDINATE_PRECISION;
return out;
}
};
typedef RectangleInt2D RectangleT;
struct TreeNode
{
TreeNode() : child_count(0), child_is_on_disk(false) {}
RectangleT minimum_bounding_rectangle;
uint32_t child_count : 31;
bool child_is_on_disk : 1;
uint32_t children[RTREE_BRANCHING_FACTOR];
};
private:
struct WrappedInputElement
{
explicit WrappedInputElement(const uint32_t _array_index, const uint64_t _hilbert_value)
: m_array_index(_array_index), m_hilbert_value(_hilbert_value)
{
}
WrappedInputElement() : m_array_index(UINT_MAX), m_hilbert_value(0) {}
uint32_t m_array_index;
uint64_t m_hilbert_value;
inline bool operator<(const WrappedInputElement &other) const
{
return m_hilbert_value < other.m_hilbert_value;
}
};
struct LeafNode
{
LeafNode() : object_count(0) {}
uint32_t object_count;
std::array<DataT, RTREE_LEAF_NODE_SIZE> objects;
};
struct QueryCandidate
{
explicit QueryCandidate(const uint32_t n_id, const float dist)
: node_id(n_id), min_dist(dist)
{
}
QueryCandidate() : node_id(UINT_MAX), min_dist(std::numeric_limits<float>::max()) {}
uint32_t node_id;
float min_dist;
inline bool operator<(const QueryCandidate &other) const
{
return min_dist < other.min_dist;
}
};
typename ShM<TreeNode, UseSharedMemory>::vector m_search_tree;
uint64_t m_element_count;
const std::string m_leaf_node_filename;
std::shared_ptr<CoordinateListT> m_coordinate_list;
public:
StaticRTree() = delete;
StaticRTree(const StaticRTree &) = delete;
// Construct a packed Hilbert-R-Tree with Kamel-Faloutsos algorithm [1]
explicit StaticRTree(std::vector<DataT> &input_data_vector,
const std::string tree_node_filename,
const std::string leaf_node_filename,
const std::vector<NodeInfo> &coordinate_list)
: m_element_count(input_data_vector.size()), m_leaf_node_filename(leaf_node_filename)
{
SimpleLogger().Write() << "constructing r-tree of " << m_element_count
<< " edge elements build on-top of " << coordinate_list.size()
<< " coordinates";
std::chrono::time_point<std::chrono::steady_clock> time0 = std::chrono::steady_clock::now();
std::vector<WrappedInputElement> input_wrapper_vector(m_element_count);
HilbertCode get_hilbert_number;
// generate auxiliary vector of hilbert-values
#pragma omp parallel for schedule(guided)
for (uint64_t element_counter = 0; element_counter < m_element_count; ++element_counter)
{
input_wrapper_vector[element_counter].m_array_index = element_counter;
// Get Hilbert-Value for centroid in mercartor projection
DataT const &current_element = input_data_vector[element_counter];
FixedPointCoordinate current_centroid =
DataT::Centroid(FixedPointCoordinate(coordinate_list.at(current_element.u).lat,
coordinate_list.at(current_element.u).lon),
FixedPointCoordinate(coordinate_list.at(current_element.v).lat,
coordinate_list.at(current_element.v).lon));
current_centroid.lat =
COORDINATE_PRECISION * lat2y(current_centroid.lat / COORDINATE_PRECISION);
uint64_t current_hilbert_value = get_hilbert_number(current_centroid);
input_wrapper_vector[element_counter].m_hilbert_value = current_hilbert_value;
}
// open leaf file
boost::filesystem::ofstream leaf_node_file(leaf_node_filename, std::ios::binary);
leaf_node_file.write((char *)&m_element_count, sizeof(uint64_t));
// sort the hilbert-value representatives
std::sort(input_wrapper_vector.begin(), input_wrapper_vector.end());
std::vector<TreeNode> tree_nodes_in_level;
// pack M elements into leaf node and write to leaf file
uint64_t processed_objects_count = 0;
while (processed_objects_count < m_element_count)
{
LeafNode current_leaf;
TreeNode current_node;
// SimpleLogger().Write() << "reading " << tree_size << " tree nodes in " <<
// (sizeof(TreeNode)*tree_size) << " bytes";
for (uint32_t current_element_index = 0; RTREE_LEAF_NODE_SIZE > current_element_index;
++current_element_index)
{
if (m_element_count > (processed_objects_count + current_element_index))
{
uint32_t index_of_next_object =
input_wrapper_vector[processed_objects_count + current_element_index]
.m_array_index;
current_leaf.objects[current_element_index] =
input_data_vector[index_of_next_object];
++current_leaf.object_count;
}
}
// generate tree node that resemble the objects in leaf and store it for next level
current_node.minimum_bounding_rectangle.InitializeMBRectangle(
current_leaf.objects, current_leaf.object_count, coordinate_list);
current_node.child_is_on_disk = true;
current_node.children[0] = tree_nodes_in_level.size();
tree_nodes_in_level.emplace_back(current_node);
// write leaf_node to leaf node file
leaf_node_file.write((char *)&current_leaf, sizeof(current_leaf));
processed_objects_count += current_leaf.object_count;
}
// close leaf file
leaf_node_file.close();
uint32_t processing_level = 0;
while (1 < tree_nodes_in_level.size())
{
std::vector<TreeNode> tree_nodes_in_next_level;
uint32_t processed_tree_nodes_in_level = 0;
while (processed_tree_nodes_in_level < tree_nodes_in_level.size())
{
TreeNode parent_node;
// pack RTREE_BRANCHING_FACTOR elements into tree_nodes each
for (uint32_t current_child_node_index = 0;
RTREE_BRANCHING_FACTOR > current_child_node_index;
++current_child_node_index)
{
if (processed_tree_nodes_in_level < tree_nodes_in_level.size())
{
TreeNode &current_child_node =
tree_nodes_in_level[processed_tree_nodes_in_level];
// add tree node to parent entry
parent_node.children[current_child_node_index] = m_search_tree.size();
m_search_tree.emplace_back(current_child_node);
// augment MBR of parent
parent_node.minimum_bounding_rectangle.AugmentMBRectangle(
current_child_node.minimum_bounding_rectangle);
// increase counters
++parent_node.child_count;
++processed_tree_nodes_in_level;
}
}
tree_nodes_in_next_level.emplace_back(parent_node);
}
tree_nodes_in_level.swap(tree_nodes_in_next_level);
++processing_level;
}
BOOST_ASSERT_MSG(1 == tree_nodes_in_level.size(), "tree broken, more than one root node");
// last remaining entry is the root node, store it
m_search_tree.emplace_back(tree_nodes_in_level[0]);
// reverse and renumber tree to have root at index 0
std::reverse(m_search_tree.begin(), m_search_tree.end());
#pragma omp parallel for schedule(guided)
for (uint32_t i = 0; i < m_search_tree.size(); ++i)
{
TreeNode &current_tree_node = m_search_tree[i];
for (uint32_t j = 0; j < current_tree_node.child_count; ++j)
{
const uint32_t old_id = current_tree_node.children[j];
const uint32_t new_id = m_search_tree.size() - old_id - 1;
current_tree_node.children[j] = new_id;
}
}
// open tree file
boost::filesystem::ofstream tree_node_file(tree_node_filename, std::ios::binary);
uint32_t size_of_tree = m_search_tree.size();
BOOST_ASSERT_MSG(0 < size_of_tree, "tree empty");
tree_node_file.write((char *)&size_of_tree, sizeof(uint32_t));
tree_node_file.write((char *)&m_search_tree[0], sizeof(TreeNode) * size_of_tree);
// close tree node file.
tree_node_file.close();
std::chrono::time_point<std::chrono::steady_clock> time1 = std::chrono::steady_clock::now();
std::chrono::duration<double> elapsed_seconds = time1 - time0;
SimpleLogger().Write() << "finished r-tree construction in " << (elapsed_seconds.count())
<< " seconds";
}
// Read-only operation for queries
explicit StaticRTree(const boost::filesystem::path &node_file,
const boost::filesystem::path &leaf_file,
const std::shared_ptr<CoordinateListT> coordinate_list)
: m_leaf_node_filename(leaf_file.string())
{
// open tree node file and load into RAM.
m_coordinate_list = coordinate_list;
if (!boost::filesystem::exists(node_file))
{
throw OSRMException("ram index file does not exist");
}
if (0 == boost::filesystem::file_size(node_file))
{
throw OSRMException("ram index file is empty");
}
boost::filesystem::ifstream tree_node_file(node_file, std::ios::binary);
uint32_t tree_size = 0;
tree_node_file.read((char *)&tree_size, sizeof(uint32_t));
m_search_tree.resize(tree_size);
tree_node_file.read((char *)&m_search_tree[0], sizeof(TreeNode) * tree_size);
tree_node_file.close();
// open leaf node file and store thread specific pointer
if (!boost::filesystem::exists(leaf_file))
{
throw OSRMException("mem index file does not exist");
}
if (0 == boost::filesystem::file_size(leaf_file))
{
throw OSRMException("mem index file is empty");
}
boost::filesystem::ifstream leaf_node_file(leaf_file, std::ios::binary);
leaf_node_file.read((char *)&m_element_count, sizeof(uint64_t));
leaf_node_file.close();
// SimpleLogger().Write() << tree_size << " nodes in search tree";
// SimpleLogger().Write() << m_element_count << " elements in leafs";
}
explicit StaticRTree(TreeNode *tree_node_ptr,
const uint32_t number_of_nodes,
const boost::filesystem::path &leaf_file,
std::shared_ptr<CoordinateListT> coordinate_list)
: m_search_tree(tree_node_ptr, number_of_nodes), m_leaf_node_filename(leaf_file.string()),
m_coordinate_list(coordinate_list)
{
// open leaf node file and store thread specific pointer
if (!boost::filesystem::exists(leaf_file))
{
throw OSRMException("mem index file does not exist");
}
if (0 == boost::filesystem::file_size(leaf_file))
{
throw OSRMException("mem index file is empty");
}
boost::filesystem::ifstream leaf_node_file(leaf_file, std::ios::binary);
leaf_node_file.read((char *)&m_element_count, sizeof(uint64_t));
leaf_node_file.close();
if (thread_local_rtree_stream.get())
{
thread_local_rtree_stream->close();
}
// SimpleLogger().Write() << tree_size << " nodes in search tree";
// SimpleLogger().Write() << m_element_count << " elements in leafs";
}
// Read-only operation for queries
bool LocateClosestEndPointForCoordinate(const FixedPointCoordinate &input_coordinate,
FixedPointCoordinate &result_coordinate,
const unsigned zoom_level)
{
bool ignore_tiny_components = (zoom_level <= 14);
DataT nearest_edge;
float min_dist = std::numeric_limits<float>::max();
float min_max_dist = std::numeric_limits<float>::max();
bool found_a_nearest_edge = false;
// initialize queue with root element
std::priority_queue<QueryCandidate> traversal_queue;
float current_min_dist =
m_search_tree[0].minimum_bounding_rectangle.GetMinDist(input_coordinate);
traversal_queue.emplace(0, current_min_dist);
while (!traversal_queue.empty())
{
const QueryCandidate current_query_node = traversal_queue.top();
traversal_queue.pop();
const bool prune_downward = (current_query_node.min_dist >= min_max_dist);
const bool prune_upward = (current_query_node.min_dist >= min_dist);
if (!prune_downward && !prune_upward)
{ // downward pruning
TreeNode &current_tree_node = m_search_tree[current_query_node.node_id];
if (current_tree_node.child_is_on_disk)
{
LeafNode current_leaf_node;
LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node);
for (uint32_t i = 0; i < current_leaf_node.object_count; ++i)
{
DataT const &current_edge = current_leaf_node.objects[i];
if (ignore_tiny_components && current_edge.is_in_tiny_cc)
{
continue;
}
float current_minimum_distance =
FixedPointCoordinate::ApproximateEuclideanDistance(
input_coordinate.lat,
input_coordinate.lon,
m_coordinate_list->at(current_edge.u).lat,
m_coordinate_list->at(current_edge.u).lon);
if (current_minimum_distance < min_dist)
{
// found a new minimum
min_dist = current_minimum_distance;
result_coordinate.lat = m_coordinate_list->at(current_edge.u).lat;
result_coordinate.lon = m_coordinate_list->at(current_edge.u).lon;
found_a_nearest_edge = true;
}
current_minimum_distance =
FixedPointCoordinate::ApproximateEuclideanDistance(
input_coordinate.lat,
input_coordinate.lon,
m_coordinate_list->at(current_edge.v).lat,
m_coordinate_list->at(current_edge.v).lon);
if (current_minimum_distance < min_dist)
{
// found a new minimum
min_dist = current_minimum_distance;
result_coordinate.lat = m_coordinate_list->at(current_edge.v).lat;
result_coordinate.lon = m_coordinate_list->at(current_edge.v).lon;
found_a_nearest_edge = true;
}
}
}
else
{
// traverse children, prune if global mindist is smaller than local one
for (uint32_t i = 0; i < current_tree_node.child_count; ++i)
{
const int32_t child_id = current_tree_node.children[i];
const TreeNode &child_tree_node = m_search_tree[child_id];
const RectangleT &child_rectangle =
child_tree_node.minimum_bounding_rectangle;
const float current_min_dist =
child_rectangle.GetMinDist(input_coordinate);
const float current_min_max_dist =
child_rectangle.GetMinMaxDist(input_coordinate);
if (current_min_max_dist < min_max_dist)
{
min_max_dist = current_min_max_dist;
}
if (current_min_dist > min_max_dist)
{
continue;
}
if (current_min_dist > min_dist)
{ // upward pruning
continue;
}
traversal_queue.emplace(child_id, current_min_dist);
}
}
}
}
return found_a_nearest_edge;
}
bool FindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
PhantomNode &result_phantom_node,
const unsigned zoom_level)
{
// SimpleLogger().Write() << "searching for coordinate " << input_coordinate;
const bool ignore_tiny_components = (zoom_level <= 14);
DataT nearest_edge;
float min_dist = std::numeric_limits<float>::max();
float min_max_dist = std::numeric_limits<float>::max();
bool found_a_nearest_edge = false;
FixedPointCoordinate nearest, current_start_coordinate, current_end_coordinate;
// initialize queue with root element
std::priority_queue<QueryCandidate> traversal_queue;
float current_min_dist =
m_search_tree[0].minimum_bounding_rectangle.GetMinDist(input_coordinate);
traversal_queue.emplace(0, current_min_dist);
BOOST_ASSERT_MSG(std::numeric_limits<float>::epsilon() >
(0. - traversal_queue.top().min_dist),
"Root element in NN Search has min dist != 0.");
LeafNode current_leaf_node;
while (!traversal_queue.empty())
{
const QueryCandidate current_query_node = traversal_queue.top();
traversal_queue.pop();
const bool prune_downward = (current_query_node.min_dist >= min_max_dist);
const bool prune_upward = (current_query_node.min_dist >= min_dist);
if (!prune_downward && !prune_upward)
{ // downward pruning
const TreeNode &current_tree_node = m_search_tree[current_query_node.node_id];
if (current_tree_node.child_is_on_disk)
{
LoadLeafFromDisk(current_tree_node.children[0], current_leaf_node);
for (uint32_t i = 0; i < current_leaf_node.object_count; ++i)
{
DataT &current_edge = current_leaf_node.objects[i];
if (ignore_tiny_components && current_edge.is_in_tiny_cc)
{
continue;
}
float current_ratio = 0.;
const float current_perpendicular_distance =
FixedPointCoordinate::ComputePerpendicularDistance(
m_coordinate_list->at(current_edge.u),
m_coordinate_list->at(current_edge.v),
input_coordinate,
nearest,
current_ratio);
BOOST_ASSERT(0. <= current_perpendicular_distance);
if ((current_perpendicular_distance < min_dist) &&
!EpsilonCompare(current_perpendicular_distance, min_dist))
{ // found a new minimum
min_dist = current_perpendicular_distance;
// TODO: use assignment c'tor in PhantomNode
result_phantom_node.forward_node_id =
current_edge.forward_edge_based_node_id;
result_phantom_node.reverse_node_id =
current_edge.reverse_edge_based_node_id;
result_phantom_node.name_id = current_edge.name_id;
result_phantom_node.forward_weight = current_edge.forward_weight;
result_phantom_node.reverse_weight = current_edge.reverse_weight;
result_phantom_node.forward_offset = current_edge.forward_offset;
result_phantom_node.reverse_offset = current_edge.reverse_offset;
result_phantom_node.packed_geometry_id =
current_edge.packed_geometry_id;
result_phantom_node.fwd_segment_position =
current_edge.fwd_segment_position;
result_phantom_node.location = nearest;
current_start_coordinate.lat =
m_coordinate_list->at(current_edge.u).lat;
current_start_coordinate.lon =
m_coordinate_list->at(current_edge.u).lon;
current_end_coordinate.lat = m_coordinate_list->at(current_edge.v).lat;
current_end_coordinate.lon = m_coordinate_list->at(current_edge.v).lon;
nearest_edge = current_edge;
found_a_nearest_edge = true;
}
}
}
else
{
// traverse children, prune if global mindist is smaller than local one
for (uint32_t i = 0; i < current_tree_node.child_count; ++i)
{
const int32_t child_id = current_tree_node.children[i];
TreeNode &child_tree_node = m_search_tree[child_id];
RectangleT &child_rectangle = child_tree_node.minimum_bounding_rectangle;
const float current_min_dist =
child_rectangle.GetMinDist(input_coordinate);
const float current_min_max_dist =
child_rectangle.GetMinMaxDist(input_coordinate);
if (current_min_max_dist < min_max_dist)
{
min_max_dist = current_min_max_dist;
}
if (current_min_dist > min_max_dist)
{
continue;
}
if (current_min_dist > min_dist)
{ // upward pruning
continue;
}
traversal_queue.emplace(child_id, current_min_dist);
}
}
}
}
// Hack to fix rounding errors and wandering via nodes.
if (1 == std::abs(input_coordinate.lon - result_phantom_node.location.lon))
{
result_phantom_node.location.lon = input_coordinate.lon;
}
if (1 == std::abs(input_coordinate.lat - result_phantom_node.location.lat))
{
result_phantom_node.location.lat = input_coordinate.lat;
}
float ratio = 0.f;
if (found_a_nearest_edge)
{
const float distance_1 = FixedPointCoordinate::ApproximateEuclideanDistance(
current_start_coordinate, result_phantom_node.location);
const float distance_2 = FixedPointCoordinate::ApproximateEuclideanDistance(
current_start_coordinate, current_end_coordinate);
ratio = distance_1 / distance_2;
ratio = std::min(1.f, ratio);
if (SPECIAL_NODEID != result_phantom_node.forward_node_id)
{
result_phantom_node.forward_weight *= ratio;
}
if (SPECIAL_NODEID != result_phantom_node.reverse_node_id)
{
result_phantom_node.reverse_weight *= (1. - ratio);
}
}
return found_a_nearest_edge;
}
private:
inline void LoadLeafFromDisk(const uint32_t leaf_id, LeafNode &result_node)
{
if (!thread_local_rtree_stream.get() || !thread_local_rtree_stream->is_open())
{
thread_local_rtree_stream.reset(new boost::filesystem::ifstream(
m_leaf_node_filename, std::ios::in | std::ios::binary));
}
if (!thread_local_rtree_stream->good())
{
thread_local_rtree_stream->clear(std::ios::goodbit);
SimpleLogger().Write(logDEBUG) << "Resetting stale filestream";
}
uint64_t seek_pos = sizeof(uint64_t) + leaf_id * sizeof(LeafNode);
thread_local_rtree_stream->seekg(seek_pos);
thread_local_rtree_stream->read((char *)&result_node, sizeof(LeafNode));
}
inline bool EdgesAreEquivalent(const FixedPointCoordinate &a,
const FixedPointCoordinate &b,
const FixedPointCoordinate &c,
const FixedPointCoordinate &d) const
{
return (a == b && c == d) || (a == c && b == d) || (a == d && b == c);
}
template<typename FloatT>
inline bool EpsilonCompare(const FloatT d1, const FloatT d2) const
{
return (std::abs(d1 - d2) < std::numeric_limits<FloatT>::epsilon());
}
};
//[1] "On Packing R-Trees"; I. Kamel, C. Faloutsos; 1993; DOI: 10.1145/170088.170403
//[2] "Nearest Neighbor Queries", N. Roussopulos et al; 1995; DOI: 10.1145/223784.223794
#endif // STATICRTREE_H

View File

@ -1,90 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TURN_INSTRUCTIONS_H
#define TURN_INSTRUCTIONS_H
enum class TurnInstruction : unsigned char
{
NoTurn = 0, GoStraight, TurnSlightRight, TurnRight, TurnSharpRight, UTurn,
TurnSharpLeft, TurnLeft, TurnSlightLeft, ReachViaPoint, HeadOn, EnterRoundAbout,
LeaveRoundAbout, StayOnRoundAbout, StartAtEndOfStreet, ReachedYourDestination,
EnterAgainstAllowedDirection, LeaveAgainstAllowedDirection,
InverseAccessRestrictionFlag = 127,
AccessRestrictionFlag = 128,
AccessRestrictionPenalty = 129
};
struct TurnInstructionsClass
{
TurnInstructionsClass() = delete;
TurnInstructionsClass(const TurnInstructionsClass&) = delete;
static inline TurnInstruction GetTurnDirectionOfInstruction(const double angle)
{
if (angle >= 23 && angle < 67)
{
return TurnInstruction::TurnSharpRight;
}
if (angle >= 67 && angle < 113)
{
return TurnInstruction::TurnRight;
}
if (angle >= 113 && angle < 158)
{
return TurnInstruction::TurnSlightRight;
}
if (angle >= 158 && angle < 202)
{
return TurnInstruction::GoStraight;
}
if (angle >= 202 && angle < 248)
{
return TurnInstruction::TurnSlightLeft;
}
if (angle >= 248 && angle < 292)
{
return TurnInstruction::TurnLeft;
}
if (angle >= 292 && angle < 336)
{
return TurnInstruction::TurnSharpLeft;
}
return TurnInstruction::UTurn;
}
static inline bool TurnIsNecessary(const TurnInstruction turn_instruction)
{
if (TurnInstruction::NoTurn == turn_instruction || TurnInstruction::StayOnRoundAbout == turn_instruction)
{
return false;
}
return true;
}
};
#endif /* TURN_INSTRUCTIONS_H */

View File

@ -1,115 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef XOR_FAST_HASH_H
#define XOR_FAST_HASH_H
#include <algorithm>
#include <vector>
/*
This is an implementation of Tabulation hashing, which has suprising properties like
universality.
The space requirement is 2*2^16 = 256 kb of memory, which fits into L2 cache.
Evaluation boils down to 10 or less assembly instruction on any recent X86 CPU:
1: movq table2(%rip), %rdx
2: movl %edi, %eax
3: movzwl %di, %edi
4: shrl $16, %eax
5: movzwl %ax, %eax
6: movzbl (%rdx,%rax), %eax
7: movq table1(%rip), %rdx
8: xorb (%rdx,%rdi), %al
9: movzbl %al, %eax
10: ret
*/
class XORFastHash
{ // 65k entries
std::vector<unsigned short> table1;
std::vector<unsigned short> table2;
public:
XORFastHash()
{
table1.resize(2 << 16);
table2.resize(2 << 16);
for (unsigned i = 0; i < (2 << 16); ++i)
{
table1[i] = i;
table2[i] = i;
}
std::random_shuffle(table1.begin(), table1.end());
std::random_shuffle(table2.begin(), table2.end());
}
inline unsigned short operator()(const unsigned originalValue) const
{
unsigned short lsb = ((originalValue) & 0xffff);
unsigned short msb = (((originalValue) >> 16) & 0xffff);
return table1[lsb] ^ table2[msb];
}
};
class XORMiniHash
{ // 256 entries
std::vector<unsigned char> table1;
std::vector<unsigned char> table2;
std::vector<unsigned char> table3;
std::vector<unsigned char> table4;
public:
XORMiniHash()
{
table1.resize(1 << 8);
table2.resize(1 << 8);
table3.resize(1 << 8);
table4.resize(1 << 8);
for (unsigned i = 0; i < (1 << 8); ++i)
{
table1[i] = i;
table2[i] = i;
table3[i] = i;
table4[i] = i;
}
std::random_shuffle(table1.begin(), table1.end());
std::random_shuffle(table2.begin(), table2.end());
std::random_shuffle(table3.begin(), table3.end());
std::random_shuffle(table4.begin(), table4.end());
}
unsigned char operator()(const unsigned originalValue) const
{
unsigned char byte1 = ((originalValue) & 0xff);
unsigned char byte2 = ((originalValue >> 8) & 0xff);
unsigned char byte3 = ((originalValue >> 16) & 0xff);
unsigned char byte4 = ((originalValue >> 24) & 0xff);
return table1[byte1] ^ table2[byte2] ^ table3[byte3] ^ table4[byte4];
}
};
#endif // XOR_FAST_HASH_H

View File

@ -1,89 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef XOR_FAST_HASH_STORAGE_H
#define XOR_FAST_HASH_STORAGE_H
#include "XORFastHash.h"
#include <limits>
#include <vector>
template <typename NodeID, typename Key> class XORFastHashStorage
{
public:
struct HashCell
{
Key key;
NodeID id;
unsigned time;
HashCell()
: key(std::numeric_limits<unsigned>::max()), id(std::numeric_limits<unsigned>::max()),
time(std::numeric_limits<unsigned>::max())
{
}
HashCell(const HashCell &other) : key(other.key), id(other.id), time(other.time) {}
inline operator Key() const { return key; }
inline void operator=(const Key &key_to_insert) { key = key_to_insert; }
};
explicit XORFastHashStorage(size_t) : positions(2 << 16), current_timestamp(0) {}
inline HashCell &operator[](const NodeID node)
{
unsigned short position = fast_hasher(node);
while ((positions[position].time == current_timestamp) && (positions[position].id != node))
{
++position %= (2 << 16);
}
positions[position].id = node;
positions[position].time = current_timestamp;
return positions[position];
}
inline void Clear()
{
++current_timestamp;
if (std::numeric_limits<unsigned>::max() == current_timestamp)
{
positions.clear();
positions.resize((2 << 16));
}
}
private:
XORFastHashStorage() : positions(2 << 16), current_timestamp(0) {}
std::vector<HashCell> positions;
XORFastHash fast_hasher;
unsigned current_timestamp;
};
#endif // XOR_FAST_HASH_STORAGE_H

View File

@ -1,63 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BASE_DESCRIPTOR_H
#define BASE_DESCRIPTOR_H
#include "../DataStructures/PhantomNodes.h"
#include "../DataStructures/RawRouteData.h"
#include "../typedefs.h"
#include <osrm/Reply.h>
#include <string>
#include <vector>
struct DescriptorConfig
{
DescriptorConfig() : instructions(true), geometry(true), encode_geometry(true), zoom_level(18)
{
}
bool instructions;
bool geometry;
bool encode_geometry;
unsigned short zoom_level;
};
template <class DataFacadeT> class BaseDescriptor
{
public:
BaseDescriptor() {}
// Maybe someone can explain the pure virtual destructor thing to me (dennis)
virtual ~BaseDescriptor() {}
virtual void Run(const RawRouteData &raw_route,
const PhantomNodes &phantom_nodes,
http::Reply &reply) = 0;
virtual void SetConfig(const DescriptorConfig &config) = 0;
};
#endif // BASE_DESCRIPTOR_H

View File

@ -1,80 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "DescriptionFactory.h"
DescriptionFactory::DescriptionFactory() : entireLength(0) {}
void DescriptionFactory::SetStartSegment(const PhantomNode &source)
{
start_phantom = source;
AppendSegment(source.location, PathData(0, source.name_id, TurnInstruction::HeadOn, source.forward_weight));
}
void DescriptionFactory::SetEndSegment(const PhantomNode &target)
{
target_phantom = target;
path_description.emplace_back(
target.location, target.name_id, 0, target.reverse_weight, TurnInstruction::NoTurn, true);
}
void DescriptionFactory::AppendSegment(const FixedPointCoordinate &coordinate,
const PathData &path_point)
{
if ((1 == path_description.size()) && (path_description.back().location == coordinate))
{
path_description.back().name_id = path_point.name_id;
return;
}
path_description.emplace_back(coordinate,
path_point.name_id,
path_point.segment_duration,
0,
path_point.turn_instruction);
}
JSON::Value DescriptionFactory::AppendEncodedPolylineString(const bool return_encoded)
{
if (return_encoded)
{
return polyline_compressor.printEncodedString(path_description);
}
return polyline_compressor.printUnencodedString(path_description);
}
JSON::Value DescriptionFactory::AppendUnencodedPolylineString() const
{
return polyline_compressor.printUnencodedString(path_description);
}
void DescriptionFactory::BuildRouteSummary(const double distance, const unsigned time)
{
summary.source_name_id = start_phantom.name_id;
summary.target_name_id = target_phantom.name_id;
summary.BuildDurationAndLengthStrings(distance, time);
}

View File

@ -1,205 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DESCRIPTIONFACTORY_H_
#define DESCRIPTIONFACTORY_H_
#include "../Algorithms/DouglasPeucker.h"
#include "../Algorithms/PolylineCompressor.h"
#include "../DataStructures/PhantomNodes.h"
#include "../DataStructures/RawRouteData.h"
#include "../DataStructures/SegmentInformation.h"
#include "../DataStructures/TurnInstructions.h"
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <limits>
#include <vector>
/* This class is fed with all way segments in consecutive order
* and produces the description plus the encoded polyline */
class DescriptionFactory
{
DouglasPeucker polyline_generalizer;
PolylineCompressor polyline_compressor;
PhantomNode start_phantom, target_phantom;
double DegreeToRadian(const double degree) const;
double RadianToDegree(const double degree) const;
public:
struct RouteSummary
{
unsigned distance;
EdgeWeight duration;
unsigned source_name_id;
unsigned target_name_id;
RouteSummary() : distance(0), duration(0), source_name_id(0), target_name_id(0) {}
void BuildDurationAndLengthStrings(const double raw_distance, const unsigned raw_duration)
{
// compute distance/duration for route summary
distance = round(raw_distance);
duration = round(raw_duration / 10.);
}
} summary;
double entireLength;
// I know, declaring this public is considered bad. I'm lazy
std::vector<SegmentInformation> path_description;
DescriptionFactory();
JSON::Value AppendUnencodedPolylineString() const;
void AppendSegment(const FixedPointCoordinate &coordinate, const PathData &data);
void BuildRouteSummary(const double distance, const unsigned time);
void SetStartSegment(const PhantomNode &start_phantom);
void SetEndSegment(const PhantomNode &start_phantom);
JSON::Value AppendEncodedPolylineString(const bool return_encoded);
template <class DataFacadeT> void Run(const DataFacadeT *facade, const unsigned zoomLevel)
{
if (path_description.empty())
{
return;
}
/** starts at index 1 */
path_description[0].length = 0;
for (unsigned i = 1; i < path_description.size(); ++i)
{
// move down names by one, q&d hack
path_description[i - 1].name_id = path_description[i].name_id;
path_description[i].length = FixedPointCoordinate::ApproximateEuclideanDistance(
path_description[i - 1].location, path_description[i].location);
}
/*Simplify turn instructions
Input :
10. Turn left on B 36 for 20 km
11. Continue on B 35; B 36 for 2 km
12. Continue on B 36 for 13 km
becomes:
10. Turn left on B 36 for 35 km
*/
// TODO: rework to check only end and start of string.
// stl string is way to expensive
// unsigned lastTurn = 0;
// for(unsigned i = 1; i < path_description.size(); ++i) {
// string1 = sEngine.GetEscapedNameForNameID(path_description[i].name_id);
// if(TurnInstruction::GoStraight == path_description[i].turn_instruction) {
// if(std::string::npos != string0.find(string1+";")
// || std::string::npos != string0.find(";"+string1)
// || std::string::npos != string0.find(string1+" ;")
// || std::string::npos != string0.find("; "+string1)
// ){
// SimpleLogger().Write() << "->next correct: " << string0 << " contains " <<
// string1;
// for(; lastTurn != i; ++lastTurn)
// path_description[lastTurn].name_id = path_description[i].name_id;
// path_description[i].turn_instruction = TurnInstruction::NoTurn;
// } else if(std::string::npos != string1.find(string0+";")
// || std::string::npos != string1.find(";"+string0)
// || std::string::npos != string1.find(string0+" ;")
// || std::string::npos != string1.find("; "+string0)
// ){
// SimpleLogger().Write() << "->prev correct: " << string1 << " contains " <<
// string0;
// path_description[i].name_id = path_description[i-1].name_id;
// path_description[i].turn_instruction = TurnInstruction::NoTurn;
// }
// }
// if (TurnInstruction::NoTurn != path_description[i].turn_instruction) {
// lastTurn = i;
// }
// string0 = string1;
// }
double segment_length = 0.;
unsigned segment_duration = 0;
unsigned segment_start_index = 0;
for (unsigned i = 1; i < path_description.size(); ++i)
{
entireLength += path_description[i].length;
segment_length += path_description[i].length;
segment_duration += path_description[i].duration;
path_description[segment_start_index].length = segment_length;
path_description[segment_start_index].duration = segment_duration;
if (TurnInstruction::NoTurn != path_description[i].turn_instruction)
{
BOOST_ASSERT(path_description[i].necessary);
segment_length = 0;
segment_duration = 0;
segment_start_index = i;
}
}
// Post-processing to remove empty or nearly empty path segments
if (std::numeric_limits<double>::epsilon() > path_description.back().length)
{
if (path_description.size() > 2)
{
path_description.pop_back();
path_description.back().necessary = true;
path_description.back().turn_instruction = TurnInstruction::NoTurn;
target_phantom.name_id = (path_description.end() - 2)->name_id;
}
}
if (std::numeric_limits<double>::epsilon() > path_description.front().length)
{
if (path_description.size() > 2)
{
path_description.erase(path_description.begin());
path_description.front().turn_instruction = TurnInstruction::HeadOn;
path_description.front().necessary = true;
start_phantom.name_id = path_description.front().name_id;
}
}
// Generalize poly line
polyline_generalizer.Run(path_description, zoomLevel);
// fix what needs to be fixed else
for (unsigned i = 0; i < path_description.size() - 1 && path_description.size() >= 2; ++i)
{
if (path_description[i].necessary)
{
const double angle = path_description[i+1].location.GetBearing(path_description[i].location);
path_description[i].bearing = angle * 10;
}
}
return;
}
};
#endif /* DESCRIPTIONFACTORY_H_ */

View File

@ -1,102 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GPX_DESCRIPTOR_H
#define GPX_DESCRIPTOR_H
#include "BaseDescriptor.h"
template <class DataFacadeT> class GPXDescriptor : public BaseDescriptor<DataFacadeT>
{
private:
DescriptorConfig config;
FixedPointCoordinate current;
DataFacadeT * facade;
void AddRoutePoint(const FixedPointCoordinate & coordinate, std::vector<char> & output)
{
const std::string route_point_head = "<rtept lat=\"";
const std::string route_point_middle = " lon=\"";
const std::string route_point_tail = "\"></rtept>";
std::string tmp;
FixedPointCoordinate::convertInternalLatLonToString(coordinate.lat, tmp);
output.insert(output.end(), route_point_head.begin(), route_point_head.end());
output.insert(output.end(), tmp.begin(), tmp.end());
output.push_back('\"');
FixedPointCoordinate::convertInternalLatLonToString(coordinate.lon, tmp);
output.insert(output.end(), route_point_middle.begin(), route_point_middle.end());
output.insert(output.end(), tmp.begin(), tmp.end());
output.insert(output.end(), route_point_tail.begin(), route_point_tail.end());
}
public:
GPXDescriptor(DataFacadeT *facade) : facade(facade) {}
void SetConfig(const DescriptorConfig &c) { config = c; }
// TODO: reorder parameters
void Run(const RawRouteData &raw_route,
const PhantomNodes &phantom_node_list,
http::Reply &reply)
{
std::string header("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<gpx creator=\"OSRM Routing Engine\" version=\"1.1\" "
"xmlns=\"http://www.topografix.com/GPX/1/1\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 gpx.xsd"
"\">"
"<metadata><copyright author=\"Project OSRM\"><license>Data (c)"
" OpenStreetMap contributors (ODbL)</license></copyright>"
"</metadata>"
"<rte>");
reply.content.insert(reply.content.end(), header.begin(), header.end());
const bool found_route = (raw_route.shortest_path_length != INVALID_EDGE_WEIGHT) &&
(!raw_route.unpacked_path_segments.front().empty());
if (found_route)
{
AddRoutePoint(phantom_node_list.source_phantom.location, reply.content);
for (const std::vector<PathData> &path_data_vector : raw_route.unpacked_path_segments)
{
for (const PathData &path_data : path_data_vector)
{
const FixedPointCoordinate current_coordinate =
facade->GetCoordinateOfNode(path_data.node);
AddRoutePoint(current_coordinate, reply.content);
}
}
AddRoutePoint(phantom_node_list.target_phantom.location, reply.content);
}
std::string footer("</rte></gpx>");
reply.content.insert(reply.content.end(), footer.begin(), footer.end());
}
};
#endif // GPX_DESCRIPTOR_H

View File

@ -1,356 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef JSON_DESCRIPTOR_H_
#define JSON_DESCRIPTOR_H_
#include "BaseDescriptor.h"
#include "DescriptionFactory.h"
#include "../Algorithms/ObjectToBase64.h"
#include "../Algorithms/ExtractRouteNames.h"
#include "../DataStructures/JSONContainer.h"
#include "../DataStructures/SegmentInformation.h"
#include "../DataStructures/TurnInstructions.h"
#include "../Util/Azimuth.h"
#include "../Util/StringUtil.h"
#include "../Util/TimingUtil.h"
#include <algorithm>
template <class DataFacadeT> class JSONDescriptor : public BaseDescriptor<DataFacadeT>
{
private:
DataFacadeT *facade;
DescriptorConfig config;
DescriptionFactory description_factory, alternate_description_factory;
FixedPointCoordinate current;
unsigned entered_restricted_area_count;
struct RoundAbout
{
RoundAbout() : start_index(INT_MAX), name_id(INT_MAX), leave_at_exit(INT_MAX) {}
int start_index;
int name_id;
int leave_at_exit;
} round_about;
struct Segment
{
Segment() : name_id(-1), length(-1), position(-1) {}
Segment(int n, int l, int p) : name_id(n), length(l), position(p) {}
int name_id;
int length;
int position;
};
std::vector<Segment> shortest_path_segments, alternative_path_segments;
std::vector<unsigned> shortest_leg_end_indices, alternative_leg_end_indices;
ExtractRouteNames<DataFacadeT, Segment> GenerateRouteNames;
public:
JSONDescriptor(DataFacadeT *facade) : facade(facade), entered_restricted_area_count(0)
{
shortest_leg_end_indices.emplace_back(0);
alternative_leg_end_indices.emplace_back(0);
}
void SetConfig(const DescriptorConfig &c) { config = c; }
unsigned DescribeLeg(const std::vector<PathData> route_leg, const PhantomNodes &leg_phantoms)
{
unsigned added_element_count = 0;
// Get all the coordinates for the computed route
FixedPointCoordinate current_coordinate;
for (const PathData &path_data : route_leg)
{
current_coordinate = facade->GetCoordinateOfNode(path_data.node);
description_factory.AppendSegment(current_coordinate, path_data);
++added_element_count;
}
++added_element_count;
BOOST_ASSERT((route_leg.size() + 1) == added_element_count);
return added_element_count;
}
void Run(const RawRouteData &raw_route,
const PhantomNodes &phantom_nodes,
http::Reply &reply)
{
JSON::Object json_result;
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
{
// We do not need to do much, if there is no route ;-)
json_result.values["status"] = 207;
json_result.values["status_message"] = "Cannot find route between points";
JSON::render(reply.content, json_result);
return;
}
// check if first segment is non-zero
std::string road_name =
facade->GetEscapedNameForNameID(phantom_nodes.source_phantom.name_id);
BOOST_ASSERT(raw_route.unpacked_path_segments.size() ==
raw_route.segment_end_coordinates.size());
description_factory.SetStartSegment(phantom_nodes.source_phantom);
json_result.values["status"] = 0;
json_result.values["status_message"] = "Found route between points";
// for each unpacked segment add the leg to the description
for (unsigned i = 0; i < raw_route.unpacked_path_segments.size(); ++i)
{
const int added_segments = DescribeLeg(raw_route.unpacked_path_segments[i],
raw_route.segment_end_coordinates[i]);
BOOST_ASSERT(0 < added_segments);
shortest_leg_end_indices.emplace_back(added_segments + shortest_leg_end_indices.back());
}
description_factory.SetEndSegment(phantom_nodes.target_phantom);
description_factory.Run(facade, config.zoom_level);
if (config.geometry)
{
JSON::Value route_geometry = description_factory.AppendEncodedPolylineString(config.encode_geometry);
json_result.values["route_geometry"] = route_geometry;
}
if (config.instructions)
{
JSON::Array json_route_instructions;
BuildTextualDescription(description_factory,
json_route_instructions,
raw_route.shortest_path_length,
shortest_path_segments);
json_result.values["route_instructions"] = json_route_instructions;
}
description_factory.BuildRouteSummary(description_factory.entireLength,
raw_route.shortest_path_length);
JSON::Object json_route_summary;
json_route_summary.values["total_distance"] = description_factory.summary.distance;
json_route_summary.values["total_time"] = description_factory.summary.duration;
json_route_summary.values["start_point"] = facade->GetEscapedNameForNameID(description_factory.summary.source_name_id);
json_route_summary.values["end_point"] = facade->GetEscapedNameForNameID(description_factory.summary.target_name_id);
json_result.values["route_summary"] = json_route_summary;
BOOST_ASSERT(!raw_route.segment_end_coordinates.empty());
JSON::Array json_via_points_array;
JSON::Array json_first_coordinate;
json_first_coordinate.values.push_back(raw_route.segment_end_coordinates.front().source_phantom.location.lat/COORDINATE_PRECISION);
json_first_coordinate.values.push_back(raw_route.segment_end_coordinates.front().source_phantom.location.lon/COORDINATE_PRECISION);
json_via_points_array.values.push_back(json_first_coordinate);
for (const PhantomNodes &nodes : raw_route.segment_end_coordinates)
{
std::string tmp;
JSON::Array json_coordinate;
json_coordinate.values.push_back(nodes.target_phantom.location.lat/COORDINATE_PRECISION);
json_coordinate.values.push_back(nodes.target_phantom.location.lon/COORDINATE_PRECISION);
json_via_points_array.values.push_back(json_coordinate);
}
json_result.values["via_points"] = json_via_points_array;
JSON::Array json_via_indices_array;
json_via_indices_array.values.insert(json_via_indices_array.values.end(), shortest_leg_end_indices.begin(), shortest_leg_end_indices.end());
json_result.values["via_indices"] = json_via_indices_array;
// only one alternative route is computed at this time, so this is hardcoded
if (INVALID_EDGE_WEIGHT != raw_route.alternative_path_length)
{
json_result.values["found_alternative"] = JSON::True();
alternate_description_factory.SetStartSegment(phantom_nodes.source_phantom);
// Get all the coordinates for the computed route
for (const PathData &path_data : raw_route.unpacked_alternative)
{
current = facade->GetCoordinateOfNode(path_data.node);
alternate_description_factory.AppendSegment(current, path_data);
}
alternate_description_factory.Run(facade, config.zoom_level);
if (config.geometry)
{
JSON::Value alternate_geometry_string = alternate_description_factory.AppendEncodedPolylineString(config.encode_geometry);
JSON::Array json_alternate_geometries_array;
json_alternate_geometries_array.values.push_back(alternate_geometry_string);
json_result.values["alternative_geometries"] = json_alternate_geometries_array;
}
// Generate instructions for each alternative (simulated here)
JSON::Array json_alt_instructions;
JSON::Array json_current_alt_instructions;
if (config.instructions)
{
BuildTextualDescription(alternate_description_factory,
json_current_alt_instructions,
raw_route.alternative_path_length,
alternative_path_segments);
json_alt_instructions.values.push_back(json_current_alt_instructions);
json_result.values["alternative_instructions"] = json_alt_instructions;
}
alternate_description_factory.BuildRouteSummary(
alternate_description_factory.entireLength, raw_route.alternative_path_length);
JSON::Object json_alternate_route_summary;
JSON::Array json_alternate_route_summary_array;
json_alternate_route_summary.values["total_distance"] = alternate_description_factory.summary.distance;
json_alternate_route_summary.values["total_time"] = alternate_description_factory.summary.duration;
json_alternate_route_summary.values["start_point"] = facade->GetEscapedNameForNameID(alternate_description_factory.summary.source_name_id);
json_alternate_route_summary.values["end_point"] = facade->GetEscapedNameForNameID(alternate_description_factory.summary.target_name_id);
json_alternate_route_summary_array.values.push_back(json_alternate_route_summary);
json_result.values["alternative_summaries"] = json_alternate_route_summary_array;
JSON::Array json_altenative_indices_array;
json_altenative_indices_array.values.push_back(0);
json_altenative_indices_array.values.push_back(alternate_description_factory.path_description.size());
json_result.values["alternative_indices"] = json_altenative_indices_array;
} else {
json_result.values["found_alternative"] = JSON::False();
}
// Get Names for both routes
RouteNames route_names = GenerateRouteNames(shortest_path_segments, alternative_path_segments, facade);
JSON::Array json_route_names;
json_route_names.values.push_back(route_names.shortest_path_name_1);
json_route_names.values.push_back(route_names.shortest_path_name_2);
json_result.values["route_name"] = json_route_names;
if (INVALID_EDGE_WEIGHT != raw_route.alternative_path_length)
{
JSON::Array json_alternate_names_array;
JSON::Array json_alternate_names;
json_alternate_names.values.push_back(route_names.alternative_path_name_1);
json_alternate_names.values.push_back(route_names.alternative_path_name_2);
json_alternate_names_array.values.push_back(json_alternate_names);
json_result.values["alternative_names"] = json_alternate_names_array;
}
JSON::Object json_hint_object;
json_hint_object.values["checksum"] = raw_route.check_sum;
JSON::Array json_location_hint_array;
std::string hint;
for (unsigned i = 0; i < raw_route.segment_end_coordinates.size(); ++i)
{
EncodeObjectToBase64(raw_route.segment_end_coordinates[i].source_phantom, hint);
json_location_hint_array.values.push_back(hint);
}
EncodeObjectToBase64(raw_route.segment_end_coordinates.back().target_phantom, hint);
json_location_hint_array.values.push_back(hint);
json_hint_object.values["locations"] = json_location_hint_array;
json_result.values["hint_data"] = json_hint_object;
// render the content to the output array
TIMER_START(route_render);
JSON::render(reply.content, json_result);
TIMER_STOP(route_render);
SimpleLogger().Write(logDEBUG) << "rendering took: " << TIMER_MSEC(route_render);
}
// TODO: reorder parameters
inline void BuildTextualDescription(DescriptionFactory &description_factory,
JSON::Array & json_instruction_array,
const int route_length,
std::vector<Segment> &route_segments_list)
{
// Segment information has following format:
//["instruction id","streetname",length,position,time,"length","earth_direction",azimuth]
unsigned necessary_segments_running_index = 0;
round_about.leave_at_exit = 0;
round_about.name_id = 0;
std::string temp_dist, temp_length, temp_duration, temp_bearing, temp_instruction;
// Fetch data from Factory and generate a string from it.
for (const SegmentInformation &segment : description_factory.path_description)
{
JSON::Array json_instruction_row;
TurnInstruction current_instruction = segment.turn_instruction;
entered_restricted_area_count += (current_instruction != segment.turn_instruction);
if (TurnInstructionsClass::TurnIsNecessary(current_instruction))
{
if (TurnInstruction::EnterRoundAbout == current_instruction)
{
round_about.name_id = segment.name_id;
round_about.start_index = necessary_segments_running_index;
}
else
{
std::string current_turn_instruction;
if (TurnInstruction::LeaveRoundAbout == current_instruction)
{
temp_instruction = IntToString(as_integer(TurnInstruction::EnterRoundAbout));
current_turn_instruction += temp_instruction;
current_turn_instruction += "-";
temp_instruction = IntToString(round_about.leave_at_exit + 1);
current_turn_instruction += temp_instruction;
round_about.leave_at_exit = 0;
}
else
{
temp_instruction = IntToString(as_integer(current_instruction));
current_turn_instruction += temp_instruction;
}
json_instruction_row.values.push_back(current_turn_instruction);
json_instruction_row.values.push_back(facade->GetEscapedNameForNameID(segment.name_id));
json_instruction_row.values.push_back(std::round(segment.length));
json_instruction_row.values.push_back(necessary_segments_running_index);
json_instruction_row.values.push_back(round(segment.duration / 10));
json_instruction_row.values.push_back(IntToString(segment.length)+"m");
int bearing_value = round(segment.bearing / 10.);
json_instruction_row.values.push_back(Azimuth::Get(bearing_value));
json_instruction_row.values.push_back(bearing_value);
route_segments_list.emplace_back(
segment.name_id, segment.length, route_segments_list.size());
json_instruction_array.values.push_back(json_instruction_row);
}
}
else if (TurnInstruction::StayOnRoundAbout == current_instruction)
{
++round_about.leave_at_exit;
}
if (segment.necessary)
{
++necessary_segments_running_index;
}
}
//TODO: check if this in an invariant
if (INVALID_EDGE_WEIGHT != route_length)
{
JSON::Array json_last_instruction_row;
temp_instruction = IntToString(as_integer(TurnInstruction::ReachedYourDestination));
json_last_instruction_row.values.push_back(temp_instruction);
json_last_instruction_row.values.push_back("");
json_last_instruction_row.values.push_back(0);
json_last_instruction_row.values.push_back(necessary_segments_running_index - 1);
json_last_instruction_row.values.push_back(0);
json_last_instruction_row.values.push_back("0m");
json_last_instruction_row.values.push_back(Azimuth::Get(0.0));
json_last_instruction_row.values.push_back(0.);
json_instruction_array.values.push_back(json_last_instruction_row);
}
}
};
#endif /* JSON_DESCRIPTOR_H_ */

View File

@ -1,3 +0,0 @@
The javascript based web client is a seperate project available at
https://github.com/DennisSchiefer/Project-OSRM-Web

44
Doxyfile.in Normal file
View File

@ -0,0 +1,44 @@
PROJECT_NAME = "Project OSRM"
PROJECT_BRIEF = "Open Source Routing Machine"
BUILTIN_STL_SUPPORT = YES
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_PACKAGE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_ANON_NSPACES = YES
QUIET = YES
INPUT = @CMAKE_CURRENT_SOURCE_DIR@
USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/README.md
FILE_PATTERNS = *.h *.hpp *.c *.cc *.cpp *.md
RECURSIVE = YES
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/third_party \
@CMAKE_CURRENT_SOURCE_DIR@/build \
@CMAKE_CURRENT_SOURCE_DIR@/node_modules \
@CMAKE_CURRENT_SOURCE_DIR@/unit_tests \
@CMAKE_CURRENT_SOURCE_DIR@/benchmarks \
@CMAKE_CURRENT_SOURCE_DIR@/features
SOURCE_BROWSER = YES
CLANG_ASSISTED_PARSING = NO
HTML_COLORSTYLE_HUE = 217
HTML_COLORSTYLE_SAT = 71
HTML_COLORSTYLE_GAMMA = 50
GENERATE_TREEVIEW = YES
HAVE_DOT = @DOXYGEN_DOT_FOUND@
CALL_GRAPH = YES
CALLER_GRAPH = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES
DOT_GRAPH_MAX_NODES = 500
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = YES

View File

@ -1,139 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "BaseParser.h"
#include "ExtractionWay.h"
#include "ScriptingEnvironment.h"
#include "../DataStructures/ImportNode.h"
#include "../Util/LuaUtil.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <boost/ref.hpp>
#include <boost/regex.hpp>
BaseParser::BaseParser(ExtractorCallbacks *extractor_callbacks,
ScriptingEnvironment &scripting_environment)
: extractor_callbacks(extractor_callbacks),
lua_state(scripting_environment.getLuaStateForThreadID(0)),
scripting_environment(scripting_environment), use_turn_restrictions(true)
{
ReadUseRestrictionsSetting();
ReadRestrictionExceptions();
}
void BaseParser::ReadUseRestrictionsSetting()
{
if (0 != luaL_dostring(lua_state, "return use_turn_restrictions\n"))
{
throw OSRMException("ERROR occured in scripting block");
}
if (lua_isboolean(lua_state, -1))
{
use_turn_restrictions = lua_toboolean(lua_state, -1);
}
if (use_turn_restrictions)
{
SimpleLogger().Write() << "Using turn restrictions";
}
else
{
SimpleLogger().Write() << "Ignoring turn restrictions";
}
}
void BaseParser::ReadRestrictionExceptions()
{
if (lua_function_exists(lua_state, "get_exceptions"))
{
// get list of turn restriction exceptions
luabind::call_function<void>(
lua_state, "get_exceptions", boost::ref(restriction_exceptions));
const unsigned exception_count = restriction_exceptions.size();
SimpleLogger().Write() << "Found " << exception_count
<< " exceptions to turn restrictions:";
for (const std::string &str : restriction_exceptions)
{
SimpleLogger().Write() << " " << str;
}
}
else
{
SimpleLogger().Write() << "Found no exceptions to turn restrictions";
}
}
void BaseParser::report_errors(lua_State *lua_state, const int status) const
{
if (0 != status)
{
std::cerr << "-- " << lua_tostring(lua_state, -1) << std::endl;
lua_pop(lua_state, 1); // remove error message
}
}
void BaseParser::ParseNodeInLua(ImportNode &node, lua_State *local_lua_state)
{
luabind::call_function<void>(local_lua_state, "node_function", boost::ref(node));
}
void BaseParser::ParseWayInLua(ExtractionWay &way, lua_State *local_lua_state)
{
luabind::call_function<void>(local_lua_state, "way_function", boost::ref(way));
}
bool BaseParser::ShouldIgnoreRestriction(const std::string &except_tag_string) const
{
// should this restriction be ignored? yes if there's an overlap between:
// a) the list of modes in the except tag of the restriction
// (except_tag_string), eg: except=bus;bicycle
// b) the lua profile defines a hierachy of modes,
// eg: [access, vehicle, bicycle]
if (except_tag_string.empty())
{
return false;
}
// Be warned, this is quadratic work here, but we assume that
// only a few exceptions are actually defined.
std::vector<std::string> exceptions;
boost::algorithm::split_regex(exceptions, except_tag_string, boost::regex("[;][ ]*"));
for (std::string &current_string : exceptions)
{
const auto string_iterator =
std::find(restriction_exceptions.begin(), restriction_exceptions.end(), current_string);
if (restriction_exceptions.end() != string_iterator)
{
return true;
}
}
return false;
}

View File

@ -1,67 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BASEPARSER_H_
#define BASEPARSER_H_
#include <string>
#include <vector>
struct lua_State;
class ExtractorCallbacks;
class ScriptingEnvironment;
struct ExtractionWay;
struct ImportNode;
class BaseParser
{
public:
BaseParser() = delete;
BaseParser(const BaseParser &) = delete;
BaseParser(ExtractorCallbacks *extractor_callbacks,
ScriptingEnvironment &scripting_environment);
virtual ~BaseParser() {}
virtual bool ReadHeader() = 0;
virtual bool Parse() = 0;
virtual void ParseNodeInLua(ImportNode &node, lua_State *lua_state);
virtual void ParseWayInLua(ExtractionWay &way, lua_State *lua_state);
virtual void report_errors(lua_State *lua_state, const int status) const;
protected:
virtual void ReadUseRestrictionsSetting();
virtual void ReadRestrictionExceptions();
virtual bool ShouldIgnoreRestriction(const std::string &except_tag_string) const;
ExtractorCallbacks *extractor_callbacks;
lua_State *lua_state;
ScriptingEnvironment &scripting_environment;
std::vector<std::string> restriction_exceptions;
bool use_turn_restrictions;
};
#endif /* BASEPARSER_H_ */

View File

@ -1,451 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ExtractionContainers.h"
#include "ExtractionWay.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <stxxl/sort>
#include <chrono>
#include <limits>
ExtractionContainers::ExtractionContainers()
{
// Check if stxxl can be instantiated
stxxl::vector<unsigned> dummy_vector;
name_list.push_back("");
}
ExtractionContainers::~ExtractionContainers()
{
used_node_id_list.clear();
all_nodes_list.clear();
all_edges_list.clear();
name_list.clear();
restrictions_list.clear();
way_start_end_id_list.clear();
}
void ExtractionContainers::PrepareData(const std::string &output_file_name,
const std::string &restrictions_file_name)
{
try
{
unsigned number_of_used_nodes = 0;
unsigned number_of_used_edges = 0;
std::chrono::time_point<std::chrono::steady_clock> time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Sorting used nodes ... " << std::flush;
stxxl::sort(used_node_id_list.begin(), used_node_id_list.end(), Cmp(), stxxl_memory);
std::chrono::time_point<std::chrono::steady_clock> time2 = std::chrono::steady_clock::now();
std::chrono::duration<double> elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Erasing duplicate nodes ... " << std::flush;
auto new_end = std::unique(used_node_id_list.begin(), used_node_id_list.end());
used_node_id_list.resize(new_end - used_node_id_list.begin());
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Sorting all nodes ... " << std::flush;
stxxl::sort(all_nodes_list.begin(), all_nodes_list.end(), CmpNodeByID(), stxxl_memory);
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Sorting used ways ... " << std::flush;
stxxl::sort(
way_start_end_id_list.begin(), way_start_end_id_list.end(), CmpWayByID(), stxxl_memory);
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
std::cout << "[extractor] Sorting restrictions. by from... " << std::flush;
stxxl::sort(restrictions_list.begin(),
restrictions_list.end(),
CmpRestrictionContainerByFrom(),
stxxl_memory);
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
std::cout << "[extractor] Fixing restriction starts ... " << std::flush;
auto restrictions_iterator = restrictions_list.begin();
auto way_start_and_end_iterator = way_start_end_id_list.begin();
while (way_start_and_end_iterator != way_start_end_id_list.end() &&
restrictions_iterator != restrictions_list.end())
{
if (way_start_and_end_iterator->wayID < restrictions_iterator->fromWay)
{
++way_start_and_end_iterator;
continue;
}
if (way_start_and_end_iterator->wayID > restrictions_iterator->fromWay)
{
++restrictions_iterator;
continue;
}
BOOST_ASSERT(way_start_and_end_iterator->wayID == restrictions_iterator->fromWay);
const NodeID via_node_id = restrictions_iterator->restriction.viaNode;
if (way_start_and_end_iterator->firstStart == via_node_id)
{
restrictions_iterator->restriction.fromNode =
way_start_and_end_iterator->firstTarget;
}
else if (way_start_and_end_iterator->firstTarget == via_node_id)
{
restrictions_iterator->restriction.fromNode =
way_start_and_end_iterator->firstStart;
}
else if (way_start_and_end_iterator->lastStart == via_node_id)
{
restrictions_iterator->restriction.fromNode =
way_start_and_end_iterator->lastTarget;
}
else if (way_start_and_end_iterator->lastTarget == via_node_id)
{
restrictions_iterator->restriction.fromNode = way_start_and_end_iterator->lastStart;
}
++restrictions_iterator;
}
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Sorting restrictions. by to ... " << std::flush;
stxxl::sort(restrictions_list.begin(),
restrictions_list.end(),
CmpRestrictionContainerByTo(),
stxxl_memory);
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
unsigned number_of_useable_restrictions = 0;
std::cout << "[extractor] Fixing restriction ends ... " << std::flush;
restrictions_iterator = restrictions_list.begin();
way_start_and_end_iterator = way_start_end_id_list.begin();
while (way_start_and_end_iterator != way_start_end_id_list.end() &&
restrictions_iterator != restrictions_list.end())
{
if (way_start_and_end_iterator->wayID < restrictions_iterator->toWay)
{
++way_start_and_end_iterator;
continue;
}
if (way_start_and_end_iterator->wayID > restrictions_iterator->toWay)
{
++restrictions_iterator;
continue;
}
NodeID via_node_id = restrictions_iterator->restriction.viaNode;
if (way_start_and_end_iterator->lastStart == via_node_id)
{
restrictions_iterator->restriction.toNode = way_start_and_end_iterator->lastTarget;
}
else if (way_start_and_end_iterator->lastTarget == via_node_id)
{
restrictions_iterator->restriction.toNode = way_start_and_end_iterator->lastStart;
}
else if (way_start_and_end_iterator->firstStart == via_node_id)
{
restrictions_iterator->restriction.toNode = way_start_and_end_iterator->firstTarget;
}
else if (way_start_and_end_iterator->firstTarget == via_node_id)
{
restrictions_iterator->restriction.toNode = way_start_and_end_iterator->firstStart;
}
if (std::numeric_limits<unsigned>::max() != restrictions_iterator->restriction.fromNode &&
std::numeric_limits<unsigned>::max() != restrictions_iterator->restriction.toNode)
{
++number_of_useable_restrictions;
}
++restrictions_iterator;
}
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
SimpleLogger().Write() << "usable restrictions: " << number_of_useable_restrictions;
// serialize restrictions
std::ofstream restrictions_out_stream;
restrictions_out_stream.open(restrictions_file_name.c_str(), std::ios::binary);
restrictions_out_stream.write((char *)&uuid, sizeof(UUID));
restrictions_out_stream.write((char *)&number_of_useable_restrictions, sizeof(unsigned));
// for (restrictions_iterator = restrictions_list.begin();
// restrictions_iterator != restrictions_list.end();
// ++restrictions_iterator)
for(const auto & restriction_container : restrictions_list)
{
if (std::numeric_limits<unsigned>::max() != restriction_container.restriction.fromNode &&
std::numeric_limits<unsigned>::max() != restriction_container.restriction.toNode)
{
restrictions_out_stream.write((char *)&(restriction_container.restriction),
sizeof(TurnRestriction));
}
}
restrictions_out_stream.close();
std::ofstream file_out_stream;
file_out_stream.open(output_file_name.c_str(), std::ios::binary);
file_out_stream.write((char *)&uuid, sizeof(UUID));
file_out_stream.write((char *)&number_of_used_nodes, sizeof(unsigned));
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Confirming/Writing used nodes ... " << std::flush;
// identify all used nodes by a merging step of two sorted lists
auto node_iterator = all_nodes_list.begin();
auto node_id_iterator = used_node_id_list.begin();
while (node_id_iterator != used_node_id_list.end() && node_iterator != all_nodes_list.end())
{
if (*node_id_iterator < node_iterator->id)
{
++node_id_iterator;
continue;
}
if (*node_id_iterator > node_iterator->id)
{
++node_iterator;
continue;
}
BOOST_ASSERT(*node_id_iterator == node_iterator->id);
file_out_stream.write((char *)&(*node_iterator), sizeof(ExternalMemoryNode));
++number_of_used_nodes;
++node_id_iterator;
++node_iterator;
}
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
std::cout << "[extractor] setting number of nodes ... " << std::flush;
std::ios::pos_type previous_file_position = file_out_stream.tellp();
file_out_stream.seekp(std::ios::beg + sizeof(UUID));
file_out_stream.write((char *)&number_of_used_nodes, sizeof(unsigned));
file_out_stream.seekp(previous_file_position);
std::cout << "ok" << std::endl;
time1 = std::chrono::steady_clock::now();
// Sort edges by start.
std::cout << "[extractor] Sorting edges by start ... " << std::flush;
stxxl::sort(all_edges_list.begin(), all_edges_list.end(), CmpEdgeByStartID(), stxxl_memory);
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Setting start coords ... " << std::flush;
file_out_stream.write((char *)&number_of_used_edges, sizeof(unsigned));
// Traverse list of edges and nodes in parallel and set start coord
node_iterator = all_nodes_list.begin();
auto edge_iterator = all_edges_list.begin();
while (edge_iterator != all_edges_list.end() && node_iterator != all_nodes_list.end())
{
if (edge_iterator->start < node_iterator->id)
{
++edge_iterator;
continue;
}
if (edge_iterator->start > node_iterator->id)
{
node_iterator++;
continue;
}
BOOST_ASSERT(edge_iterator->start == node_iterator->id);
edge_iterator->source_coordinate.lat = node_iterator->lat;
edge_iterator->source_coordinate.lon = node_iterator->lon;
++edge_iterator;
}
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
// Sort Edges by target
std::cout << "[extractor] Sorting edges by target ... " << std::flush;
stxxl::sort(all_edges_list.begin(), all_edges_list.end(), CmpEdgeByTargetID(), stxxl_memory);
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] Setting target coords ... " << std::flush;
// Traverse list of edges and nodes in parallel and set target coord
node_iterator = all_nodes_list.begin();
edge_iterator = all_edges_list.begin();
while (edge_iterator != all_edges_list.end() && node_iterator != all_nodes_list.end())
{
if (edge_iterator->target < node_iterator->id)
{
++edge_iterator;
continue;
}
if (edge_iterator->target > node_iterator->id)
{
++node_iterator;
continue;
}
BOOST_ASSERT(edge_iterator->target == node_iterator->id);
if (edge_iterator->source_coordinate.lat != std::numeric_limits<int>::min() &&
edge_iterator->source_coordinate.lon != std::numeric_limits<int>::min())
{
BOOST_ASSERT(edge_iterator->speed != -1);
BOOST_ASSERT(edge_iterator->type >= 0);
edge_iterator->target_coordinate.lat = node_iterator->lat;
edge_iterator->target_coordinate.lon = node_iterator->lon;
const double distance = FixedPointCoordinate::ApproximateEuclideanDistance(
edge_iterator->source_coordinate.lat,
edge_iterator->source_coordinate.lon,
node_iterator->lat,
node_iterator->lon);
const double weight = (distance * 10.) / (edge_iterator->speed / 3.6);
int integer_weight = std::max(
1,
(int)std::floor(
(edge_iterator->is_duration_set ? edge_iterator->speed : weight) + .5));
int integer_distance = std::max(1, (int)distance);
short zero = 0;
short one = 1;
file_out_stream.write((char *)&edge_iterator->start, sizeof(unsigned));
file_out_stream.write((char *)&edge_iterator->target, sizeof(unsigned));
file_out_stream.write((char *)&integer_distance, sizeof(int));
switch (edge_iterator->direction)
{
case ExtractionWay::notSure:
file_out_stream.write((char *)&zero, sizeof(short));
break;
case ExtractionWay::oneway:
file_out_stream.write((char *)&one, sizeof(short));
break;
case ExtractionWay::bidirectional:
file_out_stream.write((char *)&zero, sizeof(short));
break;
case ExtractionWay::opposite:
file_out_stream.write((char *)&one, sizeof(short));
break;
default:
throw OSRMException("edge has broken direction");
}
file_out_stream.write((char *)&integer_weight, sizeof(int));
file_out_stream.write((char *)&edge_iterator->type, sizeof(short));
file_out_stream.write((char *)&edge_iterator->name_id, sizeof(unsigned));
file_out_stream.write((char *)&edge_iterator->is_roundabout, sizeof(bool));
file_out_stream.write((char *)&edge_iterator->is_in_tiny_cc, sizeof(bool));
file_out_stream.write((char *)&edge_iterator->is_access_restricted, sizeof(bool));
file_out_stream.write((char *)&edge_iterator->is_contra_flow, sizeof(bool));
file_out_stream.write((char *)&edge_iterator->is_split, sizeof(bool));
++number_of_used_edges;
}
++edge_iterator;
}
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
std::cout << "[extractor] setting number of edges ... " << std::flush;
file_out_stream.seekp(previous_file_position);
file_out_stream.write((char *)&number_of_used_edges, sizeof(unsigned));
file_out_stream.close();
std::cout << "ok" << std::endl;
time1 = std::chrono::steady_clock::now();
std::cout << "[extractor] writing street name index ... " << std::flush;
std::string name_file_streamName = (output_file_name + ".names");
boost::filesystem::ofstream name_file_stream(name_file_streamName, std::ios::binary);
// write number of names
const unsigned number_of_names = name_list.size() + 1;
name_file_stream.write((char *)&(number_of_names), sizeof(unsigned));
// compute total number of chars
unsigned total_number_of_chars = 0;
for (const std::string &temp_string : name_list)
{
total_number_of_chars += temp_string.length();
}
// write total number of chars
name_file_stream.write((char *)&(total_number_of_chars), sizeof(unsigned));
// write prefixe sums
unsigned name_lengths_prefix_sum = 0;
for (const std::string &temp_string : name_list)
{
name_file_stream.write((char *)&(name_lengths_prefix_sum), sizeof(unsigned));
name_lengths_prefix_sum += temp_string.length();
}
// duplicate on purpose!
name_file_stream.write((char *)&(name_lengths_prefix_sum), sizeof(unsigned));
// write all chars consecutively
for (const std::string &temp_string : name_list)
{
const unsigned string_length = temp_string.length();
name_file_stream.write(temp_string.c_str(), string_length);
}
name_file_stream.close();
time2 = std::chrono::steady_clock::now();
elapsed_seconds = time2 - time1;
std::cout << "ok, after " << elapsed_seconds.count() << "s" << std::endl;
SimpleLogger().Write() << "Processed " << number_of_used_nodes << " nodes and "
<< number_of_used_edges << " edges";
}
catch (const std::exception &e) { std::cerr << "Caught Execption:" << e.what() << std::endl; }
}

View File

@ -1,65 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTRACTIONCONTAINERS_H_
#define EXTRACTIONCONTAINERS_H_
#include "InternalExtractorEdge.h"
#include "ExtractorStructs.h"
#include "../DataStructures/Restriction.h"
#include "../Util/UUID.h"
#include <stxxl/vector>
class ExtractionContainers
{
constexpr static unsigned stxxl_memory = ((sizeof(std::size_t) == 4) ? std::numeric_limits<int>::max() : std::numeric_limits<unsigned>::max());
public:
typedef stxxl::vector<NodeID> STXXLNodeIDVector;
typedef stxxl::vector<ExternalMemoryNode> STXXLNodeVector;
typedef stxxl::vector<InternalExtractorEdge> STXXLEdgeVector;
typedef stxxl::vector<std::string> STXXLStringVector;
typedef stxxl::vector<InputRestrictionContainer> STXXLRestrictionsVector;
typedef stxxl::vector<WayIDStartAndEndEdge> STXXLWayIDStartEndVector;
STXXLNodeIDVector used_node_id_list;
STXXLNodeVector all_nodes_list;
STXXLEdgeVector all_edges_list;
STXXLStringVector name_list;
STXXLRestrictionsVector restrictions_list;
STXXLWayIDStartEndVector way_start_end_id_list;
const UUID uuid;
ExtractionContainers();
virtual ~ExtractionContainers();
void PrepareData(const std::string &output_file_name,
const std::string &restrictions_file_name);
};
#endif /* EXTRACTIONCONTAINERS_H_ */

View File

@ -1,89 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTRACTION_HELPER_FUNCTIONS_H
#define EXTRACTION_HELPER_FUNCTIONS_H
#include "../Util/StringUtil.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string_regex.hpp>
#include <boost/regex.hpp>
#include <limits>
namespace qi = boost::spirit::qi;
// TODO: Move into LUA
inline bool durationIsValid(const std::string &s)
{
boost::regex e(
"((\\d|\\d\\d):(\\d|\\d\\d):(\\d|\\d\\d))|((\\d|\\d\\d):(\\d|\\d\\d))|(\\d|\\d\\d)",
boost::regex_constants::icase | boost::regex_constants::perl);
std::vector<std::string> result;
boost::algorithm::split_regex(result, s, boost::regex(":"));
bool matched = regex_match(s, e);
return matched;
}
inline unsigned parseDuration(const std::string &s)
{
unsigned hours = 0;
unsigned minutes = 0;
unsigned seconds = 0;
boost::regex e(
"((\\d|\\d\\d):(\\d|\\d\\d):(\\d|\\d\\d))|((\\d|\\d\\d):(\\d|\\d\\d))|(\\d|\\d\\d)",
boost::regex_constants::icase | boost::regex_constants::perl);
std::vector<std::string> result;
boost::algorithm::split_regex(result, s, boost::regex(":"));
bool matched = regex_match(s, e);
if (matched)
{
if (1 == result.size())
{
minutes = stringToInt(result[0]);
}
if (2 == result.size())
{
minutes = stringToInt(result[1]);
hours = stringToInt(result[0]);
}
if (3 == result.size())
{
seconds = stringToInt(result[2]);
minutes = stringToInt(result[1]);
hours = stringToInt(result[0]);
}
return 10 * (3600 * hours + 60 * minutes + seconds);
}
return std::numeric_limits<unsigned>::max();
}
#endif // EXTRACTION_HELPER_FUNCTIONS_H_

View File

@ -1,79 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTRACTION_WAY_H
#define EXTRACTION_WAY_H
#include "../DataStructures/HashTable.h"
#include "../typedefs.h"
#include <string>
#include <vector>
struct ExtractionWay
{
ExtractionWay() { Clear(); }
inline void Clear()
{
id = SPECIAL_NODEID;
nameID = INVALID_NAMEID;
path.clear();
keyVals.clear();
direction = ExtractionWay::notSure;
speed = -1;
backward_speed = -1;
duration = -1;
type = -1;
access = true;
roundabout = false;
isAccessRestricted = false;
ignoreInGrid = false;
}
enum Directions
{ notSure = 0,
oneway,
bidirectional,
opposite };
unsigned id;
unsigned nameID;
double speed;
double backward_speed;
double duration;
Directions direction;
std::string name;
short type;
bool access;
bool roundabout;
bool isAccessRestricted;
bool ignoreInGrid;
std::vector<NodeID> path;
HashTable<std::string, std::string> keyVals;
};
#endif // EXTRACTION_WAY_H

View File

@ -1,166 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ExtractorCallbacks.h"
#include "ExtractionContainers.h"
#include "ExtractionWay.h"
#include "../DataStructures/Restriction.h"
#include "../DataStructures/ImportNode.h"
#include "../Util/SimpleLogger.h"
#include <osrm/Coordinate.h>
#include <limits>
#include <string>
#include <vector>
ExtractorCallbacks::ExtractorCallbacks(ExtractionContainers &extraction_containers,
std::unordered_map<std::string, NodeID> &string_map)
: string_map(string_map), external_memory(extraction_containers)
{
}
/** warning: caller needs to take care of synchronization! */
void ExtractorCallbacks::ProcessNode(const ExternalMemoryNode &n)
{
if (n.lat <= 85 * COORDINATE_PRECISION && n.lat >= -85 * COORDINATE_PRECISION)
{
external_memory.all_nodes_list.push_back(n);
}
}
bool ExtractorCallbacks::ProcessRestriction(const InputRestrictionContainer &restriction)
{
external_memory.restrictions_list.push_back(restriction);
return true;
}
/** warning: caller needs to take care of synchronization! */
void ExtractorCallbacks::ProcessWay(ExtractionWay &parsed_way)
{
if ((0 >= parsed_way.speed) && (0 >= parsed_way.duration))
{ // Only true if the way is specified by the speed profile
return;
}
if (std::numeric_limits<unsigned>::max() == parsed_way.id)
{
SimpleLogger().Write(logDEBUG) << "found bogus way with id: " << parsed_way.id
<< " of size " << parsed_way.path.size();
return;
}
if (0 < parsed_way.duration)
{
// TODO: iterate all way segments and set duration corresponding to the length of each
// segment
parsed_way.speed = parsed_way.duration / (parsed_way.path.size() - 1);
}
if (std::numeric_limits<double>::epsilon() >= std::abs(-1. - parsed_way.speed))
{
SimpleLogger().Write(logDEBUG) << "found way with bogus speed, id: " << parsed_way.id;
return;
}
// Get the unique identifier for the street name
const auto &string_map_iterator = string_map.find(parsed_way.name);
if (string_map.end() == string_map_iterator)
{
parsed_way.nameID = external_memory.name_list.size();
external_memory.name_list.push_back(parsed_way.name);
string_map.insert(std::make_pair(parsed_way.name, parsed_way.nameID));
}
else
{
parsed_way.nameID = string_map_iterator->second;
}
if (ExtractionWay::opposite == parsed_way.direction)
{
std::reverse(parsed_way.path.begin(), parsed_way.path.end());
parsed_way.direction = ExtractionWay::oneway;
}
const bool split_bidirectional_edge =
(parsed_way.backward_speed > 0) && (parsed_way.speed != parsed_way.backward_speed);
for (unsigned n = 0; n < parsed_way.path.size() - 1; ++n)
{
external_memory.all_edges_list.push_back(InternalExtractorEdge(
parsed_way.path[n],
parsed_way.path[n + 1],
parsed_way.type,
(split_bidirectional_edge ? ExtractionWay::oneway : parsed_way.direction),
parsed_way.speed,
parsed_way.nameID,
parsed_way.roundabout,
parsed_way.ignoreInGrid,
(0 < parsed_way.duration),
parsed_way.isAccessRestricted,
false,
split_bidirectional_edge));
external_memory.used_node_id_list.push_back(parsed_way.path[n]);
}
external_memory.used_node_id_list.push_back(parsed_way.path.back());
// The following information is needed to identify start and end segments of restrictions
external_memory.way_start_end_id_list.push_back(
WayIDStartAndEndEdge(parsed_way.id,
parsed_way.path[0],
parsed_way.path[1],
parsed_way.path[parsed_way.path.size() - 2],
parsed_way.path.back()));
if (split_bidirectional_edge)
{ // Only true if the way should be split
std::reverse(parsed_way.path.begin(), parsed_way.path.end());
for (std::vector<NodeID>::size_type n = 0; n < parsed_way.path.size() - 1; ++n)
{
external_memory.all_edges_list.push_back(
InternalExtractorEdge(parsed_way.path[n],
parsed_way.path[n + 1],
parsed_way.type,
ExtractionWay::oneway,
parsed_way.backward_speed,
parsed_way.nameID,
parsed_way.roundabout,
parsed_way.ignoreInGrid,
(0 < parsed_way.duration),
parsed_way.isAccessRestricted,
(ExtractionWay::oneway == parsed_way.direction),
split_bidirectional_edge));
}
external_memory.way_start_end_id_list.push_back(
WayIDStartAndEndEdge(parsed_way.id,
parsed_way.path[0],
parsed_way.path[1],
parsed_way.path[parsed_way.path.size() - 2],
parsed_way.path.back()));
}
}

View File

@ -1,63 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTRACTOR_CALLBACKS_H
#define EXTRACTOR_CALLBACKS_H
#include "../typedefs.h"
#include <unordered_map>
#include <string>
struct ExternalMemoryNode;
class ExtractionContainers;
struct ExtractionWay;
struct InputRestrictionContainer;
class ExtractorCallbacks
{
private:
std::unordered_map<std::string, NodeID> &string_map;
ExtractionContainers &external_memory;
public:
ExtractorCallbacks() = delete;
ExtractorCallbacks(const ExtractorCallbacks &) = delete;
explicit ExtractorCallbacks(ExtractionContainers &extraction_containers,
std::unordered_map<std::string, NodeID> &string_map);
// warning: caller needs to take care of synchronization!
void ProcessNode(const ExternalMemoryNode &node);
// warning: caller needs to take care of synchronization!
bool ProcessRestriction(const InputRestrictionContainer &restriction);
// warning: caller needs to take care of synchronization!
void ProcessWay(ExtractionWay &way);
};
#endif /* EXTRACTOR_CALLBACKS_H */

View File

@ -1,114 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EXTRACTORSTRUCTS_H_
#define EXTRACTORSTRUCTS_H_
#include "../DataStructures/HashTable.h"
#include "../DataStructures/ImportNode.h"
#include "../typedefs.h"
#include <limits>
#include <string>
struct ExtractorRelation
{
ExtractorRelation() : type(unknown) {}
enum
{ unknown = 0,
ferry,
turnRestriction } type;
HashTable<std::string, std::string> keyVals;
};
struct WayIDStartAndEndEdge
{
unsigned wayID;
NodeID firstStart;
NodeID firstTarget;
NodeID lastStart;
NodeID lastTarget;
WayIDStartAndEndEdge()
: wayID(std::numeric_limits<unsigned>::max()), firstStart(std::numeric_limits<unsigned>::max()), firstTarget(std::numeric_limits<unsigned>::max()), lastStart(std::numeric_limits<unsigned>::max()),
lastTarget(std::numeric_limits<unsigned>::max())
{
}
explicit WayIDStartAndEndEdge(unsigned w, NodeID fs, NodeID ft, NodeID ls, NodeID lt)
: wayID(w), firstStart(fs), firstTarget(ft), lastStart(ls), lastTarget(lt)
{
}
static WayIDStartAndEndEdge min_value()
{
return WayIDStartAndEndEdge((std::numeric_limits<unsigned>::min)(),
(std::numeric_limits<unsigned>::min)(),
(std::numeric_limits<unsigned>::min)(),
(std::numeric_limits<unsigned>::min)(),
(std::numeric_limits<unsigned>::min)());
}
static WayIDStartAndEndEdge max_value()
{
return WayIDStartAndEndEdge((std::numeric_limits<unsigned>::max)(),
(std::numeric_limits<unsigned>::max)(),
(std::numeric_limits<unsigned>::max)(),
(std::numeric_limits<unsigned>::max)(),
(std::numeric_limits<unsigned>::max)());
}
};
struct CmpWayByID
{
typedef WayIDStartAndEndEdge value_type;
bool operator()(const WayIDStartAndEndEdge &a, const WayIDStartAndEndEdge &b) const
{
return a.wayID < b.wayID;
}
value_type max_value() { return WayIDStartAndEndEdge::max_value(); }
value_type min_value() { return WayIDStartAndEndEdge::min_value(); }
};
struct Cmp
{
typedef NodeID value_type;
bool operator()(const NodeID a, const NodeID b) const { return a < b; }
value_type max_value() { return 0xffffffff; }
value_type min_value() { return 0x0; }
};
struct CmpNodeByID
{
typedef ExternalMemoryNode value_type;
bool operator()(const ExternalMemoryNode &a, const ExternalMemoryNode &b) const
{
return a.id < b.id;
}
value_type max_value() { return ExternalMemoryNode::max_value(); }
value_type min_value() { return ExternalMemoryNode::min_value(); }
};
#endif /* EXTRACTORSTRUCTS_H_ */

View File

@ -1,120 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef INTERNAL_EXTRACTOR_EDGE_H
#define INTERNAL_EXTRACTOR_EDGE_H
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <boost/assert.hpp>
struct InternalExtractorEdge
{
InternalExtractorEdge()
: start(0), target(0), type(0), direction(0), speed(0), name_id(0), is_roundabout(false),
is_in_tiny_cc(false), is_duration_set(false), is_access_restricted(false),
is_contra_flow(false), is_split(false)
{
}
explicit InternalExtractorEdge(NodeID start,
NodeID target,
short type,
short direction,
double speed,
unsigned name_id,
bool is_roundabout,
bool is_in_tiny_cc,
bool is_duration_set,
bool is_access_restricted,
bool is_contra_flow,
bool is_split)
: start(start), target(target), type(type), direction(direction), speed(speed),
name_id(name_id), is_roundabout(is_roundabout), is_in_tiny_cc(is_in_tiny_cc),
is_duration_set(is_duration_set), is_access_restricted(is_access_restricted),
is_contra_flow(is_contra_flow), is_split(is_split)
{
BOOST_ASSERT(0 <= type);
}
// necessary static util functions for stxxl's sorting
static InternalExtractorEdge min_value()
{
return InternalExtractorEdge(0, 0, 0, 0, 0, 0, false, false, false, false, false, false);
}
static InternalExtractorEdge max_value()
{
return InternalExtractorEdge(
SPECIAL_NODEID, SPECIAL_NODEID, 0, 0, 0, 0, false, false, false, false, false, false);
}
NodeID start;
NodeID target;
short type;
short direction;
double speed;
unsigned name_id;
bool is_roundabout;
bool is_in_tiny_cc;
bool is_duration_set;
bool is_access_restricted;
bool is_contra_flow;
bool is_split;
FixedPointCoordinate source_coordinate;
FixedPointCoordinate target_coordinate;
};
struct CmpEdgeByStartID
{
typedef InternalExtractorEdge value_type;
bool operator()(const InternalExtractorEdge &a, const InternalExtractorEdge &b) const
{
return a.start < b.start;
}
value_type max_value() { return InternalExtractorEdge::max_value(); }
value_type min_value() { return InternalExtractorEdge::min_value(); }
};
struct CmpEdgeByTargetID
{
typedef InternalExtractorEdge value_type;
bool operator()(const InternalExtractorEdge &a, const InternalExtractorEdge &b) const
{
return a.target < b.target;
}
value_type max_value() { return InternalExtractorEdge::max_value(); }
value_type min_value() { return InternalExtractorEdge::min_value(); }
};
#endif // INTERNAL_EXTRACTOR_EDGE_H

View File

@ -1,638 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "PBFParser.h"
#include "ExtractionWay.h"
#include "ExtractorCallbacks.h"
#include "ScriptingEnvironment.h"
#include "../DataStructures/HashTable.h"
#include "../DataStructures/ImportNode.h"
#include "../DataStructures/Restriction.h"
#include "../Util/MachineInfo.h"
#include "../Util/OpenMPWrapper.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
#include <zlib.h>
#include <functional>
#include <limits>
#include <thread>
PBFParser::PBFParser(const char *fileName,
ExtractorCallbacks *extractor_callbacks,
ScriptingEnvironment &scripting_environment)
: BaseParser(extractor_callbacks, scripting_environment)
{
GOOGLE_PROTOBUF_VERIFY_VERSION;
// TODO: What is the bottleneck here? Filling the queue or reading the stuff from disk?
// NOTE: With Lua scripting, it is parsing the stuff. I/O is virtually for free.
// Max 2500 items in queue, hardcoded.
thread_data_queue = std::make_shared<ConcurrentQueue<ParserThreadData *>>(2500);
input.open(fileName, std::ios::in | std::ios::binary);
if (!input)
{
throw OSRMException("pbf file not found.");
}
block_count = 0;
group_count = 0;
}
PBFParser::~PBFParser()
{
if (input.is_open())
{
input.close();
}
// Clean up any leftover ThreadData objects in the queue
ParserThreadData *thread_data;
while (thread_data_queue->try_pop(thread_data))
{
delete thread_data;
}
google::protobuf::ShutdownProtobufLibrary();
SimpleLogger().Write(logDEBUG) << "parsed " << block_count << " blocks from pbf with "
<< group_count << " groups";
}
inline bool PBFParser::ReadHeader()
{
ParserThreadData init_data;
/** read Header */
if (!readPBFBlobHeader(input, &init_data))
{
return false;
}
if (readBlob(input, &init_data))
{
if (!init_data.PBFHeaderBlock.ParseFromArray(&(init_data.charBuffer[0]),
init_data.charBuffer.size()))
{
std::cerr << "[error] Header not parseable!" << std::endl;
return false;
}
const auto feature_size = init_data.PBFHeaderBlock.required_features_size();
for (int i = 0; i < feature_size; ++i)
{
const std::string &feature = init_data.PBFHeaderBlock.required_features(i);
bool supported = false;
if ("OsmSchema-V0.6" == feature)
{
supported = true;
}
else if ("DenseNodes" == feature)
{
supported = true;
}
if (!supported)
{
std::cerr << "[error] required feature not supported: " << feature.data()
<< std::endl;
return false;
}
}
}
else
{
std::cerr << "[error] blob not loaded!" << std::endl;
}
return true;
}
inline void PBFParser::ReadData()
{
bool keep_running = true;
do
{
ParserThreadData *thread_data = new ParserThreadData();
keep_running = readNextBlock(input, thread_data);
if (keep_running)
{
thread_data_queue->push(thread_data);
}
else
{
// No more data to read, parse stops when nullptr encountered
thread_data_queue->push(nullptr);
delete thread_data;
}
} while (keep_running);
}
inline void PBFParser::ParseData()
{
while (true)
{
ParserThreadData *thread_data;
thread_data_queue->wait_and_pop(thread_data);
if (nullptr == thread_data)
{
thread_data_queue->push(nullptr); // Signal end of data for other threads
break;
}
loadBlock(thread_data);
int group_size = thread_data->PBFprimitiveBlock.primitivegroup_size();
for (int i = 0; i < group_size; ++i)
{
thread_data->currentGroupID = i;
loadGroup(thread_data);
if (thread_data->entityTypeIndicator == TypeNode)
{
parseNode(thread_data);
}
if (thread_data->entityTypeIndicator == TypeWay)
{
parseWay(thread_data);
}
if (thread_data->entityTypeIndicator == TypeRelation)
{
parseRelation(thread_data);
}
if (thread_data->entityTypeIndicator == TypeDenseNode)
{
parseDenseNode(thread_data);
}
}
delete thread_data;
thread_data = nullptr;
}
}
inline bool PBFParser::Parse()
{
// Start the read and parse threads
std::thread read_thread(std::bind(&PBFParser::ReadData, this));
// Open several parse threads that are synchronized before call to
std::thread parse_thread(std::bind(&PBFParser::ParseData, this));
// Wait for the threads to finish
read_thread.join();
parse_thread.join();
return true;
}
inline void PBFParser::parseDenseNode(ParserThreadData *thread_data)
{
const OSMPBF::DenseNodes &dense =
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID).dense();
int denseTagIndex = 0;
int64_t m_lastDenseID = 0;
int64_t m_lastDenseLatitude = 0;
int64_t m_lastDenseLongitude = 0;
const int number_of_nodes = dense.id_size();
std::vector<ImportNode> extracted_nodes_vector(number_of_nodes);
for (int i = 0; i < number_of_nodes; ++i)
{
m_lastDenseID += dense.id(i);
m_lastDenseLatitude += dense.lat(i);
m_lastDenseLongitude += dense.lon(i);
extracted_nodes_vector[i].id = m_lastDenseID;
extracted_nodes_vector[i].lat =
COORDINATE_PRECISION *
((double)m_lastDenseLatitude * thread_data->PBFprimitiveBlock.granularity() +
thread_data->PBFprimitiveBlock.lat_offset()) /
NANO;
extracted_nodes_vector[i].lon =
COORDINATE_PRECISION *
((double)m_lastDenseLongitude * thread_data->PBFprimitiveBlock.granularity() +
thread_data->PBFprimitiveBlock.lon_offset()) /
NANO;
while (denseTagIndex < dense.keys_vals_size())
{
const int tagValue = dense.keys_vals(denseTagIndex);
if (0 == tagValue)
{
++denseTagIndex;
break;
}
const int keyValue = dense.keys_vals(denseTagIndex + 1);
const std::string &key = thread_data->PBFprimitiveBlock.stringtable().s(tagValue);
const std::string &value = thread_data->PBFprimitiveBlock.stringtable().s(keyValue);
extracted_nodes_vector[i].keyVals.emplace(key, value);
denseTagIndex += 2;
}
}
#pragma omp parallel
{
const int thread_num = omp_get_thread_num();
#pragma omp parallel for schedule(guided)
for (int i = 0; i < number_of_nodes; ++i)
{
ImportNode &import_node = extracted_nodes_vector[i];
ParseNodeInLua(import_node, scripting_environment.getLuaStateForThreadID(thread_num));
}
}
for (const ImportNode &import_node : extracted_nodes_vector)
{
extractor_callbacks->ProcessNode(import_node);
}
}
inline void PBFParser::parseNode(ParserThreadData *)
{
throw OSRMException("Parsing of simple nodes not supported. PBF should use dense nodes");
}
inline void PBFParser::parseRelation(ParserThreadData *thread_data)
{
// TODO: leave early, if relation is not a restriction
// TODO: reuse rawRestriction container
if (!use_turn_restrictions)
{
return;
}
const OSMPBF::PrimitiveGroup &group =
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID);
for (int i = 0, relation_size = group.relations_size(); i < relation_size; ++i)
{
std::string except_tag_string;
const OSMPBF::Relation &inputRelation =
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID).relations(i);
bool isRestriction = false;
bool isOnlyRestriction = false;
for (int k = 0, endOfKeys = inputRelation.keys_size(); k < endOfKeys; ++k)
{
const std::string &key =
thread_data->PBFprimitiveBlock.stringtable().s(inputRelation.keys(k));
const std::string &val =
thread_data->PBFprimitiveBlock.stringtable().s(inputRelation.vals(k));
if ("type" == key)
{
if ("restriction" == val)
{
isRestriction = true;
}
else
{
break;
}
}
if (("restriction" == key) && (val.find("only_") == 0))
{
isOnlyRestriction = true;
}
if ("except" == key)
{
except_tag_string = val;
}
}
if (isRestriction && ShouldIgnoreRestriction(except_tag_string))
{
continue;
}
if (isRestriction)
{
int64_t lastRef = 0;
InputRestrictionContainer currentRestrictionContainer(isOnlyRestriction);
for (int rolesIndex = 0, last_role = inputRelation.roles_sid_size();
rolesIndex < last_role;
++rolesIndex)
{
const std::string &role = thread_data->PBFprimitiveBlock.stringtable().s(
inputRelation.roles_sid(rolesIndex));
lastRef += inputRelation.memids(rolesIndex);
if (!("from" == role || "to" == role || "via" == role))
{
continue;
}
switch (inputRelation.types(rolesIndex))
{
case 0: // node
if ("from" == role || "to" == role)
{ // Only via should be a node
continue;
}
assert("via" == role);
if (std::numeric_limits<unsigned>::max() != currentRestrictionContainer.viaNode)
{
currentRestrictionContainer.viaNode = std::numeric_limits<unsigned>::max();
}
assert(std::numeric_limits<unsigned>::max() == currentRestrictionContainer.viaNode);
currentRestrictionContainer.restriction.viaNode = lastRef;
break;
case 1: // way
assert("from" == role || "to" == role || "via" == role);
if ("from" == role)
{
currentRestrictionContainer.fromWay = lastRef;
}
if ("to" == role)
{
currentRestrictionContainer.toWay = lastRef;
}
if ("via" == role)
{
assert(currentRestrictionContainer.restriction.toNode == std::numeric_limits<unsigned>::max());
currentRestrictionContainer.viaNode = lastRef;
}
break;
case 2: // relation, not used. relations relating to relations are evil.
continue;
assert(false);
break;
default: // should not happen
assert(false);
break;
}
}
if (!extractor_callbacks->ProcessRestriction(currentRestrictionContainer))
{
std::cerr << "[PBFParser] relation not parsed" << std::endl;
}
}
}
}
inline void PBFParser::parseWay(ParserThreadData *thread_data)
{
const int number_of_ways =
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID).ways_size();
std::vector<ExtractionWay> parsed_way_vector(number_of_ways);
for (int i = 0; i < number_of_ways; ++i)
{
const OSMPBF::Way &inputWay =
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID).ways(i);
parsed_way_vector[i].id = inputWay.id();
unsigned pathNode(0);
const int number_of_referenced_nodes = inputWay.refs_size();
for (int j = 0; j < number_of_referenced_nodes; ++j)
{
pathNode += inputWay.refs(j);
parsed_way_vector[i].path.push_back(pathNode);
}
assert(inputWay.keys_size() == inputWay.vals_size());
const int number_of_keys = inputWay.keys_size();
for (int j = 0; j < number_of_keys; ++j)
{
const std::string &key =
thread_data->PBFprimitiveBlock.stringtable().s(inputWay.keys(j));
const std::string &val =
thread_data->PBFprimitiveBlock.stringtable().s(inputWay.vals(j));
parsed_way_vector[i].keyVals.emplace(key, val);
}
}
#pragma omp parallel for schedule(guided)
for (int i = 0; i < number_of_ways; ++i)
{
ExtractionWay &extraction_way = parsed_way_vector[i];
if (2 <= extraction_way.path.size())
{
ParseWayInLua(extraction_way,
scripting_environment.getLuaStateForThreadID(omp_get_thread_num()));
}
}
for (ExtractionWay &extraction_way : parsed_way_vector)
{
if (2 <= extraction_way.path.size())
{
extractor_callbacks->ProcessWay(extraction_way);
}
}
}
inline void PBFParser::loadGroup(ParserThreadData *thread_data)
{
#ifndef NDEBUG
++group_count;
#endif
const OSMPBF::PrimitiveGroup &group =
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID);
thread_data->entityTypeIndicator = TypeDummy;
if (0 != group.nodes_size())
{
thread_data->entityTypeIndicator = TypeNode;
}
if (0 != group.ways_size())
{
thread_data->entityTypeIndicator = TypeWay;
}
if (0 != group.relations_size())
{
thread_data->entityTypeIndicator = TypeRelation;
}
if (group.has_dense())
{
thread_data->entityTypeIndicator = TypeDenseNode;
assert(0 != group.dense().id_size());
}
assert(thread_data->entityTypeIndicator != TypeDummy);
}
inline void PBFParser::loadBlock(ParserThreadData *thread_data)
{
++block_count;
thread_data->currentGroupID = 0;
thread_data->currentEntityID = 0;
}
inline bool PBFParser::readPBFBlobHeader(std::fstream &stream, ParserThreadData *thread_data)
{
int size(0);
stream.read((char *)&size, sizeof(int));
size = SwapEndian(size);
if (stream.eof())
{
return false;
}
if (size > MAX_BLOB_HEADER_SIZE || size < 0)
{
return false;
}
char *data = new char[size];
stream.read(data, size * sizeof(data[0]));
bool dataSuccessfullyParsed = (thread_data->PBFBlobHeader).ParseFromArray(data, size);
delete[] data;
return dataSuccessfullyParsed;
}
inline bool PBFParser::unpackZLIB(std::fstream &, ParserThreadData *thread_data)
{
unsigned rawSize = thread_data->PBFBlob.raw_size();
char *unpackedDataArray = new char[rawSize];
z_stream compressedDataStream;
compressedDataStream.next_in = (unsigned char *)thread_data->PBFBlob.zlib_data().data();
compressedDataStream.avail_in = thread_data->PBFBlob.zlib_data().size();
compressedDataStream.next_out = (unsigned char *)unpackedDataArray;
compressedDataStream.avail_out = rawSize;
compressedDataStream.zalloc = Z_NULL;
compressedDataStream.zfree = Z_NULL;
compressedDataStream.opaque = Z_NULL;
int ret = inflateInit(&compressedDataStream);
if (ret != Z_OK)
{
std::cerr << "[error] failed to init zlib stream" << std::endl;
delete[] unpackedDataArray;
return false;
}
ret = inflate(&compressedDataStream, Z_FINISH);
if (ret != Z_STREAM_END)
{
std::cerr << "[error] failed to inflate zlib stream" << std::endl;
std::cerr << "[error] Error type: " << ret << std::endl;
delete[] unpackedDataArray;
return false;
}
ret = inflateEnd(&compressedDataStream);
if (ret != Z_OK)
{
std::cerr << "[error] failed to deinit zlib stream" << std::endl;
delete[] unpackedDataArray;
return false;
}
thread_data->charBuffer.clear();
thread_data->charBuffer.resize(rawSize);
std::copy(unpackedDataArray, unpackedDataArray + rawSize, thread_data->charBuffer.begin());
delete[] unpackedDataArray;
return true;
}
inline bool PBFParser::unpackLZMA(std::fstream &, ParserThreadData *) { return false; }
inline bool PBFParser::readBlob(std::fstream &stream, ParserThreadData *thread_data)
{
if (stream.eof())
{
return false;
}
const int size = thread_data->PBFBlobHeader.datasize();
if (size < 0 || size > MAX_BLOB_SIZE)
{
std::cerr << "[error] invalid Blob size:" << size << std::endl;
return false;
}
char *data = new char[size];
stream.read(data, sizeof(data[0]) * size);
if (!thread_data->PBFBlob.ParseFromArray(data, size))
{
std::cerr << "[error] failed to parse blob" << std::endl;
delete[] data;
return false;
}
if (thread_data->PBFBlob.has_raw())
{
const std::string &data = thread_data->PBFBlob.raw();
thread_data->charBuffer.clear();
thread_data->charBuffer.resize(data.size());
std::copy(data.begin(), data.end(), thread_data->charBuffer.begin());
}
else if (thread_data->PBFBlob.has_zlib_data())
{
if (!unpackZLIB(stream, thread_data))
{
std::cerr << "[error] zlib data encountered that could not be unpacked" << std::endl;
delete[] data;
return false;
}
}
else if (thread_data->PBFBlob.has_lzma_data())
{
if (!unpackLZMA(stream, thread_data))
{
std::cerr << "[error] lzma data encountered that could not be unpacked" << std::endl;
}
delete[] data;
return false;
}
else
{
std::cerr << "[error] Blob contains no data" << std::endl;
delete[] data;
return false;
}
delete[] data;
return true;
}
bool PBFParser::readNextBlock(std::fstream &stream, ParserThreadData *thread_data)
{
if (stream.eof())
{
return false;
}
if (!readPBFBlobHeader(stream, thread_data))
{
return false;
}
if (thread_data->PBFBlobHeader.type() != "OSMData")
{
return false;
}
if (!readBlob(stream, thread_data))
{
return false;
}
if (!thread_data->PBFprimitiveBlock.ParseFromArray(&(thread_data->charBuffer[0]),
thread_data->charBuffer.size()))
{
std::cerr << "failed to parse PrimitiveBlock" << std::endl;
return false;
}
return true;
}

View File

@ -1,99 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PBFPARSER_H_
#define PBFPARSER_H_
#include "BaseParser.h"
#include "../DataStructures/ConcurrentQueue.h"
#include <osmpbf/fileformat.pb.h>
#include <osmpbf/osmformat.pb.h>
#include <fstream>
#include <memory>
class PBFParser : public BaseParser
{
enum EntityType
{ TypeDummy = 0,
TypeNode = 1,
TypeWay = 2,
TypeRelation = 4,
TypeDenseNode = 8 };
struct ParserThreadData
{
int currentGroupID;
int currentEntityID;
EntityType entityTypeIndicator;
OSMPBF::BlobHeader PBFBlobHeader;
OSMPBF::Blob PBFBlob;
OSMPBF::HeaderBlock PBFHeaderBlock;
OSMPBF::PrimitiveBlock PBFprimitiveBlock;
std::vector<char> charBuffer;
};
public:
PBFParser(const char *file_name, ExtractorCallbacks *extractor_callbacks, ScriptingEnvironment &scripting_environment);
virtual ~PBFParser();
inline bool ReadHeader();
inline bool Parse();
private:
inline void ReadData();
inline void ParseData();
inline void parseDenseNode(ParserThreadData *thread_data);
inline void parseNode(ParserThreadData *thread_data);
inline void parseRelation(ParserThreadData *thread_data);
inline void parseWay(ParserThreadData *thread_data);
inline void loadGroup(ParserThreadData *thread_data);
inline void loadBlock(ParserThreadData *thread_data);
inline bool readPBFBlobHeader(std::fstream &stream, ParserThreadData *thread_data);
inline bool unpackZLIB(std::fstream &stream, ParserThreadData *thread_data);
inline bool unpackLZMA(std::fstream &stream, ParserThreadData *thread_data);
inline bool readBlob(std::fstream &stream, ParserThreadData *thread_data);
inline bool readNextBlock(std::fstream &stream, ParserThreadData *thread_data);
static const int NANO = 1000 * 1000 * 1000;
static const int MAX_BLOB_HEADER_SIZE = 64 * 1024;
static const int MAX_BLOB_SIZE = 32 * 1024 * 1024;
unsigned group_count;
unsigned block_count;
std::fstream input; // the input stream to parse
std::shared_ptr<ConcurrentQueue<ParserThreadData *>> thread_data_queue;
};
#endif /* PBFPARSER_H_ */

View File

@ -1,124 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "ScriptingEnvironment.h"
#include "ExtractionHelperFunctions.h"
#include "ExtractionWay.h"
#include "../DataStructures/ImportNode.h"
#include "../Util/LuaUtil.h"
#include "../Util/OpenMPWrapper.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include "../typedefs.h"
ScriptingEnvironment::ScriptingEnvironment() {}
ScriptingEnvironment::ScriptingEnvironment(const char *file_name)
{
SimpleLogger().Write() << "Using script " << file_name;
// Create a new lua state
for (int i = 0; i < omp_get_max_threads(); ++i)
{
lua_state_vector.push_back(luaL_newstate());
}
// Connect LuaBind to this lua state for all threads
#pragma omp parallel
{
lua_State *lua_state = getLuaStateForThreadID(omp_get_thread_num());
luabind::open(lua_state);
// open utility libraries string library;
luaL_openlibs(lua_state);
luaAddScriptFolderToLoadPath(lua_state, file_name);
// Add our function to the state's global scope
luabind::module(lua_state)[
luabind::def("print", LUA_print<std::string>),
luabind::def("durationIsValid", durationIsValid),
luabind::def("parseDuration", parseDuration)
];
luabind::module(lua_state)[luabind::class_<HashTable<std::string, std::string>>("keyVals")
.def("Add", &HashTable<std::string, std::string>::Add)
.def("Find", &HashTable<std::string, std::string>::Find)
.def("Holds", &HashTable<std::string, std::string>::Holds)];
luabind::module(lua_state)[luabind::class_<ImportNode>("Node")
.def(luabind::constructor<>())
.def_readwrite("lat", &ImportNode::lat)
.def_readwrite("lon", &ImportNode::lon)
.def_readonly("id", &ImportNode::id)
.def_readwrite("bollard", &ImportNode::bollard)
.def_readwrite("traffic_light", &ImportNode::trafficLight)
.def_readwrite("tags", &ImportNode::keyVals)];
luabind::module(lua_state)
[luabind::class_<ExtractionWay>("Way")
.def(luabind::constructor<>())
.def_readonly("id", &ExtractionWay::id)
.def_readwrite("name", &ExtractionWay::name)
.def_readwrite("speed", &ExtractionWay::speed)
.def_readwrite("backward_speed", &ExtractionWay::backward_speed)
.def_readwrite("duration", &ExtractionWay::duration)
.def_readwrite("type", &ExtractionWay::type)
.def_readwrite("access", &ExtractionWay::access)
.def_readwrite("roundabout", &ExtractionWay::roundabout)
.def_readwrite("is_access_restricted", &ExtractionWay::isAccessRestricted)
.def_readwrite("ignore_in_grid", &ExtractionWay::ignoreInGrid)
.def_readwrite("tags", &ExtractionWay::keyVals)
.def_readwrite("direction", &ExtractionWay::direction)
.enum_("constants")[
luabind::value("notSure", 0),
luabind::value("oneway", 1),
luabind::value("bidirectional", 2),
luabind::value("opposite", 3)
]];
// fails on c++11/OS X 10.9
luabind::module(lua_state)[luabind::class_<std::vector<std::string>>("vector").def(
"Add",
static_cast<void (std::vector<std::string>::*)(const std::string &)>(
&std::vector<std::string>::push_back))];
if (0 != luaL_dofile(lua_state, file_name))
{
throw OSRMException("ERROR occured in scripting block");
}
}
}
ScriptingEnvironment::~ScriptingEnvironment()
{
for (unsigned i = 0; i < lua_state_vector.size(); ++i)
{
// lua_state_vector[i];
}
}
lua_State *ScriptingEnvironment::getLuaStateForThreadID(const int id) { return lua_state_vector[id]; }

View File

@ -1,47 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SCRIPTINGENVIRONMENT_H_
#define SCRIPTINGENVIRONMENT_H_
#include <vector>
struct lua_State;
class ScriptingEnvironment
{
public:
ScriptingEnvironment();
explicit ScriptingEnvironment(const char *file_name);
virtual ~ScriptingEnvironment();
lua_State *getLuaStateForThreadID(const int);
std::vector<lua_State *> lua_state_vector;
};
#endif /* SCRIPTINGENVIRONMENT_H_ */

View File

@ -1,347 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "XMLParser.h"
#include "ExtractionWay.h"
#include "ExtractorCallbacks.h"
#include "../DataStructures/HashTable.h"
#include "../DataStructures/ImportNode.h"
#include "../DataStructures/InputReaderFactory.h"
#include "../DataStructures/Restriction.h"
#include "../Util/SimpleLogger.h"
#include "../Util/StringUtil.h"
#include "../typedefs.h"
#include <osrm/Coordinate.h>
XMLParser::XMLParser(const char *filename, ExtractorCallbacks *ec, ScriptingEnvironment &se)
: BaseParser(ec, se)
{
inputReader = inputReaderFactory(filename);
}
bool XMLParser::ReadHeader() { return (xmlTextReaderRead(inputReader) == 1); }
bool XMLParser::Parse()
{
while (xmlTextReaderRead(inputReader) == 1)
{
const int type = xmlTextReaderNodeType(inputReader);
// 1 is Element
if (type != 1)
{
continue;
}
xmlChar *currentName = xmlTextReaderName(inputReader);
if (currentName == NULL)
{
continue;
}
if (xmlStrEqual(currentName, (const xmlChar *)"node") == 1)
{
ImportNode n = ReadXMLNode();
ParseNodeInLua(n, lua_state);
extractor_callbacks->ProcessNode(n);
}
if (xmlStrEqual(currentName, (const xmlChar *)"way") == 1)
{
ExtractionWay way = ReadXMLWay();
ParseWayInLua(way, lua_state);
extractor_callbacks->ProcessWay(way);
}
if (use_turn_restrictions && xmlStrEqual(currentName, (const xmlChar *)"relation") == 1)
{
InputRestrictionContainer r = ReadXMLRestriction();
if ((UINT_MAX != r.fromWay) && !extractor_callbacks->ProcessRestriction(r))
{
std::cerr << "[XMLParser] restriction not parsed" << std::endl;
}
}
xmlFree(currentName);
}
return true;
}
InputRestrictionContainer XMLParser::ReadXMLRestriction()
{
InputRestrictionContainer restriction;
std::string except_tag_string;
if (xmlTextReaderIsEmptyElement(inputReader) != 1)
{
const int depth = xmlTextReaderDepth(inputReader);
while (xmlTextReaderRead(inputReader) == 1)
{
const int child_type = xmlTextReaderNodeType(inputReader);
if (child_type != 1 && child_type != 15)
{
continue;
}
const int childDepth = xmlTextReaderDepth(inputReader);
xmlChar *childName = xmlTextReaderName(inputReader);
if (childName == NULL)
{
continue;
}
if (depth == childDepth && child_type == 15 &&
xmlStrEqual(childName, (const xmlChar *)"relation") == 1)
{
xmlFree(childName);
break;
}
if (child_type != 1)
{
xmlFree(childName);
continue;
}
if (xmlStrEqual(childName, (const xmlChar *)"tag") == 1)
{
xmlChar *k = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"k");
xmlChar *value = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"v");
if (k != NULL && value != NULL)
{
if (xmlStrEqual(k, (const xmlChar *)"restriction") &&
(0 == std::string((const char *)value).find("only_")))
{
restriction.restriction.flags.isOnly = true;
}
if (xmlStrEqual(k, (const xmlChar *)"except"))
{
except_tag_string = (const char *)value;
}
}
if (k != NULL)
{
xmlFree(k);
}
if (value != NULL)
{
xmlFree(value);
}
}
else if (xmlStrEqual(childName, (const xmlChar *)"member") == 1)
{
xmlChar *ref = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"ref");
if (ref != NULL)
{
xmlChar *role = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"role");
xmlChar *type = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"type");
if (xmlStrEqual(role, (const xmlChar *)"to") &&
xmlStrEqual(type, (const xmlChar *)"way"))
{
restriction.toWay = stringToUint((const char *)ref);
}
if (xmlStrEqual(role, (const xmlChar *)"from") &&
xmlStrEqual(type, (const xmlChar *)"way"))
{
restriction.fromWay = stringToUint((const char *)ref);
}
if (xmlStrEqual(role, (const xmlChar *)"via") &&
xmlStrEqual(type, (const xmlChar *)"node"))
{
restriction.restriction.viaNode = stringToUint((const char *)ref);
}
if (NULL != type)
{
xmlFree(type);
}
if (NULL != role)
{
xmlFree(role);
}
if (NULL != ref)
{
xmlFree(ref);
}
}
}
xmlFree(childName);
}
}
if (ShouldIgnoreRestriction(except_tag_string))
{
restriction.fromWay = UINT_MAX; // workaround to ignore the restriction
}
return restriction;
}
ExtractionWay XMLParser::ReadXMLWay()
{
ExtractionWay way;
if (xmlTextReaderIsEmptyElement(inputReader) == 1)
{
return way;
}
const int depth = xmlTextReaderDepth(inputReader);
while (xmlTextReaderRead(inputReader) == 1)
{
const int child_type = xmlTextReaderNodeType(inputReader);
if (child_type != 1 && child_type != 15)
{
continue;
}
const int childDepth = xmlTextReaderDepth(inputReader);
xmlChar *childName = xmlTextReaderName(inputReader);
if (childName == NULL)
{
continue;
}
if (depth == childDepth && child_type == 15 &&
xmlStrEqual(childName, (const xmlChar *)"way") == 1)
{
xmlChar *id = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"id");
way.id = stringToUint((char *)id);
xmlFree(id);
xmlFree(childName);
break;
}
if (child_type != 1)
{
xmlFree(childName);
continue;
}
if (xmlStrEqual(childName, (const xmlChar *)"tag") == 1)
{
xmlChar *k = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"k");
xmlChar *value = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"v");
if (k != NULL && value != NULL)
{
way.keyVals.Add(std::string((char *)k), std::string((char *)value));
}
if (k != NULL)
{
xmlFree(k);
}
if (value != NULL)
{
xmlFree(value);
}
}
else if (xmlStrEqual(childName, (const xmlChar *)"nd") == 1)
{
xmlChar *ref = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"ref");
if (ref != NULL)
{
way.path.push_back(stringToUint((const char *)ref));
xmlFree(ref);
}
}
xmlFree(childName);
}
return way;
}
ImportNode XMLParser::ReadXMLNode()
{
ImportNode node;
xmlChar *attribute = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"lat");
if (attribute != NULL)
{
node.lat = COORDINATE_PRECISION * StringToDouble((const char *)attribute);
xmlFree(attribute);
}
attribute = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"lon");
if (attribute != NULL)
{
node.lon = COORDINATE_PRECISION * StringToDouble((const char *)attribute);
xmlFree(attribute);
}
attribute = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"id");
if (attribute != NULL)
{
node.id = stringToUint((const char *)attribute);
xmlFree(attribute);
}
if (xmlTextReaderIsEmptyElement(inputReader) == 1)
{
return node;
}
const int depth = xmlTextReaderDepth(inputReader);
while (xmlTextReaderRead(inputReader) == 1)
{
const int child_type = xmlTextReaderNodeType(inputReader);
// 1 = Element, 15 = EndElement
if (child_type != 1 && child_type != 15)
{
continue;
}
const int childDepth = xmlTextReaderDepth(inputReader);
xmlChar *childName = xmlTextReaderName(inputReader);
if (childName == NULL)
{
continue;
}
if (depth == childDepth && child_type == 15 &&
xmlStrEqual(childName, (const xmlChar *)"node") == 1)
{
xmlFree(childName);
break;
}
if (child_type != 1)
{
xmlFree(childName);
continue;
}
if (xmlStrEqual(childName, (const xmlChar *)"tag") == 1)
{
xmlChar *k = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"k");
xmlChar *value = xmlTextReaderGetAttribute(inputReader, (const xmlChar *)"v");
if (k != NULL && value != NULL)
{
node.keyVals.emplace(std::string((char *)(k)), std::string((char *)(value)));
}
if (k != NULL)
{
xmlFree(k);
}
if (value != NULL)
{
xmlFree(value);
}
}
xmlFree(childName);
}
return node;
}

View File

@ -1,7 +0,0 @@
source "http://rubygems.org"
gem "cucumber"
gem "rake"
gem "osmlib-base"
gem "sys-proctable"
gem "rspec-expectations"

View File

@ -1,30 +0,0 @@
GEM
remote: http://rubygems.org/
specs:
builder (3.2.2)
cucumber (1.3.8)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12.1)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
diff-lcs (1.2.4)
gherkin (2.12.1)
multi_json (~> 1.3)
multi_json (1.8.0)
multi_test (0.0.2)
osmlib-base (0.1.4)
rake (10.1.0)
rspec-expectations (2.14.3)
diff-lcs (>= 1.1.3, < 2.0)
sys-proctable (0.9.3)
PLATFORMS
ruby
DEPENDENCIES
cucumber
osmlib-base
rake
rspec-expectations
sys-proctable

View File

@ -1,96 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FIXED_POINT_COORDINATE_H_
#define FIXED_POINT_COORDINATE_H_
#include <functional>
#include <iosfwd> //for std::ostream
constexpr float COORDINATE_PRECISION = 1000000.;
struct FixedPointCoordinate
{
int lat;
int lon;
FixedPointCoordinate();
explicit FixedPointCoordinate(int lat, int lon);
void Reset();
bool isSet() const;
bool isValid() const;
bool operator==(const FixedPointCoordinate &other) const;
static double
ApproximateDistance(const int lat1, const int lon1, const int lat2, const int lon2);
static double ApproximateDistance(const FixedPointCoordinate &c1,
const FixedPointCoordinate &c2);
static float ApproximateEuclideanDistance(const FixedPointCoordinate &c1,
const FixedPointCoordinate &c2);
static float ApproximateEuclideanDistance(const int lat1, const int lon1, const int lat2, const int lon2);
static float ApproximateSquaredEuclideanDistance(const FixedPointCoordinate &c1,
const FixedPointCoordinate &c2);
static void convertInternalLatLonToString(const int value, std::string &output);
static void convertInternalCoordinateToString(const FixedPointCoordinate &coord,
std::string &output);
static void convertInternalReversedCoordinateToString(const FixedPointCoordinate &coord,
std::string &output);
static float ComputePerpendicularDistance(const FixedPointCoordinate &point,
const FixedPointCoordinate &segA,
const FixedPointCoordinate &segB);
static float ComputePerpendicularDistance(const FixedPointCoordinate &coord_a,
const FixedPointCoordinate &coord_b,
const FixedPointCoordinate &query_location,
FixedPointCoordinate &nearest_location,
float &r);
static float GetBearing(const FixedPointCoordinate &A, const FixedPointCoordinate &B);
float GetBearing(const FixedPointCoordinate &other) const;
void Output(std::ostream &out) const;
static float DegreeToRadian(const float degree);
static float RadianToDegree(const float radian);
};
inline std::ostream &operator<<(std::ostream &o, FixedPointCoordinate const &c)
{
c.Output(o);
return o;
}
#endif /* FIXED_POINT_COORDINATE_H_ */

View File

@ -1,74 +0,0 @@
/*
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef REPLY_H
#define REPLY_H
#include "Header.h"
#include <boost/asio.hpp>
#include <vector>
namespace http
{
const char okHTML[] = "";
const char badRequestHTML[] = "{\"status\": 400,\"status_message\":\"Bad Request\"}";
const char internalServerErrorHTML[] =
"{\"status\": 500,\"status_message\":\"Internal Server Error\"}";
const char seperators[] = {':', ' '};
const char crlf[] = {'\r', '\n'};
const std::string okString = "HTTP/1.0 200 OK\r\n";
const std::string badRequestString = "HTTP/1.0 400 Bad Request\r\n";
const std::string internalServerErrorString = "HTTP/1.0 500 Internal Server Error\r\n";
class Reply
{
public:
enum status_type
{ ok = 200,
badRequest = 400,
internalServerError = 500 } status;
std::vector<Header> headers;
std::vector<boost::asio::const_buffer> toBuffers();
std::vector<boost::asio::const_buffer> HeaderstoBuffers();
std::vector<char> content;
static Reply StockReply(status_type status);
void setSize(const unsigned size);
void SetUncompressedSize();
Reply();
private:
std::string ToString(Reply::status_type status);
boost::asio::const_buffer ToBuffer(Reply::status_type status);
};
}
#endif // REPLY_H

Some files were not shown because too many files have changed in this diff Show More