Compare commits

...

13 Commits

Author SHA1 Message Date
Patrick Niklaus
a5eeca9b51 Bump version to RC3 2017-04-18 17:09:49 +00:00
Michael Krasnyk
1a09ff6005 Don't remove the last original coordinate during tiding 2017-04-18 13:36:28 +00:00
Patrick Niklaus
2794a52902 Remove boost::make_unique to fix travis node builds 2017-04-13 21:18:08 +00:00
Patrick Niklaus
cb796e4cfc Use .gitignore default instead of .npmignore 2017-04-13 21:17:58 +00:00
Patrick Niklaus
522ec4fc2e Restructure travis build 2017-04-13 21:17:45 +00:00
Michael Krasnyk
15dc5899b0 Use total angle for turn instruction if entry step has large distance 2017-04-12 23:32:12 +00:00
Patrick Niklaus
7e932ffbc3 Bump package version 2017-04-12 22:58:58 +00:00
Patrick Niklaus
810596bb83 Install node version as well 2017-04-12 20:28:19 +00:00
Patrick Niklaus
acabf0075c Only use three jobs for node builds 2017-04-12 20:28:05 +00:00
Patrick Niklaus
1ed72db210 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:53 +00:00
Patrick Niklaus
6bdf95dfb4 Change version to RC1 2017-04-12 14:58:51 +00:00
Patrick Niklaus
785ae89cd8 Update changelog 2017-04-12 14:58:25 +00:00
Patrick Niklaus
16680191de Enable 5.7 branch in travis 2017-04-12 14:28:37 +00:00
11 changed files with 99 additions and 71 deletions

2
.gitignore vendored
View File

@ -7,6 +7,8 @@
############################# #############################
osrm-deps osrm-deps
.ycm_extra_conf.py
# Compiled source # # Compiled source #
################### ###################
*.com *.com

View File

@ -1,10 +0,0 @@
*
!README.md
!CHANGELOG.md
!CONTRIBUTING.MD
!LICENCE.TXT
!package.json
!example
!lib/*.js
!profiles/*
!profiles/lib/*

View File

@ -7,8 +7,9 @@ git:
sudo: required sudo: required
dist: trusty dist: trusty
nodejs: node_js:
- "4" - "4"
- "6"
notifications: notifications:
email: false email: false
@ -16,6 +17,7 @@ notifications:
branches: branches:
only: only:
- master - master
- "5.7"
# enable building tags # enable building tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ - /^v\d+\.\d+(\.\d+)?(-\S*)?$/
@ -36,6 +38,8 @@ env:
- CCACHE_VERSION=3.3.1 - CCACHE_VERSION=3.3.1
- CMAKE_VERSION=3.7.2 - CMAKE_VERSION=3.7.2
- MASON="$(pwd)/scripts/mason.sh" - MASON="$(pwd)/scripts/mason.sh"
- ENABLE_NODE_BINDINGS=On
- NODE="4"
matrix: matrix:
fast_finish: true fast_finish: true
@ -45,12 +49,14 @@ matrix:
# Debug Builds # Debug Builds
- os: linux - os: linux
compiler: "gcc-6-debug" compiler: "gcc-6-debug-cov-asan"
addons: &gcc6 addons: &gcc6
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev'] packages: ['g++-6', 'libbz2-dev', 'libstxxl-dev', 'libstxxl1', 'libxml2-dev', 'libzip-dev', 'lua5.1', 'liblua5.1-0-dev', 'libtbb-dev', 'libgdal-dev', 'libluabind-dev', 'libboost-all-dev']
env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_COVERAGE=ON ENABLE_SANITIZER=ON
after_success:
- bash <(curl -s https://codecov.io/bash)
- os: linux - os: linux
compiler: "clang-4.0-debug" compiler: "clang-4.0-debug"
@ -61,12 +67,12 @@ matrix:
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000
- os: linux - os: linux
compiler: "mason-linux-debug-santize" compiler: "mason-linux-debug-asan"
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON ENABLE_NODE_BINDINGS=ON env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
# Release Builds # Release Builds
- os: linux - os: linux
@ -75,7 +81,7 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON
- os: linux - os: linux
compiler: "gcc-6-release" compiler: "gcc-6-release"
@ -104,6 +110,8 @@ matrix:
compiler: "mason-osx-release" compiler: "mason-osx-release"
# we use the xcode provides clang and don't install our own # we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON
after_success:
- ./scripts/travis/publish.sh
# Disabled because of CI slowness # Disabled because of CI slowness
#- os: linux #- os: linux
@ -140,8 +148,7 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON PUBLISH_NODE_BINDINGS=On JOBS=4 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3
nodejs: "4"
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- | - |
@ -164,8 +171,7 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON PUBLISH_NODE_BINDINGS=On JOBS=4 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3
nodejs: "4"
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- | - |
@ -188,8 +194,7 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON PUBLISH_NODE_BINDINGS=On JOBS=4 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3 NODE="6"
nodejs: "6"
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- | - |
@ -212,8 +217,7 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev'] packages: ['libstdc++-5-dev']
env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON ENABLE_NODE_BINDINGS=ON PUBLISH_NODE_BINDINGS=On JOBS=4 env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON PUBLISH_NODE_BINDINGS=On JOBS=3 NODE="6"
nodejs: "6"
install: install:
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- | - |
@ -230,6 +234,10 @@ matrix:
- ./scripts/travis/publish.sh - ./scripts/travis/publish.sh
before_install: before_install:
- source $NVM_DIR/nvm.sh
- nvm install $NODE
- nvm use $NODE
- node --version
- if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi - if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi
- | - |
if [[ -z $JOBS ]]; then if [[ -z $JOBS ]]; then
@ -331,14 +339,9 @@ script:
- ./unit_tests/server-tests - ./unit_tests/server-tests
- ./unit_tests/partition-tests - ./unit_tests/partition-tests
- | - |
if [ -n "${ENABLE_NODE_BINDINGS}" ] && [ -z "${ENABLE_SANITIZER}" ]; then if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then
npm run nodejs-tests npm run nodejs-tests
fi fi
- popd - popd
- yarn test - yarn test
after_success:
- |
if [ -n "${ENABLE_COVERAGE}" ]; then
bash <(curl -s https://codecov.io/bash)
fi

View File

@ -1,17 +1,28 @@
- Track preprocessing flag in the map matching plugin.
# 5.7.0 # 5.7.0
- Changes from 5.6 - Changes from 5.6
- Algorithm:
- OSRM object has new option `algorithm` that allows the selection of a routing algorithm.
- New experimental algorithm: Multi-Level Dijkstra with new toolchain:
- Allows for fast metric updates in below a minute on continental sized networks (osrm-customize)
- Plugins supported: `match` and `route`
- Quickstart: `osrm-extract data.osm.pbf`, `osrm-partition data.osrm`, `osrm-customize data.osrm`, `osrm-routed --algorithm=MLD data.osrm`
- NodeJs Bindings - NodeJs Bindings
- Merged https://github.com/Project-OSRM/node-osrm into repository. Build via `cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On`. - Merged https://github.com/Project-OSRM/node-osrm into repository. Build via `cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On`.
- `OSRM` object has new option `algorihtm="CH","CoreCH","MLD"`
- Internals - Internals
- Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances - Shared memory notification via conditional variables on Linux or semaphore queue on OS X and Windows with a limit of 128 OSRM Engine instances
- Files - Files
- .osrm.datasource_index file was removed. Data is now part of .osrm.geometries. - .osrm.datasource_index file was removed. Data is now part of .osrm.geometries.
- .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now. - .osrm.edge_lookup was removed. The option `--generate-edge-lookup` does nothing now.
- `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore - `osrm-contract` does not depend on the `.osrm.fileIndex` file anymore
- `osrm-extract` creates new file `.osrm.cnbg` and `.cnbg_to_ebg`
- `osrm-partition` creates new file `.osrm.partition` and `.osrm.cells`
- `osrm-customize` creates new file `.osrm.mldgr`
- Profiles - Profiles
- Added `force_split_edges` flag to global properties. True value guarantees that segment_function will be called for all segments, but also could double memory consumption - Added `force_split_edges` flag to global properties. True value guarantees that segment_function will be called for all segments, but also could double memory consumption
- Map Matching:
- new option `gaps=split|ignore` to enable/disbale track splitting
- new option `tidy=true|false` to simplify traces automatically
# 5.6.3 # 5.6.3
- Changes from 5.6.0 - Changes from 5.6.0

View File

@ -1019,3 +1019,39 @@ Feature: Collapse
| a,g | road,cross,cross | depart,fork left,arrive | a,b,g | | a,g | road,cross,cross | depart,fork left,arrive | a,b,g |
| a,e | road,road,road | depart,fork slight right,arrive | a,b,e | | a,e | road,road,road | depart,fork slight right,arrive | a,b,e |
| a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f | | a,f | road,road,cross,cross | depart,fork slight right,turn right,arrive | a,b,d,f |
# http://www.openstreetmap.org/way/92415447 #3933
Scenario: Use total angle for turn instruction if entry step has large distance
# """
# kf-_ a
# | - b
# | c
# |d
# e
# |
# i
# """
And the node locations
| node | lat | lon | #id |
| a | -33.9644254 | 151.1378673 | 33226063 |
| b | -33.9644373 | 151.1377172 | 1072787030 |
| c | -33.9644791 | 151.1374452 | 4222903609 |
| d | -33.9645661 | 151.1372654 | 4222903610 |
| e | -33.9646986 | 151.1371539 | 4222903611 |
| f | -33.964386 | 151.1372133 | 1072786875 |
| i | -33.9661796 | 151.1368491 | 2781176918 |
| k | -33.9643781 | 151.1371422 | 1684173853 |
And the ways
| nodes | highway | name | oneway | #id |
| ab | trunk | President Avenue | yes | 92415447 |
| bcde | trunk | President Avenue | yes | 422534457 |
| bf | trunk | President Avenue | yes | 447779786 |
| fk | trunk | President Avenue | yes | 179293012 |
| fei | trunk | Princes Highway | yes | 130099670 |
When I route I should get
| waypoints | route | turns | locations |
| a,i | President Avenue,Princes Highway,Princes Highway | depart,turn left,arrive | a,b,i |

View File

@ -80,6 +80,8 @@ inline Result keep_all(const MatchParameters &params)
inline Result tidy(const MatchParameters &params, Thresholds cfg = {15., 5}) inline Result tidy(const MatchParameters &params, Thresholds cfg = {15., 5})
{ {
BOOST_ASSERT(!params.coordinates.empty());
Result result; Result result;
result.can_be_removed.resize(params.coordinates.size(), false); result.can_be_removed.resize(params.coordinates.size(), false);
@ -91,10 +93,8 @@ inline Result tidy(const MatchParameters &params, Thresholds cfg = {15., 5})
Thresholds running{0., 0}; Thresholds running{0., 0};
// Walk over adjacent (coord, ts)-pairs, with rhs being the candidate to discard or keep // Walk over adjacent (coord, ts)-pairs, with rhs being the candidate to discard or keep
for (std::size_t current = 0; current < params.coordinates.size() - 1; ++current) for (std::size_t current = 0, next = 1; next < params.coordinates.size() - 1; ++current, ++next)
{ {
const auto next = current + 1;
auto distance_delta = util::coordinate_calculation::haversineDistance( auto distance_delta = util::coordinate_calculation::haversineDistance(
params.coordinates[current], params.coordinates[next]); params.coordinates[current], params.coordinates[next]);
running.distance_in_meters += distance_delta; running.distance_in_meters += distance_delta;
@ -130,7 +130,11 @@ inline Result tidy(const MatchParameters &params, Thresholds cfg = {15., 5})
} }
} }
BOOST_ASSERT(result.can_be_removed.size() == params.coordinates.size()); // Always use the last coordinate if more than two original coordinates
if (params.coordinates.size() > 1)
{
result.tidied_to_original.push_back(params.coordinates.size() - 1);
}
// We have to filter parallel arrays that may be empty or the exact same size. // We have to filter parallel arrays that may be empty or the exact same size.
// result.parameters contains an empty MatchParameters at this point: conditionally fill. // result.parameters contains an empty MatchParameters at this point: conditionally fill.

View File

@ -18,7 +18,6 @@
#include "osrm/trip_parameters.hpp" #include "osrm/trip_parameters.hpp"
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/make_unique.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <algorithm> #include <algorithm>
@ -81,7 +80,7 @@ inline void ParseResult(const osrm::Status &result_status, const std::string & /
inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo<v8::Value> &args) inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo<v8::Value> &args)
{ {
Nan::HandleScope scope; Nan::HandleScope scope;
auto engine_config = boost::make_unique<osrm::EngineConfig>(); auto engine_config = std::make_unique<osrm::EngineConfig>();
if (args.Length() == 0) if (args.Length() == 0)
{ {
@ -631,7 +630,7 @@ inline route_parameters_ptr
argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args, argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
bool requires_multiple_coordinates) bool requires_multiple_coordinates)
{ {
route_parameters_ptr params = boost::make_unique<osrm::RouteParameters>(); route_parameters_ptr params = std::make_unique<osrm::RouteParameters>();
bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates); bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates);
if (!has_base_params) if (!has_base_params)
return route_parameters_ptr(); return route_parameters_ptr();
@ -681,7 +680,7 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
inline tile_parameters_ptr inline tile_parameters_ptr
argumentsToTileParameters(const Nan::FunctionCallbackInfo<v8::Value> &args, bool /*unused*/) argumentsToTileParameters(const Nan::FunctionCallbackInfo<v8::Value> &args, bool /*unused*/)
{ {
tile_parameters_ptr params = boost::make_unique<osrm::TileParameters>(); tile_parameters_ptr params = std::make_unique<osrm::TileParameters>();
if (args.Length() < 2) if (args.Length() < 2)
{ {
@ -742,7 +741,7 @@ inline nearest_parameters_ptr
argumentsToNearestParameter(const Nan::FunctionCallbackInfo<v8::Value> &args, argumentsToNearestParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
bool requires_multiple_coordinates) bool requires_multiple_coordinates)
{ {
nearest_parameters_ptr params = boost::make_unique<osrm::NearestParameters>(); nearest_parameters_ptr params = std::make_unique<osrm::NearestParameters>();
bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates); bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates);
if (!has_base_params) if (!has_base_params)
return nearest_parameters_ptr(); return nearest_parameters_ptr();
@ -781,7 +780,7 @@ inline table_parameters_ptr
argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args, argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
bool requires_multiple_coordinates) bool requires_multiple_coordinates)
{ {
table_parameters_ptr params = boost::make_unique<osrm::TableParameters>(); table_parameters_ptr params = std::make_unique<osrm::TableParameters>();
bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates); bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates);
if (!has_base_params) if (!has_base_params)
return table_parameters_ptr(); return table_parameters_ptr();
@ -875,7 +874,7 @@ inline trip_parameters_ptr
argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args, argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
bool requires_multiple_coordinates) bool requires_multiple_coordinates)
{ {
trip_parameters_ptr params = boost::make_unique<osrm::TripParameters>(); trip_parameters_ptr params = std::make_unique<osrm::TripParameters>();
bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates); bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates);
if (!has_base_params) if (!has_base_params)
return trip_parameters_ptr(); return trip_parameters_ptr();
@ -970,7 +969,7 @@ inline match_parameters_ptr
argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args, argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
bool requires_multiple_coordinates) bool requires_multiple_coordinates)
{ {
match_parameters_ptr params = boost::make_unique<osrm::MatchParameters>(); match_parameters_ptr params = std::make_unique<osrm::MatchParameters>();
bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates); bool has_base_params = argumentsToParameter(args, params, requires_multiple_coordinates);
if (!has_base_params) if (!has_base_params)
return match_parameters_ptr(); return match_parameters_ptr();

View File

@ -1,6 +1,6 @@
{ {
"name": "osrm", "name": "osrm",
"version": "5.7.0-latest.6", "version": "5.7.0-rc.3",
"private": false, "private": false,
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.", "description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
"dependencies": { "dependencies": {

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
NODE_HOME=$HOME/node
export NODE_HOME
mkdir ${NODE_HOME}
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
curl https://s3.amazonaws.com/mapbox/apps/install-node/v2.0.0/run | NV=4.4.2 NP=darwin-x64 OD=${NODE_HOME} sh
else
curl https://s3.amazonaws.com/mapbox/apps/install-node/v2.0.0/run | NV=4.4.2 NP=linux-x64 OD=${NODE_HOME} sh
fi
PATH="${NODE_HOME}/bin:$PATH"
export PATH
node --version
npm --version
which node

View File

@ -74,9 +74,6 @@ double findTotalTurnAngle(const RouteStep &entry_step, const RouteStep &exit_ste
if (entry_step.distance < MAX_COLLAPSE_DISTANCE) if (entry_step.distance < MAX_COLLAPSE_DISTANCE)
return true; return true;
if (entry_step.distance > 2 * MAX_COLLAPSE_DISTANCE)
return false;
// both go roughly in the same direction // both go roughly in the same direction
if ((entry_angle <= 185 && exit_angle <= 185) || (entry_angle >= 175 && exit_angle >= 175)) if ((entry_angle <= 185 && exit_angle <= 185) || (entry_angle >= 175 && exit_angle >= 175))
return true; return true;

View File

@ -53,10 +53,10 @@ BOOST_AUTO_TEST_CASE(two_item_trace_needs_tidiying_test)
auto result = tidy::tidy(params, thresholds); auto result = tidy::tidy(params, thresholds);
BOOST_CHECK_EQUAL(result.can_be_removed.size(), 2); BOOST_CHECK_EQUAL(result.can_be_removed.size(), 2);
BOOST_CHECK_EQUAL(result.tidied_to_original.size(), 1); BOOST_CHECK_EQUAL(result.tidied_to_original.size(), 2);
BOOST_CHECK_EQUAL(result.can_be_removed[0], false); BOOST_CHECK_EQUAL(result.can_be_removed[0], false);
BOOST_CHECK_EQUAL(result.can_be_removed[1], true); BOOST_CHECK_EQUAL(result.can_be_removed[1], false);
BOOST_CHECK_EQUAL(result.tidied_to_original[0], 0); BOOST_CHECK_EQUAL(result.tidied_to_original[0], 0);
} }
@ -87,16 +87,18 @@ BOOST_AUTO_TEST_CASE(two_blobs_in_traces_needs_tidiying_test)
auto result = tidy::tidy(params, thresholds); auto result = tidy::tidy(params, thresholds);
BOOST_CHECK_EQUAL(result.can_be_removed.size(), params.coordinates.size()); BOOST_CHECK_EQUAL(result.can_be_removed.size(), params.coordinates.size());
BOOST_CHECK_EQUAL(result.tidied_to_original.size(), 2); BOOST_CHECK_EQUAL(result.tidied_to_original.size(), 3);
BOOST_CHECK_EQUAL(result.tidied_to_original[0], 0); BOOST_CHECK_EQUAL(result.tidied_to_original[0], 0);
BOOST_CHECK_EQUAL(result.tidied_to_original[1], 3); BOOST_CHECK_EQUAL(result.tidied_to_original[1], 3);
BOOST_CHECK_EQUAL(result.tidied_to_original[2], 5);
const auto redundant = result.can_be_removed.count(); const auto redundant = result.can_be_removed.count();
BOOST_CHECK_EQUAL(redundant, params.coordinates.size() - 2); BOOST_CHECK_EQUAL(redundant, params.coordinates.size() - 3);
BOOST_CHECK_EQUAL(result.can_be_removed[0], false); BOOST_CHECK_EQUAL(result.can_be_removed[0], false);
BOOST_CHECK_EQUAL(result.can_be_removed[3], false); BOOST_CHECK_EQUAL(result.can_be_removed[3], false);
BOOST_CHECK_EQUAL(result.can_be_removed[5], false);
} }
BOOST_AUTO_TEST_CASE(two_blobs_in_traces_needs_tidiying_no_timestamps_test) BOOST_AUTO_TEST_CASE(two_blobs_in_traces_needs_tidiying_no_timestamps_test)
@ -118,15 +120,17 @@ BOOST_AUTO_TEST_CASE(two_blobs_in_traces_needs_tidiying_no_timestamps_test)
auto result = tidy::tidy(params, thresholds); auto result = tidy::tidy(params, thresholds);
BOOST_CHECK_EQUAL(result.can_be_removed.size(), params.coordinates.size()); BOOST_CHECK_EQUAL(result.can_be_removed.size(), params.coordinates.size());
BOOST_CHECK_EQUAL(result.tidied_to_original.size(), 2); BOOST_CHECK_EQUAL(result.tidied_to_original.size(), 3);
BOOST_CHECK_EQUAL(result.tidied_to_original[0], 0); BOOST_CHECK_EQUAL(result.tidied_to_original[0], 0);
BOOST_CHECK_EQUAL(result.tidied_to_original[1], 3); BOOST_CHECK_EQUAL(result.tidied_to_original[1], 3);
BOOST_CHECK_EQUAL(result.tidied_to_original[2], 5);
const auto redundant = result.can_be_removed.count(); const auto redundant = result.can_be_removed.count();
BOOST_CHECK_EQUAL(redundant, params.coordinates.size() - 2); BOOST_CHECK_EQUAL(redundant, params.coordinates.size() - 3);
BOOST_CHECK_EQUAL(result.can_be_removed[0], false); BOOST_CHECK_EQUAL(result.can_be_removed[0], false);
BOOST_CHECK_EQUAL(result.can_be_removed[3], false); BOOST_CHECK_EQUAL(result.can_be_removed[3], false);
BOOST_CHECK_EQUAL(result.can_be_removed[5], false);
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()