Skip to content

Commit 2e54842

Browse files
Merge branch 'master' into sf-ankerl
2 parents cf4141d + c7ee1a5 commit 2e54842

38 files changed

+355
-234
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,11 @@ jobs:
377377
key: v4-test-${{ matrix.name }}-${{ github.sha }}
378378
restore-keys: |
379379
v4-test-${{ matrix.name }}-
380-
381380
- name: Prepare environment
382381
run: |
383382
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
384383
mkdir -p $HOME/.ccache
385-
384+
386385
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
387386
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
388387
echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV
@@ -490,7 +489,7 @@ jobs:
490489
run: |
491490
echo "Using ${JOBS} jobs"
492491
pushd ${OSRM_BUILD_DIR}
493-
492+
494493
ccache --zero-stats
495494
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
496495
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
@@ -508,6 +507,7 @@ jobs:
508507
if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then
509508
make tests --jobs=${JOBS}
510509
make benchmarks --jobs=${JOBS}
510+
511511
sudo make install
512512
if [[ "${RUNNER_OS}" == "Linux" ]]; then
513513
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV
@@ -628,6 +628,13 @@ jobs:
628628
PR_NUMBER: ${{ github.event.pull_request.number }}
629629
GITHUB_REPOSITORY: ${{ github.repository }}
630630
steps:
631+
- name: Enable data.osm.pbf cache
632+
uses: actions/cache@v4
633+
with:
634+
path: ~/data.osm.pbf
635+
key: v1-data-osm-pbf
636+
restore-keys: |
637+
v1-data-osm-pbf
631638
- name: Enable compiler cache
632639
uses: actions/cache@v4
633640
with:
@@ -648,9 +655,15 @@ jobs:
648655
ref: ${{ github.head_ref }}
649656
path: pr
650657
- name: Install dependencies
651-
run: |
652-
python3 -m pip install "conan<2.0.0" "requests==2.31.0"
658+
run: |
659+
python3 -m pip install "conan<2.0.0" "requests==2.31.0" "locust==2.28.0"
653660
sudo apt-get update -y && sudo apt-get install ccache
661+
- name: Prepare data
662+
run: |
663+
if [ ! -f "~/data.osm.pbf" ]; then
664+
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf
665+
fi
666+
gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv
654667
- name: Prepare environment
655668
run: |
656669
echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22
- Changes from 5.27.1
33
- Features
4+
- REMOVED: Remove all core-CH left-overs [#6920](https://github.com/Project-OSRM/osrm-backend/pull/6920)
45
- ADDED: Add support for a keepalive_timeout flag. [#6674](https://github.com/Project-OSRM/osrm-backend/pull/6674)
56
- ADDED: Add support for a default_radius flag. [#6575](https://github.com/Project-OSRM/osrm-backend/pull/6575)
67
- ADDED: Add support for disabling feature datasets. [#6666](https://github.com/Project-OSRM/osrm-backend/pull/6666)
@@ -22,6 +23,9 @@
2223
- NodeJS:
2324
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
2425
- Misc:
26+
- CHANGED: Use custom struct instead of std::pair in QueryHeap. [#6921](https://github.com/Project-OSRM/osrm-backend/pull/6921)
27+
- CHANGED: Use std::string_view::starts_with instead of boost::starts_with. [#6918](https://github.com/Project-OSRM/osrm-backend/pull/6918)
28+
- CHANGED: Get rid of boost::math::constants::* and M_PI in favor of std::numbers. [#6916](https://github.com/Project-OSRM/osrm-backend/pull/6916)
2529
- CHANGED: Make constants in PackedVector constexpr. [#6917](https://github.com/Project-OSRM/osrm-backend/pull/6917)
2630
- CHANGED: Use std::variant instead of mapbox::util::variant. [#6903](https://github.com/Project-OSRM/osrm-backend/pull/6903)
2731
- CHANGED: Bump rapidjson to version f9d53419e912910fd8fa57d5705fa41425428c35 [#6906](https://github.com/Project-OSRM/osrm-backend/pull/6906)

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
266266
add_dependency_defines(-DBOOST_LIB_DIAGNOSTIC)
267267
add_dependency_defines(-D_CRT_SECURE_NO_WARNINGS)
268268
add_dependency_defines(-DNOMINMAX) # avoid min and max macros that can break compilation
269-
add_dependency_defines(-D_USE_MATH_DEFINES) #needed for M_PI with cmath.h
270269
add_dependency_defines(-D_WIN32_WINNT=0x0501)
271270
add_dependency_defines(-DXML_STATIC)
272271
find_library(ws2_32_LIBRARY_PATH ws2_32)

docs/nodejs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var osrm = new OSRM('network.osrm');
2121
**Parameters**
2222

2323
- `options` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** Options for creating an OSRM object or string to the `.osrm` file. (optional, default `{shared_memory:true}`)
24-
- `options.algorithm` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The algorithm to use for routing. Can be 'CH', 'CoreCH' or 'MLD'. Default is 'CH'.
24+
- `options.algorithm` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The algorithm to use for routing. Can be 'CH', or 'MLD'. Default is 'CH'.
2525
Make sure you prepared the dataset with the correct toolchain.
2626
- `options.shared_memory` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Connects to the persistent shared memory datastore.
2727
This requires you to run `osrm-datastore` prior to creating an `OSRM` object.

include/engine/engine_config.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,10 @@ namespace osrm::engine
5454
*
5555
* In addition, shared memory can be used for datasets loaded with osrm-datastore.
5656
*
57-
* You can chose between three algorithms:
57+
* You can chose between two algorithms:
5858
* - Algorithm::CH
5959
* Contraction Hierarchies, extremely fast queries but slow pre-processing. The default right
6060
* now.
61-
* - Algorithm::CoreCH
62-
* Deprecated, to be removed in v6.0
63-
* Contraction Hierachies with partial contraction for faster pre-processing but slower
64-
* queries.
6561
* - Algorithm::MLD
6662
* Multi Level Dijkstra, moderately fast in both pre-processing and query.
6763
*
@@ -74,7 +70,6 @@ struct EngineConfig final
7470
enum class Algorithm
7571
{
7672
CH,
77-
CoreCH, // Deprecated, will be removed in v6.0
7873
MLD
7974
};
8075

include/engine/map_matching/bayes_classifier.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <utility>
77
#include <vector>
88

9-
#include <boost/math/constants/constants.hpp>
9+
#include <numbers>
1010

1111
namespace osrm::engine::map_matching
1212
{
@@ -21,10 +21,8 @@ struct NormalDistribution
2121
// FIXME implement log-probability version since it's faster
2222
double Density(const double val) const
2323
{
24-
using namespace boost::math::constants;
25-
2624
const double x = val - mean;
27-
return 1.0 / (std::sqrt(two_pi<double>()) * standard_deviation) *
25+
return 1.0 / (std::sqrt(2 * std::numbers::pi) * standard_deviation) *
2826
std::exp(-x * x / (standard_deviation * standard_deviation));
2927
}
3028

include/engine/map_matching/hidden_markov_model.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "util/integer_range.hpp"
55

66
#include <boost/assert.hpp>
7-
#include <boost/math/constants/constants.hpp>
7+
#include <numbers>
88

99
#include <cmath>
1010

@@ -14,7 +14,7 @@
1414
namespace osrm::engine::map_matching
1515
{
1616

17-
static const double log_2_pi = std::log(2. * boost::math::constants::pi<double>());
17+
static const double log_2_pi = std::log(2. * std::numbers::pi);
1818
static const double IMPOSSIBLE_LOG_PROB = -std::numeric_limits<double>::infinity();
1919
static const double MINIMAL_LOG_PROB = std::numeric_limits<double>::lowest();
2020
static const std::size_t INVALID_STATE = std::numeric_limits<std::size_t>::max();

include/engine/map_matching/matching_confidence.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define ENGINE_MAP_MATCHING_CONFIDENCE_HPP
33

44
#include "engine/map_matching/bayes_classifier.hpp"
5-
5+
#include <boost/assert.hpp>
66
#include <cmath>
77

88
namespace osrm::engine::map_matching

include/engine/search_engine_data.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace osrm::engine
1212

1313
// Algorithm-dependent heaps
1414
// - CH algorithms use CH heaps
15-
// - CoreCH algorithms use CH
1615
// - MLD algorithms use MLD heaps
1716

1817
template <typename Algorithm> struct SearchEngineData

include/nodejs/node_osrm_support.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,24 +296,19 @@ inline engine_config_ptr argumentsToEngineConfig(const Napi::CallbackInfo &args)
296296
{
297297
engine_config->algorithm = osrm::EngineConfig::Algorithm::CH;
298298
}
299-
else if (algorithm_str == "CoreCH")
300-
{
301-
engine_config->algorithm = osrm::EngineConfig::Algorithm::CH;
302-
}
303299
else if (algorithm_str == "MLD")
304300
{
305301
engine_config->algorithm = osrm::EngineConfig::Algorithm::MLD;
306302
}
307303
else
308304
{
309-
ThrowError(args.Env(), "algorithm option must be one of 'CH', 'CoreCH', or 'MLD'.");
305+
ThrowError(args.Env(), "algorithm option must be one of 'CH', or 'MLD'.");
310306
return engine_config_ptr();
311307
}
312308
}
313309
else if (!algorithm.IsUndefined())
314310
{
315-
ThrowError(args.Env(),
316-
"algorithm option must be a string and one of 'CH', 'CoreCH', or 'MLD'.");
311+
ThrowError(args.Env(), "algorithm option must be a string and one of 'CH', or 'MLD'.");
317312
return engine_config_ptr();
318313
}
319314

0 commit comments

Comments
 (0)