Merge branch 'master' into fix/indices
This commit is contained in:
commit
6389b4ff91
8
.gitignore
vendored
8
.gitignore
vendored
@ -49,7 +49,7 @@ Thumbs.db
|
|||||||
/_build*
|
/_build*
|
||||||
/build/
|
/build/
|
||||||
/example/build/
|
/example/build/
|
||||||
/test/data/monaco*
|
/test/data/monaco.osrm*
|
||||||
/test/data/ch
|
/test/data/ch
|
||||||
/test/data/corech
|
/test/data/corech
|
||||||
/test/data/mld
|
/test/data/mld
|
||||||
@ -72,12 +72,6 @@ Thumbs.db
|
|||||||
###########################
|
###########################
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# stxxl related files #
|
|
||||||
#######################
|
|
||||||
.stxxl
|
|
||||||
stxxl.log
|
|
||||||
stxxl.errlog
|
|
||||||
|
|
||||||
# Compiled Binary Files #
|
# Compiled Binary Files #
|
||||||
####################################
|
####################################
|
||||||
/osrm-extract
|
/osrm-extract
|
||||||
|
|||||||
@ -151,14 +151,6 @@ matrix:
|
|||||||
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release'
|
||||||
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse'
|
||||||
|
|
||||||
- os: linux
|
|
||||||
compiler: "gcc-7-stxxl"
|
|
||||||
addons: &gcc7
|
|
||||||
apt:
|
|
||||||
sources: ['ubuntu-toolchain-r-test']
|
|
||||||
packages: ['g++-7', 'libbz2-dev', 'libstxxl-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev']
|
|
||||||
env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On
|
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: "gcc-5-release"
|
compiler: "gcc-5-release"
|
||||||
addons: &gcc49
|
addons: &gcc49
|
||||||
@ -483,7 +475,6 @@ install:
|
|||||||
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \
|
||||||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \
|
||||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
||||||
-DENABLE_STXXL=${ENABLE_STXXL:-OFF} \
|
|
||||||
-DBUILD_TOOLS=ON \
|
-DBUILD_TOOLS=ON \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
||||||
|
|||||||
@ -10,11 +10,18 @@
|
|||||||
- ADDED: keepalive support to the osrm-routed HTTP server [#5518](https://github.com/Project-OSRM/osrm-backend/pull/5518)
|
- ADDED: keepalive support to the osrm-routed HTTP server [#5518](https://github.com/Project-OSRM/osrm-backend/pull/5518)
|
||||||
- ADDED: flatbuffers output format support [#5513](https://github.com/Project-OSRM/osrm-backend/pull/5513)
|
- ADDED: flatbuffers output format support [#5513](https://github.com/Project-OSRM/osrm-backend/pull/5513)
|
||||||
- ADDED: Global 'skip_waypoints' option [#5556](https://github.com/Project-OSRM/osrm-backend/pull/5556)
|
- ADDED: Global 'skip_waypoints' option [#5556](https://github.com/Project-OSRM/osrm-backend/pull/5556)
|
||||||
|
- FIXED: Install the libosrm_guidance library correctly [#5604](https://github.com/Project-OSRM/osrm-backend/pull/5604)
|
||||||
|
- FIXED: Http Handler can now deal witch optional whitespace between header-key and -value [#5606](https://github.com/Project-OSRM/osrm-backend/issues/5606)
|
||||||
- Routing:
|
- Routing:
|
||||||
- CHANGED: allow routing past `barrier=arch` [#5352](https://github.com/Project-OSRM/osrm-backend/pull/5352)
|
- CHANGED: allow routing past `barrier=arch` [#5352](https://github.com/Project-OSRM/osrm-backend/pull/5352)
|
||||||
- CHANGED: default car weight was reduced to 2000 kg. [#5371](https://github.com/Project-OSRM/osrm-backend/pull/5371)
|
- CHANGED: default car weight was reduced to 2000 kg. [#5371](https://github.com/Project-OSRM/osrm-backend/pull/5371)
|
||||||
- CHANGED: default car height was reduced to 2 meters. [#5389](https://github.com/Project-OSRM/osrm-backend/pull/5389)
|
- CHANGED: default car height was reduced to 2 meters. [#5389](https://github.com/Project-OSRM/osrm-backend/pull/5389)
|
||||||
|
- FIXED: treat `bicycle=use_sidepath` as no access on the tagged way. [#5622](https://github.com/Project-OSRM/osrm-backend/pull/5622)
|
||||||
|
- Misc:
|
||||||
|
- CHANGED: Reduce memory usage for raster source handling. [#5572](https://github.com/Project-OSRM/osrm-backend/pull/5572)
|
||||||
|
- CHANGED: Add cmake option `ENABLE_DEBUG_LOGGING` to control whether output debug logging. [#3427](https://github.com/Project-OSRM/osrm-backend/issues/3427)
|
||||||
|
- Infrastructure
|
||||||
|
- REMOVED: STXXL support removed as STXXL became abandonware. [#5760](https://github.com/Project-OSRM/osrm-backend/pull/5760)
|
||||||
# 5.21.0
|
# 5.21.0
|
||||||
- Changes from 5.20.0
|
- Changes from 5.20.0
|
||||||
- Features:
|
- Features:
|
||||||
|
|||||||
@ -23,9 +23,9 @@ option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
|
|||||||
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
option(BUILD_TOOLS "Build OSRM tools" OFF)
|
||||||
option(BUILD_PACKAGE "Build OSRM package" OFF)
|
option(BUILD_PACKAGE "Build OSRM package" OFF)
|
||||||
option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF)
|
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_COVERAGE "Build with coverage instrumentalisation" OFF)
|
||||||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF)
|
||||||
option(ENABLE_STXXL "Use STXXL library" OFF)
|
|
||||||
option(ENABLE_LTO "Use LTO if available" OFF)
|
option(ENABLE_LTO "Use LTO if available" OFF)
|
||||||
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF)
|
||||||
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
option(ENABLE_GOLD_LINKER "Use GNU gold linker if available" ON)
|
||||||
@ -37,7 +37,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|||||||
if(ENABLE_MASON)
|
if(ENABLE_MASON)
|
||||||
# versions in use
|
# versions in use
|
||||||
set(MASON_BOOST_VERSION "1.65.1")
|
set(MASON_BOOST_VERSION "1.65.1")
|
||||||
set(MASON_STXXL_VERSION "1.4.1-1")
|
|
||||||
set(MASON_EXPAT_VERSION "2.2.0")
|
set(MASON_EXPAT_VERSION "2.2.0")
|
||||||
set(MASON_LUA_VERSION "5.2.4")
|
set(MASON_LUA_VERSION "5.2.4")
|
||||||
set(MASON_BZIP2_VERSION "1.0.6")
|
set(MASON_BZIP2_VERSION "1.0.6")
|
||||||
@ -57,6 +56,12 @@ endif()
|
|||||||
if (POLICY CMP0048)
|
if (POLICY CMP0048)
|
||||||
cmake_policy(SET CMP0048 OLD)
|
cmake_policy(SET CMP0048 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
if (POLICY CMP0057)
|
||||||
|
cmake_policy(SET CMP0057 NEW)
|
||||||
|
endif()
|
||||||
|
if (POLICY CMP0074)
|
||||||
|
cmake_policy(SET CMP0074 NEW)
|
||||||
|
endif()
|
||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
|
|
||||||
include(JSONParser)
|
include(JSONParser)
|
||||||
@ -227,6 +232,7 @@ endif()
|
|||||||
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
|
||||||
message(STATUS "Configuring debug mode flags")
|
message(STATUS "Configuring debug mode flags")
|
||||||
set(ENABLE_ASSERTIONS ON)
|
set(ENABLE_ASSERTIONS ON)
|
||||||
|
set(ENABLE_DEBUG_LOGGING ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
@ -472,13 +478,6 @@ if(ENABLE_MASON)
|
|||||||
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
|
mason_use(boost_libsystem VERSION ${MASON_BOOST_VERSION})
|
||||||
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
|
set(Boost_SYSTEM_LIBRARY ${MASON_PACKAGE_boost_libsystem_STATIC_LIBS})
|
||||||
|
|
||||||
if (ENABLE_STXXL)
|
|
||||||
mason_use(stxxl VERSION ${MASON_STXXL_VERSION})
|
|
||||||
add_dependency_includes(${MASON_PACKAGE_stxxl_INCLUDE_DIRS})
|
|
||||||
set(MAYBE_STXXL_LIBRARY ${MASON_PACKAGE_stxxl_STATIC_LIBS})
|
|
||||||
add_definitions(-DUSE_STXXL_LIBRARY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
|
mason_use(expat VERSION ${MASON_EXPAT_VERSION})
|
||||||
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
|
add_dependency_includes(${MASON_PACKAGE_expat_INCLUDE_DIRS})
|
||||||
set(EXPAT_LIBRARIES ${MASON_PACKAGE_expat_STATIC_LIBS})
|
set(EXPAT_LIBRARIES ${MASON_PACKAGE_expat_STATIC_LIBS})
|
||||||
@ -524,30 +523,16 @@ else()
|
|||||||
|
|
||||||
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
add_dependency_includes(${Boost_INCLUDE_DIRS})
|
||||||
if(WIN32 AND Boost_VERSION VERSION_LESS 106200)
|
|
||||||
message(FATAL_ERROR "Building with MSVC needs Boost 1.62 with CXX11_CONSTEXPR support")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(TBB REQUIRED)
|
find_package(TBB REQUIRED)
|
||||||
add_dependency_includes(${TBB_INCLUDE_DIR})
|
add_dependency_includes(${TBB_INCLUDE_DIR})
|
||||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
if(WIN32)
|
||||||
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
set(TBB_LIBRARIES optimized ${TBB_LIBRARY} optimized ${TBB_MALLOC_LIBRARY} debug ${TBB_LIBRARY_DEBUG} debug ${TBB_MALLOC_LIBRARY_DEBUG})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(EXPAT REQUIRED)
|
find_package(EXPAT REQUIRED)
|
||||||
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
|
||||||
|
|
||||||
if (ENABLE_STXXL)
|
|
||||||
find_package(STXXL)
|
|
||||||
if (STXXL_FOUND)
|
|
||||||
add_dependency_includes(${STXXL_INCLUDE_DIR})
|
|
||||||
set(MAYBE_STXXL_LIBRARY ${STXXL_LIBRARY})
|
|
||||||
add_definitions(-DUSE_STXXL_LIBRARY)
|
|
||||||
else()
|
|
||||||
MESSAGE(STATUS "STXXL was requested but not found, default STL will be used")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(BZip2 REQUIRED)
|
find_package(BZip2 REQUIRED)
|
||||||
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
add_dependency_includes(${BZIP2_INCLUDE_DIR})
|
||||||
|
|
||||||
@ -607,15 +592,6 @@ add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
|
|||||||
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
|
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
|
||||||
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
|
add_dependency_defines(-DBOOST_FILESYSTEM_NO_DEPRECATED)
|
||||||
|
|
||||||
if (ENABLE_STXXL)
|
|
||||||
set(OpenMP_FIND_QUIETLY ON)
|
|
||||||
find_package(OpenMP)
|
|
||||||
if(OPENMP_FOUND)
|
|
||||||
message(STATUS "OpenMP support found. Linking just in case for stxxl")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_definitions(${OSRM_DEFINES})
|
add_definitions(${OSRM_DEFINES})
|
||||||
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
|
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})
|
||||||
|
|
||||||
@ -648,7 +624,6 @@ set(EXTRACTOR_LIBRARIES
|
|||||||
${EXPAT_LIBRARIES}
|
${EXPAT_LIBRARIES}
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${OSMIUM_LIBRARIES}
|
${OSMIUM_LIBRARIES}
|
||||||
${MAYBE_STXXL_LIBRARY}
|
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${ZLIB_LIBRARY}
|
${ZLIB_LIBRARY}
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
@ -682,7 +657,6 @@ set(CONTRACTOR_LIBRARIES
|
|||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${USED_LUA_LIBRARIES}
|
${USED_LUA_LIBRARIES}
|
||||||
${MAYBE_STXXL_LIBRARY}
|
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_RT_LIBRARY}
|
${MAYBE_RT_LIBRARY}
|
||||||
${MAYBE_COVERAGE_LIBRARIES})
|
${MAYBE_COVERAGE_LIBRARIES})
|
||||||
@ -702,7 +676,6 @@ set(STORAGE_LIBRARIES
|
|||||||
set(UTIL_LIBRARIES
|
set(UTIL_LIBRARIES
|
||||||
${BOOST_BASE_LIBRARIES}
|
${BOOST_BASE_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${MAYBE_STXXL_LIBRARY}
|
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${MAYBE_COVERAGE_LIBRARIES}
|
${MAYBE_COVERAGE_LIBRARIES}
|
||||||
${ZLIB_LIBRARY})
|
${ZLIB_LIBRARY})
|
||||||
@ -734,6 +707,11 @@ if (ENABLE_ASSERTIONS)
|
|||||||
add_definitions(-DBOOST_ENABLE_ASSERT_HANDLER)
|
add_definitions(-DBOOST_ENABLE_ASSERT_HANDLER)
|
||||||
endif()
|
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
|
# 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
|
# (i.e., from /usr/local/bin/) the linker can find library dependencies. For
|
||||||
# more info see http://www.cmake.org/Wiki/CMake_RPATH_handling
|
# more info see http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||||
@ -778,6 +756,7 @@ install(TARGETS osrm_customize DESTINATION lib)
|
|||||||
install(TARGETS osrm_update DESTINATION lib)
|
install(TARGETS osrm_update DESTINATION lib)
|
||||||
install(TARGETS osrm_contract DESTINATION lib)
|
install(TARGETS osrm_contract DESTINATION lib)
|
||||||
install(TARGETS osrm_store 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
|
# Install profiles and support library to /usr/local/share/osrm/profiles by default
|
||||||
|
|||||||
@ -10,7 +10,7 @@ ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%
|
|||||||
|
|
||||||
|
|
||||||
:: Check CMake version
|
:: Check CMake version
|
||||||
SET CMAKE_VERSION=3.9.2
|
SET CMAKE_VERSION=3.16.3
|
||||||
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
|
SET PATH=%PROJECT_DIR%\cmake-%CMAKE_VERSION%-win32-x86\bin;%PATH%
|
||||||
ECHO cmake^: && cmake --version
|
ECHO cmake^: && cmake --version
|
||||||
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
IF %ERRORLEVEL% NEQ 0 ECHO CMAKE not found && GOTO CMAKE_NOT_OK
|
||||||
@ -19,7 +19,7 @@ cmake --version | findstr /C:%CMAKE_VERSION% && GOTO CMAKE_OK
|
|||||||
|
|
||||||
:CMAKE_NOT_OK
|
:CMAKE_NOT_OK
|
||||||
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
ECHO CMAKE NOT OK - downloading new CMake %CMAKE_VERSION%
|
||||||
powershell Invoke-WebRequest https://cmake.org/files/v3.9/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
powershell Invoke-WebRequest https://cmake.org/files/v3.16/cmake-%CMAKE_VERSION%-win32-x86.zip -OutFile $env:PROJECT_DIR\cm.zip
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
|
IF NOT EXIST cmake-%CMAKE_VERSION%-win32-x86 7z -y x cm.zip | %windir%\system32\FIND "ing archive"
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
@ -29,8 +29,8 @@ ECHO CMAKE_OK
|
|||||||
cmake --version
|
cmake --version
|
||||||
|
|
||||||
ECHO activating VS command prompt ...
|
ECHO activating VS command prompt ...
|
||||||
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
|
SET PATH=C:\Program Files (x86)\MSBuild\15.0\Bin;%PATH%
|
||||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
|
||||||
ECHO platform^: %platform%
|
ECHO platform^: %platform%
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ ECHO msbuild version
|
|||||||
msbuild /version
|
msbuild /version
|
||||||
|
|
||||||
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
:: HARDCODE "x64" as it is uppercase on AppVeyor and download from S3 is case sensitive
|
||||||
SET DEPSPKG=osrm-deps-win-x64-14.0-2017.09.7z
|
SET DEPSPKG=osrm-deps-win-x64-14.2-2019.01.7z
|
||||||
|
|
||||||
:: local development
|
:: local development
|
||||||
ECHO.
|
ECHO.
|
||||||
@ -52,7 +52,7 @@ IF EXIST %DEPSPKG% DEL %DEPSPKG%
|
|||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
ECHO downloading %DEPSPKG%
|
ECHO downloading %DEPSPKG%
|
||||||
powershell Invoke-WebRequest https://mapbox.s3.amazonaws.com/windows-builds/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
|
powershell Invoke-WebRequest http://project-osrm.wolt.com/windows-build-deps/$env:DEPSPKG -OutFile $env:PROJECT_DIR\$env:DEPSPKG
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
|
|
||||||
:SKIPDL
|
:SKIPDL
|
||||||
@ -74,27 +74,35 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
|||||||
|
|
||||||
SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps
|
SET OSRMDEPSDIR=%PROJECT_DIR%/osrm-deps
|
||||||
set PREFIX=%OSRMDEPSDIR%/libs
|
set PREFIX=%OSRMDEPSDIR%/libs
|
||||||
set BOOST_ROOT=%OSRMDEPSDIR%/boost
|
set BOOST_ROOT=%OSRMDEPSDIR%
|
||||||
set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib
|
set BOOST_LIBRARYDIR=%BOOST_ROOT%/lib
|
||||||
set TBB_INSTALL_DIR=%OSRMDEPSDIR%/tbb
|
set TBB_INSTALL_DIR=%OSRMDEPSDIR%
|
||||||
set TBB_ARCH_PLATFORM=intel64/vc14
|
REM set TBB_ARCH_PLATFORM=intel64/vc17
|
||||||
|
|
||||||
ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR%
|
ECHO OSRMDEPSDIR ^: %OSRMDEPSDIR%
|
||||||
ECHO PREFIX ^: %PREFIX%
|
ECHO PREFIX ^: %PREFIX%
|
||||||
ECHO BOOST_ROOT ^: %BOOST_ROOT%
|
ECHO BOOST_ROOT ^: %BOOST_ROOT%
|
||||||
ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR%
|
ECHO BOOST_LIBRARYDIR ^: %BOOST_LIBRARYDIR%
|
||||||
ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR%
|
ECHO TBB_INSTALL_DIR ^: %TBB_INSTALL_DIR%
|
||||||
ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM%
|
REM ECHO TBB_ARCH_PLATFORM ^: %TBB_ARCH_PLATFORM%
|
||||||
|
|
||||||
|
|
||||||
ECHO calling cmake ....
|
ECHO calling cmake ....
|
||||||
cmake .. ^
|
cmake .. ^
|
||||||
-G "Visual Studio 14 2015 Win64" ^
|
-G "Visual Studio 16 2019" ^
|
||||||
-DBOOST_ROOT=%BOOST_ROOT% ^
|
-DBOOST_ROOT=%BOOST_ROOT% ^
|
||||||
-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^
|
-DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^
|
||||||
-DBoost_ADDITIONAL_VERSIONS=1.58 ^
|
-DBoost_ADDITIONAL_VERSIONS=1.73.0 ^
|
||||||
-DBoost_USE_MULTITHREADED=ON ^
|
-DBoost_USE_MULTITHREADED=ON ^
|
||||||
-DBoost_USE_STATIC_LIBS=ON ^
|
-DBoost_USE_STATIC_LIBS=ON ^
|
||||||
|
-DEXPAT_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||||
|
-DEXPAT_LIBRARY=%OSRMDEPSDIR%/lib/libexpat.lib ^
|
||||||
|
-DBZIP2_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||||
|
-DBZIP2_LIBRARIES=%OSRMDEPSDIR%/lib/libbz2.lib ^
|
||||||
|
-DLUA_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||||
|
-DLUA_LIBRARIES=%OSRMDEPSDIR%/lib/lua5.3.5.lib ^
|
||||||
|
-DZLIB_INCLUDE_DIR=%OSRMDEPSDIR% ^
|
||||||
|
-DZLIB_LIBRARY=%OSRMDEPSDIR%/lib/libz.lib ^
|
||||||
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
|
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
|
||||||
-DCMAKE_INSTALL_PREFIX=%PREFIX%
|
-DCMAKE_INSTALL_PREFIX=%PREFIX%
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
||||||
@ -106,60 +114,63 @@ msbuild OSRM.sln ^
|
|||||||
/t:rebuild ^
|
/t:rebuild ^
|
||||||
/p:BuildInParallel=true ^
|
/p:BuildInParallel=true ^
|
||||||
/m:%NUMBER_OF_PROCESSORS% ^
|
/m:%NUMBER_OF_PROCESSORS% ^
|
||||||
/toolsversion:14.0 ^
|
/toolsversion:Current ^
|
||||||
/p:PlatformToolset=v140 ^
|
/p:PlatformToolset=v142 ^
|
||||||
/clp:Verbosity=normal ^
|
/clp:Verbosity=normal ^
|
||||||
/nologo ^
|
/nologo ^
|
||||||
/flp1:logfile=build_errors.txt;errorsonly ^
|
/flp1:logfile=build_errors.txt;errorsonly ^
|
||||||
/flp2:logfile=build_warnings.txt;warningsonly
|
/flp2:logfile=build_warnings.txt;warningsonly
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||||
|
|
||||||
CD %PROJECT_DIR%\build
|
CD %PROJECT_DIR%\build
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||||
|
|
||||||
SET PATH=%PROJECT_DIR%\osrm-deps\libs\bin;%PATH%
|
SET PATH=%PROJECT_DIR%\osrm-deps\lib;%PATH%
|
||||||
|
|
||||||
ECHO running extractor-tests.exe ...
|
ECHO running extractor-tests.exe ...
|
||||||
unit_tests\%Configuration%\extractor-tests.exe
|
unit_tests\%Configuration%\extractor-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||||
|
|
||||||
ECHO running engine-tests.exe ...
|
ECHO running engine-tests.exe ...
|
||||||
unit_tests\%Configuration%\engine-tests.exe
|
unit_tests\%Configuration%\engine-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||||
|
|
||||||
ECHO running util-tests.exe ...
|
ECHO running util-tests.exe ...
|
||||||
unit_tests\%Configuration%\util-tests.exe
|
unit_tests\%Configuration%\util-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||||
|
|
||||||
ECHO running server-tests.exe ...
|
ECHO running server-tests.exe ...
|
||||||
unit_tests\%Configuration%\server-tests.exe
|
unit_tests\%Configuration%\server-tests.exe
|
||||||
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
|
IF %ERRORLEVEL% EQU 1 GOTO ERROR
|
||||||
|
|
||||||
ECHO running library-tests.exe ...
|
::TODO: CH processing sometimes mysteriously hangs, need to find why and enable tests below.
|
||||||
SET test_region=monaco
|
::ECHO running library-tests.exe ...
|
||||||
SET test_region_ch=ch\monaco
|
::SET test_region=monaco
|
||||||
SET test_region_corech=corech\monaco
|
::SET test_region_ch=ch\monaco
|
||||||
SET test_region_mld=mld\monaco
|
::SET test_region_corech=corech\monaco
|
||||||
SET test_osm=%test_region%.osm.pbf
|
::SET test_region_mld=mld\monaco
|
||||||
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
|
::SET test_osm=%test_region%.osm.pbf
|
||||||
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
::IF NOT EXIST %test_osm% powershell Invoke-WebRequest http://project-osrm.wolt.com/testing/monaco.osm.pbf -OutFile %test_osm%
|
||||||
MKDIR ch
|
::ECHO running %Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||||
XCOPY %test_region%.osrm.* ch\
|
::%Configuration%\osrm-extract.exe
|
||||||
XCOPY %test_region%.osrm ch\
|
::%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
|
||||||
MKDIR corech
|
::MKDIR ch
|
||||||
XCOPY %test_region%.osrm.* corech\
|
::XCOPY %test_region%.osrm.* ch\
|
||||||
XCOPY %test_region%.osrm corech\
|
::XCOPY %test_region%.osrm ch\
|
||||||
MKDIR mld
|
::MKDIR corech
|
||||||
XCOPY %test_region%.osrm.* mld\
|
::XCOPY %test_region%.osrm.* corech\
|
||||||
XCOPY %test_region%.osrm mld\
|
::XCOPY %test_region%.osrm corech\
|
||||||
%Configuration%\osrm-contract.exe %test_region_ch%.osrm
|
::MKDIR mld
|
||||||
%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
|
::XCOPY %test_region%.osrm.* mld\
|
||||||
%Configuration%\osrm-partition.exe %test_region_mld%.osrm
|
::XCOPY %test_region%.osrm mld\
|
||||||
%Configuration%\osrm-customize.exe %test_region_mld%.osrm
|
::%Configuration%\osrm-contract.exe %test_region_ch%.osrm
|
||||||
XCOPY /Y ch\*.* ..\test\data\ch\
|
::%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
|
||||||
XCOPY /Y corech\*.* ..\test\data\corech\
|
::%Configuration%\osrm-partition.exe %test_region_mld%.osrm
|
||||||
XCOPY /Y mld\*.* ..\test\data\mld\
|
::%Configuration%\osrm-customize.exe %test_region_mld%.osrm
|
||||||
unit_tests\%Configuration%\library-tests.exe
|
::XCOPY /Y ch\*.* ..\test\data\ch\
|
||||||
|
::XCOPY /Y corech\*.* ..\test\data\corech\
|
||||||
|
::XCOPY /Y mld\*.* ..\test\data\mld\
|
||||||
|
::unit_tests\%Configuration%\library-tests.exe
|
||||||
|
|
||||||
:ERROR
|
:ERROR
|
||||||
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -10,7 +10,7 @@ install:
|
|||||||
init:
|
init:
|
||||||
- git config --global core.autocrlf input
|
- git config --global core.autocrlf input
|
||||||
|
|
||||||
os: Visual Studio 2015
|
os: Visual Studio 2019
|
||||||
|
|
||||||
# clone directory
|
# clone directory
|
||||||
clone_folder: c:\projects\osrm
|
clone_folder: c:\projects\osrm
|
||||||
@ -25,9 +25,10 @@ before_test:
|
|||||||
- npm --version
|
- npm --version
|
||||||
- npm install --ignore-scripts
|
- npm install --ignore-scripts
|
||||||
- npm link --ignore-scripts
|
- npm link --ignore-scripts
|
||||||
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
|
- SET PATH=%CD%\osrm-deps\lib;%PATH%
|
||||||
- SET OSRM_BUILD_DIR=build\%Configuration%
|
- SET OSRM_BUILD_DIR=build\%Configuration%
|
||||||
- npm test
|
# TODO tests fail with "JavaScript heap out of memory", need a better host?
|
||||||
|
# - npm test
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|||||||
@ -11,7 +11,6 @@ SET CONFIGURATION=Release
|
|||||||
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
|
FOR /F "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do SET APPVEYOR_REPO_BRANCH=%%i
|
||||||
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
|
ECHO APPVEYOR_REPO_BRANCH^: %APPVEYOR_REPO_BRANCH%
|
||||||
|
|
||||||
SET PATH=C:\mb\windows-builds-64\tmp-bin\cmake-3.7.0-rc2-win32-x86\bin;%PATH%
|
|
||||||
SET PATH=C:\Program Files\7-Zip;%PATH%
|
SET PATH=C:\Program Files\7-Zip;%PATH%
|
||||||
|
|
||||||
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
|
powershell Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
|
||||||
|
|||||||
@ -1,51 +0,0 @@
|
|||||||
# Locate STXXL library
|
|
||||||
# This module defines
|
|
||||||
# STXXL_FOUND, if false, do not try to link to libstxxl
|
|
||||||
# STXXL_LIBRARY
|
|
||||||
# STXXL_INCLUDE_DIR, where to find stxxl.h
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
IF( NOT STXXL_FIND_QUIETLY )
|
|
||||||
MESSAGE(STATUS "Looking for STXXL...")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
FIND_PATH(STXXL_INCLUDE_DIR stxxl.h
|
|
||||||
HINTS
|
|
||||||
$ENV{STXXL_DIR}
|
|
||||||
PATH_SUFFIXES stxxl include/stxxl/stxxl include/stxxl include
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local
|
|
||||||
/usr
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(STXXL_LIBRARY
|
|
||||||
NAMES stxxl stxxl_debug
|
|
||||||
HINTS
|
|
||||||
$ENV{STXXL_DIR}
|
|
||||||
PATH_SUFFIXES lib64 lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local
|
|
||||||
/usr
|
|
||||||
/opt/local
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set STXXL_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(STXXL DEFAULT_MSG STXXL_LIBRARY STXXL_INCLUDE_DIR)
|
|
||||||
|
|
||||||
IF( NOT STXXL_FIND_QUIETLY )
|
|
||||||
IF( STXXL_FOUND )
|
|
||||||
MESSAGE(STATUS "Found STXXL: ${STXXL_LIBRARY}" )
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(STXXL_INCLUDE_DIR STXXL_LIBRARY)
|
|
||||||
@ -50,6 +50,7 @@ Returns the fastest route between two or more coordinates while visiting the way
|
|||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
|
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||||
- `options.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes. (optional, default `false`)
|
- `options.alternatives` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Search for alternative routes. (optional, default `false`)
|
||||||
- `options.alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Search for up to this many alternative routes.
|
- `options.alternatives` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Search for up to this many alternative routes.
|
||||||
_Please note that even if alternative routes are requested, a result cannot be guaranteed._ (optional, default `0`)
|
_Please note that even if alternative routes are requested, a result cannot be guaranteed._ (optional, default `0`)
|
||||||
@ -91,6 +92,7 @@ Note: `coordinates` in the general options only supports a single `{longitude},{
|
|||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
|
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||||
- `options.number` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of nearest segments that should be returned.
|
- `options.number` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of nearest segments that should be returned.
|
||||||
Must be an integer greater than or equal to `1`. (optional, default `1`)
|
Must be an integer greater than or equal to `1`. (optional, default `1`)
|
||||||
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
- `options.approaches` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Keep waypoints on curb side. Can be `null` (unrestricted, default) or `curb`.
|
||||||
@ -128,6 +130,7 @@ tables. Optionally returns distance table.
|
|||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `null` (unlimited, default) or `double >= 0`.
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
|
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||||
- `options.sources` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer < #coordinates`) to
|
- `options.sources` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** An array of `index` elements (`0 <= integer < #coordinates`) to
|
||||||
use
|
use
|
||||||
location with given index as source. Default is to use all.
|
location with given index as source. Default is to use all.
|
||||||
@ -208,6 +211,7 @@ if they can not be matched successfully.
|
|||||||
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
- `options.bearings` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the search to segments with given bearing in degrees towards true north in clockwise direction.
|
||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
|
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||||
@ -274,6 +278,7 @@ Right now, the following combinations are possible:
|
|||||||
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
Can be `null` or an array of `[{value},{range}]` with `integer 0 .. 360,integer 0 .. 180`.
|
||||||
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
- `options.radiuses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Limits the coordinate snapping to streets in the given radius in meters. Can be `double >= 0` or `null` (unlimited, default).
|
||||||
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
- `options.hints` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** Hints for the coordinate snapping. Array of base64 encoded strings.
|
||||||
|
- `options.generate_hints` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default `true`)
|
||||||
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
- `options.steps` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Return route steps for each route. (optional, default `false`)
|
||||||
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
- `options.annotations` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** An array with strings of `duration`, `nodes`, `distance`, `weight`, `datasources`, `speed` or boolean for enabling/disabling all. (optional, default `false`)
|
||||||
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
- `options.geometries` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returned route geometry format (influences overview and per step). Can also be `geojson`. (optional, default `polyline`)
|
||||||
|
|||||||
@ -89,7 +89,7 @@ They all return a table of functions when you use `require` to load them. You ca
|
|||||||
### setup()
|
### setup()
|
||||||
The `setup` function is called once when the profile is loaded and must return a table of configurations. It's also where you can do other global setup, like loading data sources that are used during processing.
|
The `setup` function is called once when the profile is loaded and must return a table of configurations. It's also where you can do other global setup, like loading data sources that are used during processing.
|
||||||
|
|
||||||
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA iinterpreter will have its own set of globals.
|
Note that processing of data is parallelized and several unconnected LUA interpreters will be running at the same time. The `setup` function will be called once for each. Each LUA interpreter will have its own set of globals.
|
||||||
|
|
||||||
The following global properties can be set under `properties` in the hash you return in the `setup` function:
|
The following global properties can be set under `properties` in the hash you return in the `setup` function:
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ Attribute | Type | Notes
|
|||||||
weight_name | String | Name used in output for the routing weight property (default `'duration'`)
|
weight_name | String | Name used in output for the routing weight property (default `'duration'`)
|
||||||
weight_precision | Unsigned | Decimal precision of edge weights (default `1`)
|
weight_precision | Unsigned | Decimal precision of edge weights (default `1`)
|
||||||
left_hand_driving | Boolean | Are vehicles assumed to drive on the left? (used in guidance, default `false`)
|
left_hand_driving | Boolean | Are vehicles assumed to drive on the left? (used in guidance, default `false`)
|
||||||
use_turn_restrictions | Boolean | Are turn instructions followed? (default `false`)
|
use_turn_restrictions | Boolean | Are turn restrictions followed? (default `false`)
|
||||||
continue_straight_at_waypoint | Boolean | Must the route continue straight on at a via point, or are U-turns allowed? (default `true`)
|
continue_straight_at_waypoint | Boolean | Must the route continue straight on at a via point, or are U-turns allowed? (default `true`)
|
||||||
max_speed_for_map_matching | Float | Maximum vehicle speed to be assumed in matching (in m/s)
|
max_speed_for_map_matching | Float | Maximum vehicle speed to be assumed in matching (in m/s)
|
||||||
max_turn_weight | Float | Maximum turn penalty weight
|
max_turn_weight | Float | Maximum turn penalty weight
|
||||||
@ -178,7 +178,7 @@ exits | String | The ramp's exit numbers or
|
|||||||
pronunciation | String | Name pronunciation
|
pronunciation | String | Name pronunciation
|
||||||
road_classification.motorway_class | Boolean | Guidance: way is a motorway
|
road_classification.motorway_class | Boolean | Guidance: way is a motorway
|
||||||
road_classification.link_class | Boolean | Guidance: way is a slip/link road
|
road_classification.link_class | Boolean | Guidance: way is a slip/link road
|
||||||
road_classification.road_priority_class | Enum | Guidance: order in priority list. Defined in `include/extractor/guidance/road_classification.hpp`
|
road_classification.road_priority_class | Enum | Guidance: order in priority list. Defined in `include/extractor/road_classification.hpp`
|
||||||
road_classification.may_be_ignored | Boolean | Guidance: way is non-highway
|
road_classification.may_be_ignored | Boolean | Guidance: way is non-highway
|
||||||
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
|
road_classification.num_lanes | Unsigned | Guidance: total number of lanes in way
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ source_number_of_lanes | Read | Integer |
|
|||||||
source_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
source_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||||
source_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
source_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||||
source_speed | Read | Integer | Speed on this source road in km/h
|
source_speed | Read | Integer | Speed on this source road in km/h
|
||||||
source_priority_class | Read | Enum | The type of road priority class of the source. Defined in `include/extractor/guidance/road_classification.hpp`
|
source_priority_class | Read | Enum | The type of road priority class of the source. Defined in `include/extractor/road_classification.hpp`
|
||||||
target_restricted | Read | Boolean | Is the target a restricted access road? (See definition in `process_way`)
|
target_restricted | Read | Boolean | Is the target a restricted access road? (See definition in `process_way`)
|
||||||
target_mode | Read | Enum | Travel mode after the turn. Defined in `include/extractor/travel_mode.hpp`
|
target_mode | Read | Enum | Travel mode after the turn. Defined in `include/extractor/travel_mode.hpp`
|
||||||
target_is_motorway | Read | Boolean | Is the target road a motorway?
|
target_is_motorway | Read | Boolean | Is the target road a motorway?
|
||||||
@ -232,7 +232,7 @@ target_number_of_lanes | Read | Integer |
|
|||||||
target_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
target_highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||||
target_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
target_access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15))
|
||||||
target_speed | Read | Integer | Speed on this target road in km/h
|
target_speed | Read | Integer | Speed on this target road in km/h
|
||||||
target_priority_class | Read | Enum | The type of road priority class of the target. Defined in `include/extractor/guidance/road_classification.hpp`
|
target_priority_class | Read | Enum | The type of road priority class of the target. Defined in `include/extractor/road_classification.hpp`
|
||||||
roads_on_the_right | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the right of the turn that are also connected at the intersection
|
roads_on_the_right | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the right of the turn that are also connected at the intersection
|
||||||
roads_on_the_left | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the left of the turn that are also connected at the intersection. If turn is a u turn, this is empty.
|
roads_on_the_left | Read | Vector<ExtractionTurnLeg> | Vector with information about other roads on the left of the turn that are also connected at the intersection. If turn is a u turn, this is empty.
|
||||||
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
weight | Read/write | Float | Penalty to be applied for this turn (routing weight)
|
||||||
@ -252,7 +252,7 @@ number_of_lanes | Read | Integer | How many lanes does th
|
|||||||
highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
highway_turn_classification | Read | Integer | Classification based on highway tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
||||||
access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
access_turn_classification | Read | Integer | Classification based on access tag defined by user during setup. (default when not set: 0, allowed classification values are: 0-15)
|
||||||
speed | Read | Integer | Speed on this road in km/h
|
speed | Read | Integer | Speed on this road in km/h
|
||||||
priority_class | Read | Enum | The type of road priority class of the leg. Defined in `include/extractor/guidance/road_classification.hpp`
|
priority_class | Read | Enum | The type of road priority class of the leg. Defined in `include/extractor/road_classification.hpp`
|
||||||
is_incoming | Read | Boolean | Is the road an incoming road of the intersection
|
is_incoming | Read | Boolean | Is the road an incoming road of the intersection
|
||||||
is_outgoing | Read | Boolean | Is the road an outgoing road of the intersection
|
is_outgoing | Read | Boolean | Is the road an outgoing road of the intersection
|
||||||
|
|
||||||
|
|||||||
97
docs/windows-deps.md
Normal file
97
docs/windows-deps.md
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
# Building OSRM for Windows
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
Get a decent Windows with decent Visual Studio (14 at least for C++11 support). The published binaries are build with
|
||||||
|
VS2019 and Windows SDK8.1.
|
||||||
|
|
||||||
|
In case you are using [prepacked Windows VM with VS2019](https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/), you
|
||||||
|
have to install [Windows SDK 8.1](https://go.microsoft.com/fwlink/p/?LinkId=323507)
|
||||||
|
|
||||||
|
Prepare directories for dependencies, build and target file location.Target directory ($target starting from that moment) should have /include and /lib subdirectories.
|
||||||
|
|
||||||
|
### Bzip2
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://project-osrm.wolt.com/deps/bzip2-1.0.8.tar.gz
|
||||||
|
* https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
|
||||||
|
|
||||||
|
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
3. Issue `nmake /f makefile.msc`
|
||||||
|
4. Copy bzlib.h to $target\include and libbz2.lib to $target\lib
|
||||||
|
|
||||||
|
### ZLib
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://project-osrm.wolt.com/deps/zlib-1.2.11.tar.gz
|
||||||
|
* https://www.zlib.net/zlib-1.2.11.tar.gz
|
||||||
|
|
||||||
|
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
3. Switch to `contrib\vstudio\vc14`
|
||||||
|
4. If needed, open `zlibvc.sln` with Visual Studio and retarget to your version of compiler and SDK.
|
||||||
|
5. Issue `msbuild zlibvc.sln /p:BuildInParallel=true /p:Configuration=Release /p:Platform=x64 /m:<Number of cpu cores>`
|
||||||
|
6. Copy x64\ZlibStatRelease\zlibstat.lib to $target\lib\libz.lib, copy zlib.h and zconf.h to $target\include
|
||||||
|
|
||||||
|
### ICU
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://wolt-project.wolt.com/deps/icu4c-66_1-src.zip
|
||||||
|
* https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.zip
|
||||||
|
* https://wolt-project.wolt.com/deps/icu4c-66_1-data.zip
|
||||||
|
* https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-data.zip
|
||||||
|
2. Do retarget if neededby openinig .\source\allinone\allinone.sln and editing projects
|
||||||
|
3. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
4. Run build:
|
||||||
|
msbuild .\source\allinone\allinone.sln /nologo /p:BuildInParallel=true /p:Configuration=Release /p:Platform=x64 /m:<Number of cpu cores>
|
||||||
|
5. Copy lib64\*.lib to $target\lib, copy include contents to $target\include
|
||||||
|
6. Copy bin64\*dll to any dir withing your $PATH. At the same time copy them to $target\lib
|
||||||
|
|
||||||
|
### Boost
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://project-osrm.wolt.com/deps/boost_1_73_0.zip
|
||||||
|
* https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.zip
|
||||||
|
|
||||||
|
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
3. Build b2:
|
||||||
|
bootstrap.bat --with-toolset=msvc-14.2
|
||||||
|
4. Build boost:
|
||||||
|
b2 -a -d release state --build-type=minimal toolset=msvc-14.2 -q runtime-link=shared link=static address-model=64 --with-iostreams --with-test --with-thread --with-filesystem --with-date_time --with-system --with-program_options --with-regex --disable-filesystem2 -sHAVE_ICU=1 include=<target>\include library-path=<target>\lib -sZLIB_SOURCE=<builddir>/zlib -zBZIP2_BINARY=libbz2 -sBZIP2_INCLUDE=<target>\include -sBZIP2_LIBPATH=<target>\lib -sICU_ICUUC_NAME=icuuc -sICU_ICUDT_NAME=icudt -sICU_ICUIN_NAME=icuin -sBUILD=boost_unit_test_framework -j<number of cpu cores>
|
||||||
|
5. Copy `boost` subdirectory to <target>\include and contents of `stage` to <target>\lib
|
||||||
|
|
||||||
|
### Expat
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://project-osrm.wolt.com/deps/libexpat-2_2_9.zip
|
||||||
|
* https://github.com/libexpat/libexpat/archive/R_2_2_9.zip
|
||||||
|
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
3. Configure build my calling cmake:
|
||||||
|
mkdir expat\build
|
||||||
|
cd expat\build
|
||||||
|
cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DEXPAT_MSVC_STATIC_CRT=ON -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_SHARED_LIBS=OFF ..
|
||||||
|
4. Build expat: `msbuild expat.sln /nologo /p:Configuration=Release /p:Platform=x64`
|
||||||
|
5. Copy `Release\libexpat.*` to <target>/lib. Copy `expat/lib/expat.h` and `expat/lib/expat_external.h` to <target>/include
|
||||||
|
|
||||||
|
### LUA
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://project-osrm.wolt.com/deps/lua-5.3.5.tar.gz
|
||||||
|
* https://www.lua.org/ftp/lua-5.3.5.tar.gz
|
||||||
|
2. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
3. Lua doesn't have native MSVC support, so you have to compile it by hand:
|
||||||
|
cd src
|
||||||
|
cl /MD /O2 /c /DLUA_COMPAT_5_2 *.c
|
||||||
|
ren lua.obj lua.o
|
||||||
|
ren luac.obj luac.o
|
||||||
|
link /LIB /OUT:lua5.3.5.dll *.obj
|
||||||
|
4. Copy `lua5.3.5.lib` to <target>/lib. Copy `lua.h`,`lauxlib,h`,`lua.hpp`,`lualib.h`,`luaconf.h` to <target>/include
|
||||||
|
|
||||||
|
### TBB
|
||||||
|
|
||||||
|
1. Download either from Wolt OSRM mirror or original distribution and unpack.
|
||||||
|
* https://project-osrm.wolt.com/deps/oneTBB-v2020.2.zip
|
||||||
|
* https://github.com/oneapi-src/oneTBB/archive/v2020.2.zip
|
||||||
|
2. Retarget by opening build\vs2013\makefile.sln
|
||||||
|
3. Start 'x64 Native Tools Command Prompt for VS2019' and change directory to unpacked source tree.
|
||||||
|
4. Switch to build\vs2013 and build: `msbuild makefle.sln /nologo /p:Configuration=Release /p:Platform=x64`
|
||||||
|
5. Copy x64/Release/*.{dll,lib} files to <target>/lib and copy contents of include directory to <target>/include
|
||||||
@ -127,6 +127,7 @@ Feature: Bike - Access tags on ways
|
|||||||
| | | agricultural | |
|
| | | agricultural | |
|
||||||
| | | forestry | |
|
| | | forestry | |
|
||||||
| | | delivery | |
|
| | | delivery | |
|
||||||
|
| | | use_sidepath | |
|
||||||
|
|
||||||
Scenario: Bike - Access tags on both node and way
|
Scenario: Bike - Access tags on both node and way
|
||||||
Then routability should be
|
Then routability should be
|
||||||
|
|||||||
@ -22,14 +22,9 @@ module.exports = function () {
|
|||||||
this.PROFILES_PATH = path.resolve(this.ROOT_PATH, 'profiles');
|
this.PROFILES_PATH = path.resolve(this.ROOT_PATH, 'profiles');
|
||||||
this.FIXTURES_PATH = path.resolve(this.ROOT_PATH, 'unit_tests/fixtures');
|
this.FIXTURES_PATH = path.resolve(this.ROOT_PATH, 'unit_tests/fixtures');
|
||||||
this.BIN_PATH = process.env.OSRM_BUILD_DIR && process.env.OSRM_BUILD_DIR || path.resolve(this.ROOT_PATH, 'build');
|
this.BIN_PATH = process.env.OSRM_BUILD_DIR && process.env.OSRM_BUILD_DIR || path.resolve(this.ROOT_PATH, 'build');
|
||||||
var stxxl_config = path.resolve(this.ROOT_PATH, 'test/.stxxl');
|
|
||||||
if (!fs.existsSync(stxxl_config)) {
|
|
||||||
return callback(new Error('*** '+stxxl_config+ 'does not exist'));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.DATASET_NAME = 'cucumber';
|
this.DATASET_NAME = 'cucumber';
|
||||||
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
|
||||||
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
|
this.DEFAULT_ENVIRONMENT = process.env;
|
||||||
this.DEFAULT_PROFILE = 'bicycle';
|
this.DEFAULT_PROFILE = 'bicycle';
|
||||||
this.DEFAULT_INPUT_FORMAT = 'osm';
|
this.DEFAULT_INPUT_FORMAT = 'osm';
|
||||||
this.DEFAULT_LOAD_METHOD = process.argv[process.argv.indexOf('-m') +1].match('mmap') ? 'mmap' : 'datastore';
|
this.DEFAULT_LOAD_METHOD = process.argv[process.argv.indexOf('-m') +1].match('mmap') ? 'mmap' : 'datastore';
|
||||||
|
|||||||
@ -192,17 +192,22 @@ void annotatePath(const FacadeT &facade,
|
|||||||
|
|
||||||
const bool is_first_segment = unpacked_path.empty();
|
const bool is_first_segment = unpacked_path.empty();
|
||||||
|
|
||||||
const std::size_t start_index =
|
std::size_t start_index = 0;
|
||||||
(is_first_segment ? ((start_traversed_in_reverse)
|
if (is_first_segment)
|
||||||
? weight_vector.size() -
|
{
|
||||||
phantom_node_pair.source_phantom.fwd_segment_position - 1
|
unsigned short segment_position = phantom_node_pair.source_phantom.fwd_segment_position;
|
||||||
: phantom_node_pair.source_phantom.fwd_segment_position)
|
if (start_traversed_in_reverse)
|
||||||
: 0);
|
{
|
||||||
|
segment_position = weight_vector.size() -
|
||||||
|
phantom_node_pair.source_phantom.fwd_segment_position - 1;
|
||||||
|
}
|
||||||
|
BOOST_ASSERT(segment_position >= 0);
|
||||||
|
start_index = static_cast<std::size_t>(segment_position);
|
||||||
|
}
|
||||||
const std::size_t end_index = weight_vector.size();
|
const std::size_t end_index = weight_vector.size();
|
||||||
|
|
||||||
bool is_left_hand_driving = facade.IsLeftHandDriving(node_id);
|
bool is_left_hand_driving = facade.IsLeftHandDriving(node_id);
|
||||||
|
|
||||||
BOOST_ASSERT(start_index >= 0);
|
|
||||||
BOOST_ASSERT(start_index < end_index);
|
BOOST_ASSERT(start_index < end_index);
|
||||||
for (std::size_t segment_idx = start_index; segment_idx < end_index; ++segment_idx)
|
for (std::size_t segment_idx = start_index; segment_idx < end_index; ++segment_idx)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -85,33 +85,6 @@ struct InternalExtractorEdge
|
|||||||
DurationData duration_data;
|
DurationData duration_data;
|
||||||
// coordinate of the source node
|
// coordinate of the source node
|
||||||
util::Coordinate source_coordinate;
|
util::Coordinate source_coordinate;
|
||||||
|
|
||||||
// necessary static util functions for stxxl's sorting
|
|
||||||
static InternalExtractorEdge min_osm_value()
|
|
||||||
{
|
|
||||||
return InternalExtractorEdge(
|
|
||||||
MIN_OSM_NODEID, MIN_OSM_NODEID, WeightData(), DurationData(), util::Coordinate());
|
|
||||||
}
|
|
||||||
static InternalExtractorEdge max_osm_value()
|
|
||||||
{
|
|
||||||
return InternalExtractorEdge(
|
|
||||||
MAX_OSM_NODEID, MAX_OSM_NODEID, WeightData(), DurationData(), util::Coordinate());
|
|
||||||
}
|
|
||||||
|
|
||||||
static InternalExtractorEdge min_internal_value()
|
|
||||||
{
|
|
||||||
auto v = min_osm_value();
|
|
||||||
v.result.source = 0;
|
|
||||||
v.result.target = 0;
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
static InternalExtractorEdge max_internal_value()
|
|
||||||
{
|
|
||||||
auto v = max_osm_value();
|
|
||||||
v.result.source = std::numeric_limits<NodeID>::max();
|
|
||||||
v.result.target = std::numeric_limits<NodeID>::max();
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
73
include/extractor/raster_source.hpp
Normal file → Executable file
73
include/extractor/raster_source.hpp
Normal file → Executable file
@ -4,16 +4,21 @@
|
|||||||
#include "util/coordinate.hpp"
|
#include "util/coordinate.hpp"
|
||||||
#include "util/exception.hpp"
|
#include "util/exception.hpp"
|
||||||
|
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/algorithm/string/trim.hpp>
|
#include <boost/algorithm/string/trim.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/spirit/include/qi.hpp>
|
||||||
#include <boost/spirit/include/qi_int.hpp>
|
#include <boost/spirit/include/qi_int.hpp>
|
||||||
|
|
||||||
#include <storage/io.hpp>
|
#include <storage/io.hpp>
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@ -43,37 +48,31 @@ class RasterGrid
|
|||||||
xdim = _xdim;
|
xdim = _xdim;
|
||||||
ydim = _ydim;
|
ydim = _ydim;
|
||||||
_data.reserve(ydim * xdim);
|
_data.reserve(ydim * xdim);
|
||||||
|
BOOST_ASSERT(ydim * xdim <= _data.capacity());
|
||||||
|
|
||||||
|
// Construct FileReader
|
||||||
storage::io::FileReader file_reader(filepath, storage::io::FileReader::HasNoFingerprint);
|
storage::io::FileReader file_reader(filepath, storage::io::FileReader::HasNoFingerprint);
|
||||||
|
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
buffer.resize(file_reader.GetSize());
|
buffer.resize(xdim * 11); // INT32_MAX = 2147483647 = 10 chars + 1 white space = 11
|
||||||
|
BOOST_ASSERT(xdim * 11 <= buffer.size());
|
||||||
BOOST_ASSERT(buffer.size() > 1);
|
|
||||||
|
|
||||||
file_reader.ReadInto(&buffer[0], buffer.size());
|
|
||||||
|
|
||||||
|
for (unsigned int y = 0; y < ydim; y++)
|
||||||
|
{
|
||||||
|
// read one line from file.
|
||||||
|
file_reader.ReadLine(&buffer[0], xdim * 11);
|
||||||
boost::algorithm::trim(buffer);
|
boost::algorithm::trim(buffer);
|
||||||
|
|
||||||
auto itr = buffer.begin();
|
std::vector<std::string> result;
|
||||||
auto end = buffer.end();
|
boost::split(
|
||||||
|
result, buffer, boost::is_any_of(" \r\n\0"), boost::algorithm::token_compress_on);
|
||||||
bool r = false;
|
unsigned int x = 0;
|
||||||
try
|
for (const auto &s : result)
|
||||||
{
|
{
|
||||||
r = boost::spirit::qi::parse(
|
if (x < xdim)
|
||||||
itr, end, +boost::spirit::qi::int_ % +boost::spirit::qi::space, _data);
|
_data[(y * xdim) + x] = atoi(s.c_str());
|
||||||
|
++x;
|
||||||
}
|
}
|
||||||
catch (std::exception const &ex)
|
BOOST_ASSERT(x == xdim);
|
||||||
{
|
|
||||||
throw util::exception("Failed to read from raster source " + filepath.string() + ": " +
|
|
||||||
ex.what() + SOURCE_REF);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!r || itr != end)
|
|
||||||
{
|
|
||||||
throw util::exception("Failed to parse raster source: " + filepath.string() +
|
|
||||||
SOURCE_REF);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,8 +142,36 @@ class RasterContainer
|
|||||||
RasterDatum GetRasterInterpolateFromSource(unsigned int source_id, double lon, double lat);
|
RasterDatum GetRasterInterpolateFromSource(unsigned int source_id, double lon, double lat);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
// << singletone >> RasterCache
|
||||||
|
// The instance of RasterContainer is created for every threads osrm-extract uses.
|
||||||
|
// To avoid multiple load of same file on each RasterContainer,
|
||||||
|
// The LoadedSources and LoadedSourcePaths are separated to RasterCache class
|
||||||
|
// and handled as the singletone pattern to avoid duplicate creation.
|
||||||
|
class RasterCache
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// class method to get the instance
|
||||||
|
static RasterCache &getInstance()
|
||||||
|
{
|
||||||
|
if (NULL == g_instance)
|
||||||
|
{
|
||||||
|
g_instance = new RasterCache();
|
||||||
|
}
|
||||||
|
return *g_instance;
|
||||||
|
}
|
||||||
|
// get reference of cache
|
||||||
|
std::vector<RasterSource> &getLoadedSources() { return LoadedSources; }
|
||||||
|
std::unordered_map<std::string, int> &getLoadedSourcePaths() { return LoadedSourcePaths; }
|
||||||
|
private:
|
||||||
|
// constructor
|
||||||
|
RasterCache() = default;
|
||||||
|
// member
|
||||||
std::vector<RasterSource> LoadedSources;
|
std::vector<RasterSource> LoadedSources;
|
||||||
std::unordered_map<std::string, int> LoadedSourcePaths;
|
std::unordered_map<std::string, int> LoadedSourcePaths;
|
||||||
|
// the instance
|
||||||
|
static RasterCache *g_instance;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,8 +37,11 @@ struct Engine final : public Nan::ObjectWrap
|
|||||||
std::shared_ptr<osrm::OSRM> this_;
|
std::shared_ptr<osrm::OSRM> this_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ns node_osrm
|
} // namespace node_osrm
|
||||||
|
|
||||||
NODE_MODULE(osrm, node_osrm::Engine::Init)
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
|
NAN_MODULE_WORKER_ENABLED(osrm, node_osrm::Engine::Init)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -116,8 +116,8 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
|
|
||||||
if (args[0]->IsString())
|
if (args[0]->IsString())
|
||||||
{
|
{
|
||||||
engine_config->storage_config = osrm::StorageConfig(
|
engine_config->storage_config =
|
||||||
*v8::String::Utf8Value(Nan::To<v8::String>(args[0]).ToLocalChecked()));
|
osrm::StorageConfig(*Nan::Utf8String(Nan::To<v8::String>(args[0]).ToLocalChecked()));
|
||||||
engine_config->use_shared_memory = false;
|
engine_config->use_shared_memory = false;
|
||||||
return engine_config;
|
return engine_config;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
engine_config->memory_file =
|
engine_config->memory_file =
|
||||||
*v8::String::Utf8Value(Nan::To<v8::String>(memory_file).ToLocalChecked());
|
*Nan::Utf8String(Nan::To<v8::String>(memory_file).ToLocalChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dataset_name = params->Get(Nan::New("dataset_name").ToLocalChecked());
|
auto dataset_name = params->Get(Nan::New("dataset_name").ToLocalChecked());
|
||||||
@ -166,7 +166,7 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
if (dataset_name->IsString())
|
if (dataset_name->IsString())
|
||||||
{
|
{
|
||||||
engine_config->dataset_name =
|
engine_config->dataset_name =
|
||||||
*v8::String::Utf8Value(Nan::To<v8::String>(dataset_name).ToLocalChecked());
|
*Nan::Utf8String(Nan::To<v8::String>(dataset_name).ToLocalChecked());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -178,7 +178,7 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
if (!path->IsUndefined())
|
if (!path->IsUndefined())
|
||||||
{
|
{
|
||||||
engine_config->storage_config =
|
engine_config->storage_config =
|
||||||
osrm::StorageConfig(*v8::String::Utf8Value(Nan::To<v8::String>(path).ToLocalChecked()));
|
osrm::StorageConfig(*Nan::Utf8String(Nan::To<v8::String>(path).ToLocalChecked()));
|
||||||
|
|
||||||
engine_config->use_shared_memory = false;
|
engine_config->use_shared_memory = false;
|
||||||
}
|
}
|
||||||
@ -221,15 +221,15 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
if (algorithm->IsString())
|
if (algorithm->IsString())
|
||||||
{
|
{
|
||||||
auto algorithm_str = Nan::To<v8::String>(algorithm).ToLocalChecked();
|
auto algorithm_str = Nan::To<v8::String>(algorithm).ToLocalChecked();
|
||||||
if (*v8::String::Utf8Value(algorithm_str) == std::string("CH"))
|
if (*Nan::Utf8String(algorithm_str) == std::string("CH"))
|
||||||
{
|
{
|
||||||
engine_config->algorithm = osrm::EngineConfig::Algorithm::CH;
|
engine_config->algorithm = osrm::EngineConfig::Algorithm::CH;
|
||||||
}
|
}
|
||||||
else if (*v8::String::Utf8Value(algorithm_str) == std::string("CoreCH"))
|
else if (*Nan::Utf8String(algorithm_str) == std::string("CoreCH"))
|
||||||
{
|
{
|
||||||
engine_config->algorithm = osrm::EngineConfig::Algorithm::CH;
|
engine_config->algorithm = osrm::EngineConfig::Algorithm::CH;
|
||||||
}
|
}
|
||||||
else if (*v8::String::Utf8Value(algorithm_str) == std::string("MLD"))
|
else if (*Nan::Utf8String(algorithm_str) == std::string("MLD"))
|
||||||
{
|
{
|
||||||
engine_config->algorithm = osrm::EngineConfig::Algorithm::MLD;
|
engine_config->algorithm = osrm::EngineConfig::Algorithm::MLD;
|
||||||
}
|
}
|
||||||
@ -290,23 +290,22 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (max_locations_trip->IsNumber())
|
if (max_locations_trip->IsNumber())
|
||||||
engine_config->max_locations_trip = static_cast<int>(max_locations_trip->NumberValue());
|
engine_config->max_locations_trip = Nan::To<int>(max_locations_trip).FromJust();
|
||||||
if (max_locations_viaroute->IsNumber())
|
if (max_locations_viaroute->IsNumber())
|
||||||
engine_config->max_locations_viaroute =
|
engine_config->max_locations_viaroute = Nan::To<int>(max_locations_viaroute).FromJust();
|
||||||
static_cast<int>(max_locations_viaroute->NumberValue());
|
|
||||||
if (max_locations_distance_table->IsNumber())
|
if (max_locations_distance_table->IsNumber())
|
||||||
engine_config->max_locations_distance_table =
|
engine_config->max_locations_distance_table =
|
||||||
static_cast<int>(max_locations_distance_table->NumberValue());
|
Nan::To<int>(max_locations_distance_table).FromJust();
|
||||||
if (max_locations_map_matching->IsNumber())
|
if (max_locations_map_matching->IsNumber())
|
||||||
engine_config->max_locations_map_matching =
|
engine_config->max_locations_map_matching =
|
||||||
static_cast<int>(max_locations_map_matching->NumberValue());
|
Nan::To<int>(max_locations_map_matching).FromJust();
|
||||||
if (max_results_nearest->IsNumber())
|
if (max_results_nearest->IsNumber())
|
||||||
engine_config->max_results_nearest = static_cast<int>(max_results_nearest->NumberValue());
|
engine_config->max_results_nearest = Nan::To<int>(max_results_nearest).FromJust();
|
||||||
if (max_alternatives->IsNumber())
|
if (max_alternatives->IsNumber())
|
||||||
engine_config->max_alternatives = static_cast<int>(max_alternatives->NumberValue());
|
engine_config->max_alternatives = Nan::To<int>(max_alternatives).FromJust();
|
||||||
if (max_radius_map_matching->IsNumber())
|
if (max_radius_map_matching->IsNumber())
|
||||||
engine_config->max_radius_map_matching =
|
engine_config->max_radius_map_matching =
|
||||||
static_cast<double>(max_radius_map_matching->NumberValue());
|
Nan::To<double>(max_radius_map_matching).FromJust();
|
||||||
|
|
||||||
return engine_config;
|
return engine_config;
|
||||||
}
|
}
|
||||||
@ -343,8 +342,8 @@ parseCoordinateArray(const v8::Local<v8::Array> &coordinates_array)
|
|||||||
return resulting_coordinates;
|
return resulting_coordinates;
|
||||||
}
|
}
|
||||||
|
|
||||||
double lon = coordinate_pair->Get(0)->NumberValue();
|
double lon = Nan::To<double>(coordinate_pair->Get(0)).FromJust();
|
||||||
double lat = coordinate_pair->Get(1)->NumberValue();
|
double lat = Nan::To<double>(coordinate_pair->Get(1)).FromJust();
|
||||||
|
|
||||||
if (std::isnan(lon) || std::isnan(lat) || std::isinf(lon) || std::isinf(lat))
|
if (std::isnan(lon) || std::isnan(lat) || std::isinf(lon) || std::isinf(lat))
|
||||||
{
|
{
|
||||||
@ -430,7 +429,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("approaches").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("approaches").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> approaches = obj->Get(Nan::New("approaches").ToLocalChecked());
|
v8::Local<v8::Value> approaches = obj->Get(Nan::New("approaches").ToLocalChecked());
|
||||||
if (approaches.IsEmpty())
|
if (approaches.IsEmpty())
|
||||||
@ -487,7 +486,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("bearings").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("bearings").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> bearings = obj->Get(Nan::New("bearings").ToLocalChecked());
|
v8::Local<v8::Value> bearings = obj->Get(Nan::New("bearings").ToLocalChecked());
|
||||||
if (bearings.IsEmpty())
|
if (bearings.IsEmpty())
|
||||||
@ -528,8 +527,8 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto bearing = static_cast<short>(bearing_pair->Get(0)->NumberValue());
|
const auto bearing = Nan::To<int>(bearing_pair->Get(0)).FromJust();
|
||||||
const auto range = static_cast<short>(bearing_pair->Get(1)->NumberValue());
|
const auto range = Nan::To<int>(bearing_pair->Get(1)).FromJust();
|
||||||
|
|
||||||
if (bearing < 0 || bearing > 360 || range < 0 || range > 180)
|
if (bearing < 0 || bearing > 360 || range < 0 || range > 180)
|
||||||
{
|
{
|
||||||
@ -537,7 +536,8 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
params->bearings.push_back(osrm::Bearing{bearing, range});
|
params->bearings.push_back(
|
||||||
|
osrm::Bearing{static_cast<short>(bearing), static_cast<short>(range)});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -553,7 +553,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("hints").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("hints").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> hints = obj->Get(Nan::New("hints").ToLocalChecked());
|
v8::Local<v8::Value> hints = obj->Get(Nan::New("hints").ToLocalChecked());
|
||||||
if (hints.IsEmpty())
|
if (hints.IsEmpty())
|
||||||
@ -581,14 +581,13 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
|
|
||||||
if (hint->IsString())
|
if (hint->IsString())
|
||||||
{
|
{
|
||||||
if (hint->ToString()->Length() == 0)
|
if (Nan::To<v8::String>(hint).ToLocalChecked()->Length() == 0)
|
||||||
{
|
{
|
||||||
Nan::ThrowError("Hint cannot be an empty string");
|
Nan::ThrowError("Hint cannot be an empty string");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
params->hints.push_back(
|
params->hints.push_back(osrm::engine::Hint::FromBase64(*Nan::Utf8String(hint)));
|
||||||
osrm::engine::Hint::FromBase64(*v8::String::Utf8Value(hint)));
|
|
||||||
}
|
}
|
||||||
else if (hint->IsNull())
|
else if (hint->IsNull())
|
||||||
{
|
{
|
||||||
@ -602,7 +601,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("radiuses").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("radiuses").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> radiuses = obj->Get(Nan::New("radiuses").ToLocalChecked());
|
v8::Local<v8::Value> radiuses = obj->Get(Nan::New("radiuses").ToLocalChecked());
|
||||||
if (radiuses.IsEmpty())
|
if (radiuses.IsEmpty())
|
||||||
@ -632,9 +631,9 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
{
|
{
|
||||||
params->radiuses.emplace_back();
|
params->radiuses.emplace_back();
|
||||||
}
|
}
|
||||||
else if (radius->IsNumber() && radius->NumberValue() >= 0)
|
else if (radius->IsNumber() && Nan::To<double>(radius).FromJust() >= 0)
|
||||||
{
|
{
|
||||||
params->radiuses.push_back(static_cast<double>(radius->NumberValue()));
|
params->radiuses.push_back(Nan::To<double>(radius).FromJust());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -644,7 +643,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("generate_hints").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("generate_hints").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> generate_hints = obj->Get(Nan::New("generate_hints").ToLocalChecked());
|
v8::Local<v8::Value> generate_hints = obj->Get(Nan::New("generate_hints").ToLocalChecked());
|
||||||
if (generate_hints.IsEmpty())
|
if (generate_hints.IsEmpty())
|
||||||
@ -656,10 +655,10 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
params->generate_hints = generate_hints->BooleanValue();
|
params->generate_hints = Nan::To<bool>(generate_hints).FromJust();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("exclude").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("exclude").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> exclude = obj->Get(Nan::New("exclude").ToLocalChecked());
|
v8::Local<v8::Value> exclude = obj->Get(Nan::New("exclude").ToLocalChecked());
|
||||||
if (exclude.IsEmpty())
|
if (exclude.IsEmpty())
|
||||||
@ -681,7 +680,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
|
|
||||||
if (class_name->IsString())
|
if (class_name->IsString())
|
||||||
{
|
{
|
||||||
std::string class_name_str = *v8::String::Utf8Value(class_name);
|
std::string class_name_str = *Nan::Utf8String(class_name);
|
||||||
params->exclude.emplace_back(class_name_str);
|
params->exclude.emplace_back(class_name_str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -698,7 +697,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
|
|||||||
template <typename ParamType>
|
template <typename ParamType>
|
||||||
inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType ¶ms)
|
inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType ¶ms)
|
||||||
{
|
{
|
||||||
if (obj->Has(Nan::New("steps").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("steps").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto steps = obj->Get(Nan::New("steps").ToLocalChecked());
|
auto steps = obj->Get(Nan::New("steps").ToLocalChecked());
|
||||||
if (steps.IsEmpty())
|
if (steps.IsEmpty())
|
||||||
@ -706,7 +705,7 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
|
|||||||
|
|
||||||
if (steps->IsBoolean())
|
if (steps->IsBoolean())
|
||||||
{
|
{
|
||||||
params->steps = steps->BooleanValue();
|
params->steps = Nan::To<bool>(steps).FromJust();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -715,7 +714,7 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("annotations").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("annotations").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto annotations = obj->Get(Nan::New("annotations").ToLocalChecked());
|
auto annotations = obj->Get(Nan::New("annotations").ToLocalChecked());
|
||||||
if (annotations.IsEmpty())
|
if (annotations.IsEmpty())
|
||||||
@ -723,7 +722,7 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
|
|||||||
|
|
||||||
if (annotations->IsBoolean())
|
if (annotations->IsBoolean())
|
||||||
{
|
{
|
||||||
params->annotations = annotations->BooleanValue();
|
params->annotations = Nan::To<bool>(annotations).FromJust();
|
||||||
}
|
}
|
||||||
else if (annotations->IsArray())
|
else if (annotations->IsArray())
|
||||||
{
|
{
|
||||||
@ -778,7 +777,7 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("geometries").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("geometries").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> geometries = obj->Get(Nan::New("geometries").ToLocalChecked());
|
v8::Local<v8::Value> geometries = obj->Get(Nan::New("geometries").ToLocalChecked());
|
||||||
if (geometries.IsEmpty())
|
if (geometries.IsEmpty())
|
||||||
@ -812,7 +811,7 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("overview").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("overview").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> overview = obj->Get(Nan::New("overview").ToLocalChecked());
|
v8::Local<v8::Value> overview = obj->Get(Nan::New("overview").ToLocalChecked());
|
||||||
if (overview.IsEmpty())
|
if (overview.IsEmpty())
|
||||||
@ -857,7 +856,7 @@ argumentsToPluginParameters(const Nan::FunctionCallbackInfo<v8::Value> &args)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
v8::Local<v8::Object> obj = Nan::To<v8::Object>(args[1]).ToLocalChecked();
|
v8::Local<v8::Object> obj = Nan::To<v8::Object>(args[1]).ToLocalChecked();
|
||||||
if (obj->Has(Nan::New("format").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("format").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
|
|
||||||
v8::Local<v8::Value> format = obj->Get(Nan::New("format").ToLocalChecked());
|
v8::Local<v8::Value> format = obj->Get(Nan::New("format").ToLocalChecked());
|
||||||
@ -904,7 +903,7 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
v8::Local<v8::Object> obj = Nan::To<v8::Object>(args[0]).ToLocalChecked();
|
v8::Local<v8::Object> obj = Nan::To<v8::Object>(args[0]).ToLocalChecked();
|
||||||
|
|
||||||
if (obj->Has(Nan::New("continue_straight").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("continue_straight").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto value = obj->Get(Nan::New("continue_straight").ToLocalChecked());
|
auto value = obj->Get(Nan::New("continue_straight").ToLocalChecked());
|
||||||
if (value.IsEmpty())
|
if (value.IsEmpty())
|
||||||
@ -917,11 +916,11 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
if (value->IsBoolean())
|
if (value->IsBoolean())
|
||||||
{
|
{
|
||||||
params->continue_straight = value->BooleanValue();
|
params->continue_straight = Nan::To<bool>(value).FromJust();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("alternatives").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("alternatives").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto value = obj->Get(Nan::New("alternatives").ToLocalChecked());
|
auto value = obj->Get(Nan::New("alternatives").ToLocalChecked());
|
||||||
if (value.IsEmpty())
|
if (value.IsEmpty())
|
||||||
@ -929,13 +928,13 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
if (value->IsBoolean())
|
if (value->IsBoolean())
|
||||||
{
|
{
|
||||||
params->alternatives = value->BooleanValue();
|
params->alternatives = Nan::To<bool>(value).FromJust();
|
||||||
params->number_of_alternatives = value->BooleanValue() ? 1u : 0u;
|
params->number_of_alternatives = Nan::To<bool>(value).FromJust() ? 1u : 0u;
|
||||||
}
|
}
|
||||||
else if (value->IsNumber())
|
else if (value->IsNumber())
|
||||||
{
|
{
|
||||||
params->alternatives = value->BooleanValue();
|
params->alternatives = Nan::To<bool>(value).FromJust();
|
||||||
params->number_of_alternatives = static_cast<unsigned>(value->NumberValue());
|
params->number_of_alternatives = Nan::To<unsigned>(value).FromJust();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -944,7 +943,7 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("waypoints").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("waypoints").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> waypoints = obj->Get(Nan::New("waypoints").ToLocalChecked());
|
v8::Local<v8::Value> waypoints = obj->Get(Nan::New("waypoints").ToLocalChecked());
|
||||||
if (waypoints.IsEmpty())
|
if (waypoints.IsEmpty())
|
||||||
@ -994,7 +993,7 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
Nan::ThrowError("Waypoints must correspond with the index of an input coordinate");
|
Nan::ThrowError("Waypoints must correspond with the index of an input coordinate");
|
||||||
return route_parameters_ptr();
|
return route_parameters_ptr();
|
||||||
}
|
}
|
||||||
params->waypoints.emplace_back(static_cast<unsigned>(waypoint_value->NumberValue()));
|
params->waypoints.emplace_back(Nan::To<unsigned>(waypoint_value).FromJust());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!params->waypoints.empty())
|
if (!params->waypoints.empty())
|
||||||
@ -1010,7 +1009,7 @@ argumentsToRouteParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("snapping").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("snapping").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> snapping = obj->Get(Nan::New("snapping").ToLocalChecked());
|
v8::Local<v8::Value> snapping = obj->Get(Nan::New("snapping").ToLocalChecked());
|
||||||
if (snapping.IsEmpty())
|
if (snapping.IsEmpty())
|
||||||
@ -1095,9 +1094,9 @@ argumentsToTileParameters(const Nan::FunctionCallbackInfo<v8::Value> &args, bool
|
|||||||
return tile_parameters_ptr();
|
return tile_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->x = x->Uint32Value();
|
params->x = Nan::To<uint32_t>(x).FromJust();
|
||||||
params->y = y->Uint32Value();
|
params->y = Nan::To<uint32_t>(y).FromJust();
|
||||||
params->z = z->Uint32Value();
|
params->z = Nan::To<uint32_t>(z).FromJust();
|
||||||
|
|
||||||
if (!params->IsValid())
|
if (!params->IsValid())
|
||||||
{
|
{
|
||||||
@ -1121,7 +1120,7 @@ argumentsToNearestParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
if (obj.IsEmpty())
|
if (obj.IsEmpty())
|
||||||
return nearest_parameters_ptr();
|
return nearest_parameters_ptr();
|
||||||
|
|
||||||
if (obj->Has(Nan::New("number").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("number").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> number = obj->Get(Nan::New("number").ToLocalChecked());
|
v8::Local<v8::Value> number = obj->Get(Nan::New("number").ToLocalChecked());
|
||||||
|
|
||||||
@ -1132,7 +1131,7 @@ argumentsToNearestParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned number_value = static_cast<unsigned>(number->NumberValue());
|
unsigned number_value = Nan::To<unsigned>(number).FromJust();
|
||||||
|
|
||||||
if (number_value < 1)
|
if (number_value < 1)
|
||||||
{
|
{
|
||||||
@ -1140,7 +1139,7 @@ argumentsToNearestParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return nearest_parameters_ptr();
|
return nearest_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->number_of_results = static_cast<unsigned>(number->NumberValue());
|
params->number_of_results = Nan::To<unsigned>(number).FromJust();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1160,7 +1159,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
if (obj.IsEmpty())
|
if (obj.IsEmpty())
|
||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
|
|
||||||
if (obj->Has(Nan::New("sources").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("sources").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> sources = obj->Get(Nan::New("sources").ToLocalChecked());
|
v8::Local<v8::Value> sources = obj->Get(Nan::New("sources").ToLocalChecked());
|
||||||
if (sources.IsEmpty())
|
if (sources.IsEmpty())
|
||||||
@ -1181,7 +1180,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
if (source->IsUint32())
|
if (source->IsUint32())
|
||||||
{
|
{
|
||||||
size_t source_value = static_cast<size_t>(source->NumberValue());
|
size_t source_value = Nan::To<unsigned>(source).FromJust();
|
||||||
if (source_value >= params->coordinates.size())
|
if (source_value >= params->coordinates.size())
|
||||||
{
|
{
|
||||||
Nan::ThrowError(
|
Nan::ThrowError(
|
||||||
@ -1189,7 +1188,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->sources.push_back(static_cast<size_t>(source->NumberValue()));
|
params->sources.push_back(Nan::To<unsigned>(source).FromJust());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1199,7 +1198,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("destinations").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("destinations").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> destinations = obj->Get(Nan::New("destinations").ToLocalChecked());
|
v8::Local<v8::Value> destinations = obj->Get(Nan::New("destinations").ToLocalChecked());
|
||||||
if (destinations.IsEmpty())
|
if (destinations.IsEmpty())
|
||||||
@ -1220,7 +1219,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
if (destination->IsUint32())
|
if (destination->IsUint32())
|
||||||
{
|
{
|
||||||
size_t destination_value = static_cast<size_t>(destination->NumberValue());
|
size_t destination_value = Nan::To<unsigned>(destination).FromJust();
|
||||||
if (destination_value >= params->coordinates.size())
|
if (destination_value >= params->coordinates.size())
|
||||||
{
|
{
|
||||||
Nan::ThrowError("Destination indices must be less than the number "
|
Nan::ThrowError("Destination indices must be less than the number "
|
||||||
@ -1228,7 +1227,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->destinations.push_back(static_cast<size_t>(destination->NumberValue()));
|
params->destinations.push_back(Nan::To<unsigned>(destination).FromJust());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1238,7 +1237,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("annotations").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("annotations").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> annotations = obj->Get(Nan::New("annotations").ToLocalChecked());
|
v8::Local<v8::Value> annotations = obj->Get(Nan::New("annotations").ToLocalChecked());
|
||||||
if (annotations.IsEmpty())
|
if (annotations.IsEmpty())
|
||||||
@ -1278,7 +1277,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("fallback_speed").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("fallback_speed").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto fallback_speed = obj->Get(Nan::New("fallback_speed").ToLocalChecked());
|
auto fallback_speed = obj->Get(Nan::New("fallback_speed").ToLocalChecked());
|
||||||
|
|
||||||
@ -1287,16 +1286,16 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
Nan::ThrowError("fallback_speed must be a number");
|
Nan::ThrowError("fallback_speed must be a number");
|
||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
else if (fallback_speed->NumberValue() <= 0)
|
else if (Nan::To<double>(fallback_speed).FromJust() <= 0)
|
||||||
{
|
{
|
||||||
Nan::ThrowError("fallback_speed must be > 0");
|
Nan::ThrowError("fallback_speed must be > 0");
|
||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->fallback_speed = static_cast<double>(fallback_speed->NumberValue());
|
params->fallback_speed = Nan::To<double>(fallback_speed).FromJust();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("fallback_coordinate").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("fallback_coordinate").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto fallback_coordinate = obj->Get(Nan::New("fallback_coordinate").ToLocalChecked());
|
auto fallback_coordinate = obj->Get(Nan::New("fallback_coordinate").ToLocalChecked());
|
||||||
|
|
||||||
@ -1306,7 +1305,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fallback_coordinate_str = *v8::String::Utf8Value(fallback_coordinate);
|
std::string fallback_coordinate_str = *Nan::Utf8String(fallback_coordinate);
|
||||||
|
|
||||||
if (fallback_coordinate_str == "snapped")
|
if (fallback_coordinate_str == "snapped")
|
||||||
{
|
{
|
||||||
@ -1324,7 +1323,7 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("scale_factor").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("scale_factor").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto scale_factor = obj->Get(Nan::New("scale_factor").ToLocalChecked());
|
auto scale_factor = obj->Get(Nan::New("scale_factor").ToLocalChecked());
|
||||||
|
|
||||||
@ -1333,13 +1332,13 @@ argumentsToTableParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
Nan::ThrowError("scale_factor must be a number");
|
Nan::ThrowError("scale_factor must be a number");
|
||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
else if (scale_factor->NumberValue() <= 0)
|
else if (Nan::To<double>(scale_factor).FromJust() <= 0)
|
||||||
{
|
{
|
||||||
Nan::ThrowError("scale_factor must be > 0");
|
Nan::ThrowError("scale_factor must be > 0");
|
||||||
return table_parameters_ptr();
|
return table_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->scale_factor = static_cast<double>(scale_factor->NumberValue());
|
params->scale_factor = Nan::To<double>(scale_factor).FromJust();
|
||||||
}
|
}
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
@ -1362,7 +1361,7 @@ argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return trip_parameters_ptr();
|
return trip_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("roundtrip").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("roundtrip").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
auto roundtrip = obj->Get(Nan::New("roundtrip").ToLocalChecked());
|
auto roundtrip = obj->Get(Nan::New("roundtrip").ToLocalChecked());
|
||||||
if (roundtrip.IsEmpty())
|
if (roundtrip.IsEmpty())
|
||||||
@ -1370,7 +1369,7 @@ argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
if (roundtrip->IsBoolean())
|
if (roundtrip->IsBoolean())
|
||||||
{
|
{
|
||||||
params->roundtrip = roundtrip->BooleanValue();
|
params->roundtrip = Nan::To<bool>(roundtrip).FromJust();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1379,7 +1378,7 @@ argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("source").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("source").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> source = obj->Get(Nan::New("source").ToLocalChecked());
|
v8::Local<v8::Value> source = obj->Get(Nan::New("source").ToLocalChecked());
|
||||||
if (source.IsEmpty())
|
if (source.IsEmpty())
|
||||||
@ -1391,7 +1390,7 @@ argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return trip_parameters_ptr();
|
return trip_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string source_str = *v8::String::Utf8Value(source);
|
std::string source_str = *Nan::Utf8String(source);
|
||||||
|
|
||||||
if (source_str == "first")
|
if (source_str == "first")
|
||||||
{
|
{
|
||||||
@ -1408,7 +1407,7 @@ argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("destination").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("destination").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> destination = obj->Get(Nan::New("destination").ToLocalChecked());
|
v8::Local<v8::Value> destination = obj->Get(Nan::New("destination").ToLocalChecked());
|
||||||
if (destination.IsEmpty())
|
if (destination.IsEmpty())
|
||||||
@ -1420,7 +1419,7 @@ argumentsToTripParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return trip_parameters_ptr();
|
return trip_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string destination_str = *v8::String::Utf8Value(destination);
|
std::string destination_str = *Nan::Utf8String(destination);
|
||||||
|
|
||||||
if (destination_str == "last")
|
if (destination_str == "last")
|
||||||
{
|
{
|
||||||
@ -1451,7 +1450,7 @@ argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
|
|
||||||
v8::Local<v8::Object> obj = Nan::To<v8::Object>(args[0]).ToLocalChecked();
|
v8::Local<v8::Object> obj = Nan::To<v8::Object>(args[0]).ToLocalChecked();
|
||||||
|
|
||||||
if (obj->Has(Nan::New("timestamps").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("timestamps").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> timestamps = obj->Get(Nan::New("timestamps").ToLocalChecked());
|
v8::Local<v8::Value> timestamps = obj->Get(Nan::New("timestamps").ToLocalChecked());
|
||||||
if (timestamps.IsEmpty())
|
if (timestamps.IsEmpty())
|
||||||
@ -1483,11 +1482,11 @@ argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
Nan::ThrowError("Timestamps array items must be numbers");
|
Nan::ThrowError("Timestamps array items must be numbers");
|
||||||
return match_parameters_ptr();
|
return match_parameters_ptr();
|
||||||
}
|
}
|
||||||
params->timestamps.emplace_back(static_cast<std::size_t>(timestamp->NumberValue()));
|
params->timestamps.emplace_back(Nan::To<unsigned>(timestamp).FromJust());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("gaps").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("gaps").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> gaps = obj->Get(Nan::New("gaps").ToLocalChecked());
|
v8::Local<v8::Value> gaps = obj->Get(Nan::New("gaps").ToLocalChecked());
|
||||||
if (gaps.IsEmpty())
|
if (gaps.IsEmpty())
|
||||||
@ -1517,7 +1516,7 @@ argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("tidy").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("tidy").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> tidy = obj->Get(Nan::New("tidy").ToLocalChecked());
|
v8::Local<v8::Value> tidy = obj->Get(Nan::New("tidy").ToLocalChecked());
|
||||||
if (tidy.IsEmpty())
|
if (tidy.IsEmpty())
|
||||||
@ -1529,10 +1528,10 @@ argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
return match_parameters_ptr();
|
return match_parameters_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
params->tidy = tidy->BooleanValue();
|
params->tidy = Nan::To<bool>(tidy).FromJust();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->Has(Nan::New("waypoints").ToLocalChecked()))
|
if (Nan::Has(obj, Nan::New("waypoints").ToLocalChecked()).FromJust())
|
||||||
{
|
{
|
||||||
v8::Local<v8::Value> waypoints = obj->Get(Nan::New("waypoints").ToLocalChecked());
|
v8::Local<v8::Value> waypoints = obj->Get(Nan::New("waypoints").ToLocalChecked());
|
||||||
if (waypoints.IsEmpty())
|
if (waypoints.IsEmpty())
|
||||||
@ -1582,7 +1581,8 @@ argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
|
|||||||
Nan::ThrowError("Waypoints must correspond with the index of an input coordinate");
|
Nan::ThrowError("Waypoints must correspond with the index of an input coordinate");
|
||||||
return match_parameters_ptr();
|
return match_parameters_ptr();
|
||||||
}
|
}
|
||||||
params->waypoints.emplace_back(static_cast<unsigned>(waypoint_value->NumberValue()));
|
params->waypoints.emplace_back(
|
||||||
|
static_cast<unsigned>(Nan::To<unsigned>(waypoint_value).FromJust()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,6 @@ class RequestParser
|
|||||||
header_line_start,
|
header_line_start,
|
||||||
header_lws,
|
header_lws,
|
||||||
header_name,
|
header_name,
|
||||||
space_before_header_value,
|
|
||||||
header_value,
|
header_value,
|
||||||
expecting_newline_2,
|
expecting_newline_2,
|
||||||
expecting_newline_3
|
expecting_newline_3
|
||||||
|
|||||||
35
include/storage/io.hpp
Normal file → Executable file
35
include/storage/io.hpp
Normal file → Executable file
@ -10,6 +10,7 @@
|
|||||||
#include "util/log.hpp"
|
#include "util/log.hpp"
|
||||||
#include "util/version.hpp"
|
#include "util/version.hpp"
|
||||||
|
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
#include <boost/iostreams/device/array.hpp>
|
#include <boost/iostreams/device/array.hpp>
|
||||||
#include <boost/iostreams/seek.hpp>
|
#include <boost/iostreams/seek.hpp>
|
||||||
@ -60,29 +61,27 @@ class FileReader
|
|||||||
|
|
||||||
std::size_t GetSize()
|
std::size_t GetSize()
|
||||||
{
|
{
|
||||||
const boost::filesystem::ifstream::pos_type position = input_stream.tellg();
|
const boost::filesystem::path path(filepath);
|
||||||
input_stream.seekg(0, std::ios::end);
|
try
|
||||||
const boost::filesystem::ifstream::pos_type file_size = input_stream.tellg();
|
|
||||||
|
|
||||||
if (file_size == boost::filesystem::ifstream::pos_type(-1))
|
|
||||||
{
|
{
|
||||||
throw util::RuntimeError("Unable to determine file size for " +
|
return std::size_t(boost::filesystem::file_size(path)) -
|
||||||
std::string(filepath.string()),
|
((fingerprint == FingerprintFlag::VerifyFingerprint) ? sizeof(util::FingerPrint)
|
||||||
ErrorCode::FileIOError,
|
: 0);
|
||||||
SOURCE_REF,
|
}
|
||||||
std::strerror(errno));
|
catch (const boost::filesystem::filesystem_error &ex)
|
||||||
|
{
|
||||||
|
std::cout << ex.what() << std::endl;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore the current position
|
/* Read one line */
|
||||||
input_stream.seekg(position, std::ios::beg);
|
template <typename T> void ReadLine(T *dest, const std::size_t count)
|
||||||
|
|
||||||
if (fingerprint == FingerprintFlag::VerifyFingerprint)
|
|
||||||
{
|
{
|
||||||
return std::size_t(file_size) - sizeof(util::FingerPrint);
|
if (0 < count)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return file_size;
|
memset(dest, 0, count * sizeof(T));
|
||||||
|
input_stream.getline(reinterpret_cast<char *>(dest), count * sizeof(T));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,6 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#if USE_STXXL_LIBRARY
|
|
||||||
#include <stxxl/vector>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace storage
|
namespace storage
|
||||||
@ -134,24 +130,6 @@ inline void write(storage::tar::FileWriter &writer,
|
|||||||
writer.WriteStreaming<T>(name, vec.begin(), vec.size());
|
writer.WriteStreaming<T>(name, vec.begin(), vec.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_STXXL_LIBRARY
|
|
||||||
template <typename T>
|
|
||||||
inline void read(storage::tar::FileReader &reader, const std::string &name, stxxl::vector<T> &vec)
|
|
||||||
{
|
|
||||||
auto size = reader.ReadElementCount64(name);
|
|
||||||
vec.reserve(size);
|
|
||||||
reader.ReadStreaming<T>(name, std::back_inserter(vec), size);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
inline void
|
|
||||||
write(storage::tar::FileWriter &writer, const std::string &name, const stxxl::vector<T> &vec)
|
|
||||||
{
|
|
||||||
writer.WriteElementCount64(name, vec.size());
|
|
||||||
writer.WriteStreaming<T>(name, vec.begin(), vec.size());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T> void read(io::BufferReader &reader, std::vector<T> &data)
|
template <typename T> void read(io::BufferReader &reader, std::vector<T> &data)
|
||||||
{
|
{
|
||||||
const auto count = reader.ReadElementCount64();
|
const auto count = reader.ReadElementCount64();
|
||||||
|
|||||||
@ -7,29 +7,11 @@
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_STXXL_LIBRARY
|
|
||||||
#include <stxxl/mng>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace util
|
namespace util
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void DumpSTXXLStats()
|
|
||||||
{
|
|
||||||
#if USE_STXXL_LIBRARY
|
|
||||||
#if STXXL_VERSION_MAJOR > 1 || (STXXL_VERSION_MAJOR == 1 && STXXL_VERSION_MINOR >= 4)
|
|
||||||
auto manager = stxxl::block_manager::get_instance();
|
|
||||||
util::Log() << "STXXL: peak bytes used: " << manager->get_maximum_allocation();
|
|
||||||
util::Log() << "STXXL: total disk allocated: " << manager->get_total_bytes();
|
|
||||||
#else
|
|
||||||
#warning STXXL 1.4+ recommended - STXXL memory summary will not be available
|
|
||||||
util::Log() << "STXXL: memory summary not available, needs STXXL 1.4 or higher";
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DumpMemoryStats()
|
inline void DumpMemoryStats()
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|||||||
@ -19,10 +19,6 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if USE_STXXL_LIBRARY
|
|
||||||
#include <stxxl/vector>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
namespace util
|
namespace util
|
||||||
@ -253,16 +249,10 @@ template <typename DataT> void swap(vector_view<DataT> &lhs, vector_view<DataT>
|
|||||||
std::swap(lhs.m_size, rhs.m_size);
|
std::swap(lhs.m_size, rhs.m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_STXXL_LIBRARY
|
|
||||||
template <typename T> using ExternalVector = stxxl::vector<T>;
|
|
||||||
#else
|
|
||||||
template <typename T> using ExternalVector = std::vector<T>;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename DataT, storage::Ownership Ownership>
|
template <typename DataT, storage::Ownership Ownership>
|
||||||
using InternalOrExternalVector =
|
using InternalOrExternalVector =
|
||||||
typename std::conditional<Ownership == storage::Ownership::External,
|
typename std::conditional<Ownership == storage::Ownership::External,
|
||||||
ExternalVector<DataT>,
|
std::vector<DataT>,
|
||||||
std::vector<DataT>>::type;
|
std::vector<DataT>>::type;
|
||||||
|
|
||||||
template <typename DataT, storage::Ownership Ownership>
|
template <typename DataT, storage::Ownership Ownership>
|
||||||
|
|||||||
10
package-lock.json
generated
10
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "osrm",
|
"name": "osrm",
|
||||||
"version": "5.20.0-latest.1",
|
"version": "5.22.0-customsnapping.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1740,6 +1740,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
|
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
|
||||||
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
|
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"inherits": "~2.0.0"
|
"inherits": "~2.0.0"
|
||||||
}
|
}
|
||||||
@ -5567,6 +5568,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
|
||||||
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
|
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"graceful-fs": "^4.1.2",
|
"graceful-fs": "^4.1.2",
|
||||||
"inherits": "~2.0.0",
|
"inherits": "~2.0.0",
|
||||||
@ -7646,9 +7648,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"nan": {
|
"nan": {
|
||||||
"version": "2.11.1",
|
"version": "2.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz",
|
||||||
"integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA=="
|
"integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw=="
|
||||||
},
|
},
|
||||||
"natural-compare": {
|
"natural-compare": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"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": {
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"nan": "^2.11.1",
|
"nan": "^2.14.1",
|
||||||
"node-cmake": "^2.3.2",
|
"node-cmake": "^2.3.2",
|
||||||
"node-pre-gyp": "^0.12.0",
|
"node-pre-gyp": "^0.12.0",
|
||||||
"rimraf": "^2.5.4"
|
"rimraf": "^2.5.4"
|
||||||
|
|||||||
@ -56,7 +56,13 @@ function setup()
|
|||||||
'private',
|
'private',
|
||||||
'agricultural',
|
'agricultural',
|
||||||
'forestry',
|
'forestry',
|
||||||
'delivery'
|
'delivery',
|
||||||
|
-- When a way is tagged with `use_sidepath` a parallel way suitable for
|
||||||
|
-- cyclists is mapped and must be used instead (by law). This tag is
|
||||||
|
-- used on ways that normally may be used by cyclists, but not when
|
||||||
|
-- a signposted parallel cycleway is available. For purposes of routing
|
||||||
|
-- cyclists, this value should be treated as 'no access for bicycles'.
|
||||||
|
'use_sidepath'
|
||||||
},
|
},
|
||||||
|
|
||||||
restricted_access_tag_list = Set { },
|
restricted_access_tag_list = Set { },
|
||||||
|
|||||||
@ -38,7 +38,7 @@ local way = {
|
|||||||
local result = {}
|
local result = {}
|
||||||
|
|
||||||
-- call the way function
|
-- call the way function
|
||||||
Debug.way_function(way,result)
|
Debug.process_way(way,result)
|
||||||
|
|
||||||
-- print input and output
|
-- print input and output
|
||||||
pprint(way)
|
pprint(way)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ local pprint = require('lib/pprint')
|
|||||||
|
|
||||||
-- globals that are normally set from C++
|
-- globals that are normally set from C++
|
||||||
|
|
||||||
-- should match values defined in include/extractor/guidance/road_classification.hpp
|
-- should match values defined in include/extractor/road_classification.hpp
|
||||||
road_priority_class = {
|
road_priority_class = {
|
||||||
motorway = 0,
|
motorway = 0,
|
||||||
trunk = 2,
|
trunk = 2,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ local pprint = require('lib/pprint')
|
|||||||
-- profiles code modifies this table
|
-- profiles code modifies this table
|
||||||
properties = {}
|
properties = {}
|
||||||
|
|
||||||
-- should match values defined in include/extractor/guidance/road_classification.hpp
|
-- should match values defined in include/extractor/road_classification.hpp
|
||||||
road_priority_class = {
|
road_priority_class = {
|
||||||
motorway = 0,
|
motorway = 0,
|
||||||
trunk = 2,
|
trunk = 2,
|
||||||
|
|||||||
@ -18,11 +18,3 @@ sudo apt-get update -qq --yes || true
|
|||||||
|
|
||||||
sudo apt-get install -qq --yes --force-yes g++-4.8-arm-linux-gnueabihf g++-4.8-multilib-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf gcc-4.8-multilib-arm-linux-gnueabihf
|
sudo apt-get install -qq --yes --force-yes g++-4.8-arm-linux-gnueabihf g++-4.8-multilib-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf gcc-4.8-multilib-arm-linux-gnueabihf
|
||||||
sudo apt-get install -qq --yes --force-yes libexpat1-dev:armhf zlib1g-dev:armhf libbz2-dev:armhf libboost-date-time-dev:armhf libboost-filesystem-dev:armhf libboost-iostreams-dev:armhf libboost-program-options-dev:armhf libboost-regex-dev:armhf libboost-system-dev:armhf libboost-thread-dev:armhf libtbb-dev:armhf libboost-test-dev:armhf
|
sudo apt-get install -qq --yes --force-yes libexpat1-dev:armhf zlib1g-dev:armhf libbz2-dev:armhf libboost-date-time-dev:armhf libboost-filesystem-dev:armhf libboost-iostreams-dev:armhf libboost-program-options-dev:armhf libboost-regex-dev:armhf libboost-system-dev:armhf libboost-thread-dev:armhf libtbb-dev:armhf libboost-test-dev:armhf
|
||||||
|
|
||||||
## build libstxxl1v5:armhf from sources, no package in trusty
|
|
||||||
if [ $UBUNTU_RELEASE == trusty ] ; then
|
|
||||||
( cd /tmp && wget http://sourceforge.net/projects/stxxl/files/stxxl/1.4.1/stxxl-1.4.1.tar.gz && tar xf stxxl-1.4.1.tar.gz )
|
|
||||||
( cd /tmp/stxxl-1.4.1 && mkdir build && cd build && CC=arm-linux-gnueabihf-gcc-4.8 CXX=arm-linux-gnueabihf-g++-4.8 cmake .. && make && sudo make install )
|
|
||||||
else
|
|
||||||
sudo apt-get install -qq --yes --force-yes libstxxl1v5:armhf
|
|
||||||
fi
|
|
||||||
|
|||||||
@ -3,4 +3,4 @@
|
|||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test && ( sudo apt-get update -qq --yes || true )
|
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test && ( sudo apt-get update -qq --yes || true )
|
||||||
|
|
||||||
sudo apt-get install -qq --yes --force-yes g++-7-multilib libxml2-dev:i386 libexpat1-dev:i386 libzip-dev:i386 libbz2-dev:i386 libstxxl-dev:i386 libtbb-dev:i386 lua5.2:i386 liblua5.2-dev:i386 libboost-date-time-dev:i386 libboost-filesystem-dev:i386 libboost-iostreams-dev:i386 libboost-program-options-dev:i386 libboost-regex-dev:i386 libboost-system-dev:i386 libboost-thread-dev:i386 libboost-test-dev:i386
|
sudo apt-get install -qq --yes --force-yes g++-7-multilib libxml2-dev:i386 libexpat1-dev:i386 libzip-dev:i386 libbz2-dev:i386 libtbb-dev:i386 lua5.2:i386 liblua5.2-dev:i386 libboost-date-time-dev:i386 libboost-filesystem-dev:i386 libboost-iostreams-dev:i386 libboost-program-options-dev:i386 libboost-regex-dev:i386 libboost-system-dev:i386 libboost-thread-dev:i386 libboost-test-dev:i386
|
||||||
|
|||||||
@ -51,8 +51,8 @@ struct Parameters
|
|||||||
// Alternative paths are still reasonable around the via node candidate (local optimality).
|
// Alternative paths are still reasonable around the via node candidate (local optimality).
|
||||||
// At least optimal around 10% sub-paths around the via node candidate.
|
// At least optimal around 10% sub-paths around the via node candidate.
|
||||||
double kAtLeastOptimalAroundViaBy = 0.1;
|
double kAtLeastOptimalAroundViaBy = 0.1;
|
||||||
// Alternative paths similarity requirement (sharing) based on calles.
|
// Alternative paths similarity requirement (sharing) based on cells.
|
||||||
// At least 15% different than the shortest path.
|
// At least 5% different than the shortest path.
|
||||||
double kCellsAtMostSameBy = 0.95;
|
double kCellsAtMostSameBy = 0.95;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -206,12 +206,7 @@ void GraphCompressor::Compress(
|
|||||||
graph.GetEdgeData(reverse_e2).annotation_data = selectAnnotation(
|
graph.GetEdgeData(reverse_e2).annotation_data = selectAnnotation(
|
||||||
rev_edge_data2.annotation_data, rev_edge_data1.annotation_data);
|
rev_edge_data2.annotation_data, rev_edge_data1.annotation_data);
|
||||||
|
|
||||||
/*
|
// Add node penalty when compress edge crosses a traffic signal
|
||||||
// Do not compress edge if it crosses a traffic signal.
|
|
||||||
// This can't be done in CanCombineWith, becase we only store the
|
|
||||||
// traffic signals in the `traffic signal` list, which EdgeData
|
|
||||||
// doesn't have access to.
|
|
||||||
*/
|
|
||||||
const bool has_node_penalty = traffic_signals.find(node_v) != traffic_signals.end();
|
const bool has_node_penalty = traffic_signals.find(node_v) != traffic_signals.end();
|
||||||
EdgeDuration node_duration_penalty = MAXIMAL_EDGE_DURATION;
|
EdgeDuration node_duration_penalty = MAXIMAL_EDGE_DURATION;
|
||||||
EdgeWeight node_weight_penalty = INVALID_EDGE_WEIGHT;
|
EdgeWeight node_weight_penalty = INVALID_EDGE_WEIGHT;
|
||||||
|
|||||||
@ -92,15 +92,15 @@ int RasterContainer::LoadRasterSource(const std::string &path_string,
|
|||||||
const auto _ymin = static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{ymin}));
|
const auto _ymin = static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{ymin}));
|
||||||
const auto _ymax = static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{ymax}));
|
const auto _ymax = static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{ymax}));
|
||||||
|
|
||||||
const auto itr = LoadedSourcePaths.find(path_string);
|
const auto itr = RasterCache::getInstance().getLoadedSourcePaths().find(path_string);
|
||||||
if (itr != LoadedSourcePaths.end())
|
if (itr != RasterCache::getInstance().getLoadedSourcePaths().end())
|
||||||
{
|
{
|
||||||
util::Log() << "[source loader] Already loaded source '" << path_string << "' at source_id "
|
util::Log() << "[source loader] Already loaded source '" << path_string << "' at source_id "
|
||||||
<< itr->second;
|
<< itr->second;
|
||||||
return itr->second;
|
return itr->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
int source_id = static_cast<int>(LoadedSources.size());
|
int source_id = static_cast<int>(RasterCache::getInstance().getLoadedSources().size());
|
||||||
|
|
||||||
util::Log() << "[source loader] Loading from " << path_string << " ... ";
|
util::Log() << "[source loader] Loading from " << path_string << " ... ";
|
||||||
TIMER_START(loading_source);
|
TIMER_START(loading_source);
|
||||||
@ -116,8 +116,8 @@ int RasterContainer::LoadRasterSource(const std::string &path_string,
|
|||||||
|
|
||||||
RasterSource source{std::move(rasterData), ncols, nrows, _xmin, _xmax, _ymin, _ymax};
|
RasterSource source{std::move(rasterData), ncols, nrows, _xmin, _xmax, _ymin, _ymax};
|
||||||
TIMER_STOP(loading_source);
|
TIMER_STOP(loading_source);
|
||||||
LoadedSourcePaths.emplace(path_string, source_id);
|
RasterCache::getInstance().getLoadedSourcePaths().emplace(path_string, source_id);
|
||||||
LoadedSources.push_back(std::move(source));
|
RasterCache::getInstance().getLoadedSources().push_back(std::move(source));
|
||||||
|
|
||||||
util::Log() << "[source loader] ok, after " << TIMER_SEC(loading_source) << "s";
|
util::Log() << "[source loader] ok, after " << TIMER_SEC(loading_source) << "s";
|
||||||
|
|
||||||
@ -127,10 +127,11 @@ int RasterContainer::LoadRasterSource(const std::string &path_string,
|
|||||||
// External function for looking up nearest data point from a specified source
|
// External function for looking up nearest data point from a specified source
|
||||||
RasterDatum RasterContainer::GetRasterDataFromSource(unsigned int source_id, double lon, double lat)
|
RasterDatum RasterContainer::GetRasterDataFromSource(unsigned int source_id, double lon, double lat)
|
||||||
{
|
{
|
||||||
if (LoadedSources.size() < source_id + 1)
|
if (RasterCache::getInstance().getLoadedSources().size() < source_id + 1)
|
||||||
{
|
{
|
||||||
throw util::exception("Attempted to access source " + std::to_string(source_id) +
|
throw util::exception("Attempted to access source " + std::to_string(source_id) +
|
||||||
", but there are only " + std::to_string(LoadedSources.size()) +
|
", but there are only " +
|
||||||
|
std::to_string(RasterCache::getInstance().getLoadedSources().size()) +
|
||||||
" loaded" + SOURCE_REF);
|
" loaded" + SOURCE_REF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +140,7 @@ RasterDatum RasterContainer::GetRasterDataFromSource(unsigned int source_id, dou
|
|||||||
BOOST_ASSERT(lon < 180);
|
BOOST_ASSERT(lon < 180);
|
||||||
BOOST_ASSERT(lon > -180);
|
BOOST_ASSERT(lon > -180);
|
||||||
|
|
||||||
const auto &found = LoadedSources[source_id];
|
const auto &found = RasterCache::getInstance().getLoadedSources()[source_id];
|
||||||
return found.GetRasterData(static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})),
|
return found.GetRasterData(static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})),
|
||||||
static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat})));
|
static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat})));
|
||||||
}
|
}
|
||||||
@ -148,10 +149,11 @@ RasterDatum RasterContainer::GetRasterDataFromSource(unsigned int source_id, dou
|
|||||||
RasterDatum
|
RasterDatum
|
||||||
RasterContainer::GetRasterInterpolateFromSource(unsigned int source_id, double lon, double lat)
|
RasterContainer::GetRasterInterpolateFromSource(unsigned int source_id, double lon, double lat)
|
||||||
{
|
{
|
||||||
if (LoadedSources.size() < source_id + 1)
|
if (RasterCache::getInstance().getLoadedSources().size() < source_id + 1)
|
||||||
{
|
{
|
||||||
throw util::exception("Attempted to access source " + std::to_string(source_id) +
|
throw util::exception("Attempted to access source " + std::to_string(source_id) +
|
||||||
", but there are only " + std::to_string(LoadedSources.size()) +
|
", but there are only " +
|
||||||
|
std::to_string(RasterCache::getInstance().getLoadedSources().size()) +
|
||||||
" loaded" + SOURCE_REF);
|
" loaded" + SOURCE_REF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,10 +162,12 @@ RasterContainer::GetRasterInterpolateFromSource(unsigned int source_id, double l
|
|||||||
BOOST_ASSERT(lon < 180);
|
BOOST_ASSERT(lon < 180);
|
||||||
BOOST_ASSERT(lon > -180);
|
BOOST_ASSERT(lon > -180);
|
||||||
|
|
||||||
const auto &found = LoadedSources[source_id];
|
const auto &found = RasterCache::getInstance().getLoadedSources()[source_id];
|
||||||
return found.GetRasterInterpolate(
|
return found.GetRasterInterpolate(
|
||||||
static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})),
|
static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})),
|
||||||
static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat})));
|
static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat})));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RasterCache *RasterCache::g_instance = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -217,7 +217,7 @@ RequestParser::RequestStatus RequestParser::consume(http::request ¤t_reque
|
|||||||
case internal_state::header_name:
|
case internal_state::header_name:
|
||||||
if (input == ':')
|
if (input == ':')
|
||||||
{
|
{
|
||||||
state = internal_state::space_before_header_value;
|
state = internal_state::header_value;
|
||||||
return RequestStatus::indeterminate;
|
return RequestStatus::indeterminate;
|
||||||
}
|
}
|
||||||
if (!is_char(input) || is_CTL(input) || is_special(input))
|
if (!is_char(input) || is_CTL(input) || is_special(input))
|
||||||
@ -226,14 +226,12 @@ RequestParser::RequestStatus RequestParser::consume(http::request ¤t_reque
|
|||||||
}
|
}
|
||||||
current_header.name.push_back(input);
|
current_header.name.push_back(input);
|
||||||
return RequestStatus::indeterminate;
|
return RequestStatus::indeterminate;
|
||||||
case internal_state::space_before_header_value:
|
case internal_state::header_value:
|
||||||
if (input == ' ')
|
if (input == ' ')
|
||||||
{
|
{
|
||||||
state = internal_state::header_value;
|
state = internal_state::header_value;
|
||||||
return RequestStatus::indeterminate;
|
return RequestStatus::indeterminate;
|
||||||
}
|
}
|
||||||
return RequestStatus::invalid;
|
|
||||||
case internal_state::header_value:
|
|
||||||
if (input == '\r')
|
if (input == '\r')
|
||||||
{
|
{
|
||||||
state = internal_state::expecting_newline_2;
|
state = internal_state::expecting_newline_2;
|
||||||
|
|||||||
@ -189,21 +189,18 @@ int main(int argc, char *argv[]) try
|
|||||||
|
|
||||||
osrm::contract(contractor_config);
|
osrm::contract(contractor_config);
|
||||||
|
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
catch (const osrm::RuntimeError &e)
|
catch (const osrm::RuntimeError &e)
|
||||||
{
|
{
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
util::Log(logERROR) << e.what();
|
util::Log(logERROR) << e.what();
|
||||||
return e.GetCode();
|
return e.GetCode();
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc &e)
|
catch (const std::bad_alloc &e)
|
||||||
{
|
{
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
util::Log(logERROR) << e.what();
|
util::Log(logERROR) << e.what();
|
||||||
util::Log(logERROR) << "Please provide more memory or consider using a larger swapfile";
|
util::Log(logERROR) << "Please provide more memory or consider using a larger swapfile";
|
||||||
|
|||||||
@ -186,28 +186,24 @@ int main(int argc, char *argv[]) try
|
|||||||
|
|
||||||
osrm::extract(extractor_config);
|
osrm::extract(extractor_config);
|
||||||
|
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
catch (const osrm::RuntimeError &e)
|
catch (const osrm::RuntimeError &e)
|
||||||
{
|
{
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
util::Log(logERROR) << e.what();
|
util::Log(logERROR) << e.what();
|
||||||
return e.GetCode();
|
return e.GetCode();
|
||||||
}
|
}
|
||||||
catch (const std::system_error &e)
|
catch (const std::system_error &e)
|
||||||
{
|
{
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
util::Log(logERROR) << e.what();
|
util::Log(logERROR) << e.what();
|
||||||
return e.code().value();
|
return e.code().value();
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc &e)
|
catch (const std::bad_alloc &e)
|
||||||
{
|
{
|
||||||
util::DumpSTXXLStats();
|
|
||||||
util::DumpMemoryStats();
|
util::DumpMemoryStats();
|
||||||
util::Log(logERROR) << "[exception] " << e.what();
|
util::Log(logERROR) << "[exception] " << e.what();
|
||||||
util::Log(logERROR) << "Please provide more memory or consider using a larger swapfile";
|
util::Log(logERROR) << "Please provide more memory or consider using a larger swapfile";
|
||||||
|
|||||||
@ -16,7 +16,7 @@ namespace
|
|||||||
static const char COL_RESET[]{"\x1b[0m"};
|
static const char COL_RESET[]{"\x1b[0m"};
|
||||||
static const char RED[]{"\x1b[31m"};
|
static const char RED[]{"\x1b[31m"};
|
||||||
static const char YELLOW[]{"\x1b[33m"};
|
static const char YELLOW[]{"\x1b[33m"};
|
||||||
#ifndef NDEBUG
|
#ifdef ENABLE_DEBUG_LOGGING
|
||||||
static const char MAGENTA[]{"\x1b[35m"};
|
static const char MAGENTA[]{"\x1b[35m"};
|
||||||
#endif
|
#endif
|
||||||
// static const char GREEN[] { "\x1b[32m"};
|
// static const char GREEN[] { "\x1b[32m"};
|
||||||
@ -80,7 +80,7 @@ Log::Log(LogLevel level_, std::ostream &ostream) : level(level_), stream(ostream
|
|||||||
stream << (is_terminal ? RED : "") << "[error] ";
|
stream << (is_terminal ? RED : "") << "[error] ";
|
||||||
break;
|
break;
|
||||||
case logDEBUG:
|
case logDEBUG:
|
||||||
#ifndef NDEBUG
|
#ifdef ENABLE_DEBUG_LOGGING
|
||||||
stream << (is_terminal ? MAGENTA : "") << "[debug] ";
|
stream << (is_terminal ? MAGENTA : "") << "[debug] ";
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -126,7 +126,7 @@ Log::~Log()
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
break;
|
break;
|
||||||
case logDEBUG:
|
case logDEBUG:
|
||||||
#ifdef NDEBUG
|
#ifndef ENABLE_DEBUG_LOGGING
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case logINFO:
|
case logINFO:
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
disk=###.stxxl,20,memory
|
|
||||||
@ -1 +0,0 @@
|
|||||||
disk=/tmp/stxxl_###,200M,syscall autogrow
|
|
||||||
@ -1,6 +1,4 @@
|
|||||||
DATA_NAME:=monaco
|
DATA_NAME:=monaco
|
||||||
DATA_URL:=https://s3.amazonaws.com/mapbox/osrm/testing/$(DATA_NAME).osm.pbf
|
|
||||||
DATA_POLY_URL:=https://s3.amazonaws.com/mapbox/osrm/testing/$(DATA_NAME).poly
|
|
||||||
OSRM_BUILD_DIR?=../../build
|
OSRM_BUILD_DIR?=../../build
|
||||||
PROFILE_ROOT:=../../profiles
|
PROFILE_ROOT:=../../profiles
|
||||||
SCRIPT_ROOT:=../../scripts
|
SCRIPT_ROOT:=../../scripts
|
||||||
@ -22,12 +20,6 @@ clean:
|
|||||||
-rm -r $(DATA_NAME).*
|
-rm -r $(DATA_NAME).*
|
||||||
-rm -r ch corech mld
|
-rm -r ch corech mld
|
||||||
|
|
||||||
$(DATA_NAME).osm.pbf:
|
|
||||||
wget $(DATA_URL) -O $(DATA_NAME).osm.pbf
|
|
||||||
|
|
||||||
$(DATA_NAME).poly:
|
|
||||||
wget $(DATA_POLY_URL) -O $(DATA_NAME).poly
|
|
||||||
|
|
||||||
ch/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
ch/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
||||||
mkdir -p ch
|
mkdir -p ch
|
||||||
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* ch/
|
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* ch/
|
||||||
|
|||||||
BIN
test/data/monaco.osm.pbf
Normal file
BIN
test/data/monaco.osm.pbf
Normal file
Binary file not shown.
31
test/data/monaco.poly
Normal file
31
test/data/monaco.poly
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
none
|
||||||
|
1
|
||||||
|
7.448637E+00 4.373992E+01
|
||||||
|
7.420651E+00 4.372335E+01
|
||||||
|
7.409205E+00 4.372933E+01
|
||||||
|
7.410161E+00 4.373072E+01
|
||||||
|
7.411732E+00 4.373139E+01
|
||||||
|
7.413011E+00 4.373162E+01
|
||||||
|
7.412909E+00 4.373379E+01
|
||||||
|
7.412364E+00 4.373429E+01
|
||||||
|
7.415174E+00 4.373618E+01
|
||||||
|
7.421612E+00 4.374033E+01
|
||||||
|
7.421557E+00 4.374080E+01
|
||||||
|
7.423117E+00 4.374135E+01
|
||||||
|
7.424507E+00 4.374069E+01
|
||||||
|
7.426007E+00 4.374226E+01
|
||||||
|
7.427535E+00 4.374369E+01
|
||||||
|
7.428709E+00 4.374590E+01
|
||||||
|
7.430755E+00 4.374885E+01
|
||||||
|
7.431923E+00 4.374856E+01
|
||||||
|
7.433675E+00 4.374952E+01
|
||||||
|
7.435904E+00 4.374979E+01
|
||||||
|
7.437361E+00 4.375083E+01
|
||||||
|
7.436782E+00 4.375149E+01
|
||||||
|
7.437709E+00 4.375169E+01
|
||||||
|
7.438827E+00 4.375133E+01
|
||||||
|
7.438466E+00 4.374899E+01
|
||||||
|
7.441831E+00 4.374505E+01
|
||||||
|
7.448637E+00 4.373992E+01
|
||||||
|
END
|
||||||
|
END
|
||||||
17
third_party/sol2/sol2/sol.hpp
vendored
17
third_party/sol2/sol2/sol.hpp
vendored
@ -3399,7 +3399,9 @@ namespace sol {
|
|||||||
runtime = LUA_ERRRUN,
|
runtime = LUA_ERRRUN,
|
||||||
memory = LUA_ERRMEM,
|
memory = LUA_ERRMEM,
|
||||||
handler = LUA_ERRERR,
|
handler = LUA_ERRERR,
|
||||||
|
#if SOL_LUA_VERSION < 504
|
||||||
gc = LUA_ERRGCMM,
|
gc = LUA_ERRGCMM,
|
||||||
|
#endif
|
||||||
syntax = LUA_ERRSYNTAX,
|
syntax = LUA_ERRSYNTAX,
|
||||||
file = LUA_ERRFILE,
|
file = LUA_ERRFILE,
|
||||||
};
|
};
|
||||||
@ -3409,7 +3411,9 @@ namespace sol {
|
|||||||
yielded = LUA_YIELD,
|
yielded = LUA_YIELD,
|
||||||
runtime = LUA_ERRRUN,
|
runtime = LUA_ERRRUN,
|
||||||
memory = LUA_ERRMEM,
|
memory = LUA_ERRMEM,
|
||||||
|
#if SOL_LUA_VERSION < 504
|
||||||
gc = LUA_ERRGCMM,
|
gc = LUA_ERRGCMM,
|
||||||
|
#endif
|
||||||
handler = LUA_ERRERR,
|
handler = LUA_ERRERR,
|
||||||
dead = -1,
|
dead = -1,
|
||||||
};
|
};
|
||||||
@ -3418,7 +3422,9 @@ namespace sol {
|
|||||||
ok = LUA_OK,
|
ok = LUA_OK,
|
||||||
syntax = LUA_ERRSYNTAX,
|
syntax = LUA_ERRSYNTAX,
|
||||||
memory = LUA_ERRMEM,
|
memory = LUA_ERRMEM,
|
||||||
|
#if SOL_LUA_VERSION < 504
|
||||||
gc = LUA_ERRGCMM,
|
gc = LUA_ERRGCMM,
|
||||||
|
#endif
|
||||||
file = LUA_ERRFILE,
|
file = LUA_ERRFILE,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3462,8 +3468,10 @@ namespace sol {
|
|||||||
return names[3];
|
return names[3];
|
||||||
case call_status::handler:
|
case call_status::handler:
|
||||||
return names[4];
|
return names[4];
|
||||||
|
#if SOL_LUA_VERSION < 504
|
||||||
case call_status::gc:
|
case call_status::gc:
|
||||||
return names[5];
|
return names[5];
|
||||||
|
#endif
|
||||||
case call_status::syntax:
|
case call_status::syntax:
|
||||||
return names[6];
|
return names[6];
|
||||||
case call_status::file:
|
case call_status::file:
|
||||||
@ -3485,8 +3493,10 @@ namespace sol {
|
|||||||
return names[0];
|
return names[0];
|
||||||
case load_status::memory:
|
case load_status::memory:
|
||||||
return names[1];
|
return names[1];
|
||||||
|
#if SOL_LUA_VERSION < 504
|
||||||
case load_status::gc:
|
case load_status::gc:
|
||||||
return names[2];
|
return names[2];
|
||||||
|
#endif
|
||||||
case load_status::syntax:
|
case load_status::syntax:
|
||||||
return names[3];
|
return names[3];
|
||||||
case load_status::file:
|
case load_status::file:
|
||||||
@ -14374,9 +14384,12 @@ namespace sol {
|
|||||||
void luacall(std::ptrdiff_t argcount, std::ptrdiff_t) {
|
void luacall(std::ptrdiff_t argcount, std::ptrdiff_t) {
|
||||||
#if SOL_LUA_VERSION < 502
|
#if SOL_LUA_VERSION < 502
|
||||||
stats = static_cast<call_status>(lua_resume(lua_state(), static_cast<int>(argcount)));
|
stats = static_cast<call_status>(lua_resume(lua_state(), static_cast<int>(argcount)));
|
||||||
#else
|
#elif SOL_LUA_VERSION < 504
|
||||||
stats = static_cast<call_status>(lua_resume(lua_state(), nullptr, static_cast<int>(argcount)));
|
stats = static_cast<call_status>(lua_resume(lua_state(), nullptr, static_cast<int>(argcount)));
|
||||||
#endif // Lua 5.1 compat
|
#else
|
||||||
|
int nstack = 0;
|
||||||
|
stats = static_cast<call_status>(lua_resume(lua_state(), nullptr, static_cast<int>(argcount), &nstack));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t... I, typename... Ret>
|
template<std::size_t... I, typename... Ret>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user