-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Disabled Datasets
Disabled Datasets is a new unreleased feature that allows you to reduce memory usage.
You can prevent specific datasets being loaded into memory when you do not need the OSRM features provided by those datasets.
There are two feature datasets that can be disabled.
-
Provides geometry overviews, navigation steps, path annotations, waypoints
-
Disabling this dataset is equivalent to limiting your requests to the following parameters
steps=false&overview=false&annotations=false&skip_waypoints=true
-
Provides navigation steps
-
Disabling this dataset is equivalent to limiting your requests to the following parameter
steps=false
-
Note that disabling
ROUTE_GEOMETRY
also disablesROUTE_STEPS
, you do not need to specify both in your config.
Disabling is achieved by providing the OSRM Engine config with a list of feature datasets you wish to disable.
Provide the disable-feature-dataset
argument to osrm-datastore
osrm-datastore --dataset-name=foo_data foo_base_file.osrm --disable-feature-dataset ROUTE_GEOMETRY
You do not need to pass the argument to osrm-routed
, it will be ignored.
Provide the disable-feature-dataset
argument to osrm-routed
osrm-routed foo_base_file.osrm --disable-feature-dataset ROUTE_STEPS
Set the disable_feature_dataset
array field in the EngineConfig
var osrm = new OSRM({'path': monaco_path, 'disable_feature_dataset': ['ROUTE_GEOMETRY']});
If you attempt to use a feature that is disabled, you will receive a DisabledDatasetException
, with a message explaining which dataset you attempted to access.
E.g. making an HTTP request to include navigation steps when ROUTE_STEPS
is disabled.
$ curl "http://localhost:5000/route/v1/driving/-0.13286590576171875,51.50863561745838;-0.12119293212890625,51.51889124411907?steps=true"
{"message":"DisabledDatasetException: Your query tried to access the disabled dataset IntersectionBearings. Please check your configuration.","code":"DisabledDataset"}
osrm-routed logs will contain a warning
[2023-07-31T13:40:28.058796467] [warn] [disabled dataset error][140634845328960] code: DisabledDataset_IntersectionBearings, uri: /route/v1/driving/-0.13286590576171875,51.50863561745838;-0.12119293212890625,51.51889124411907?steps=true
The equivalent node request
var osrm = new OSRM({'path': monaco_path, 'disable_feature_dataset': ['ROUTE_STEPS']});
var options = {
steps: true,
coordinates: three_test_coordinates.concat(three_test_coordinates),
};
osrm.route(options, function(err, route) {
console.log(err)
});
> 'DisabledDatasetException: Your query tried to access the disabled dataset IntersectionBearings. Please check your configuration.'
I think this page is obsolete. I add few commet since I tried to compile OSMR recently using Codeblocks 20.03 on Windows 10. What I found was that
Several extra libraries ave to be installed like BZip2, lua. I was using MSYS2 so I did, pacman -S mingw-w64-x86_64-bzip2 pacman -S mingw-w64-x86_64-lua pacman -S mingw-w64-x86_64-zlib
instal Intell tbb https://github.com/oneapi-src/oneTBB/releases Extract it to a folder (e.g., C:\tbb).
Ensure to add TBB Path to CMake Command and that the bin folder of MinGW or MSYS2 (e.g., C:\msys64\mingw64\bin) is added to your system PATH environment variable.
Then in osrm-backend\build run
cmake -G "CodeBlocks - MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DTBB_INCLUDE_DIR="C:/tbb/include" -DTBB_LIBRARY="C:/tbb/lib/intel64/gcc4.8/libtbb.so"
cmake -G "CodeBlocks - MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fno-lto -mconsole" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-e,mainCRTStartup"
It may be enough to compile.
However for some compilation problems I add to do
- remove "-Werror # Treat all warnings like error" in a CMakeLists.txt file
- add in shared_memory.hcp in line 208: (void)lock_file; // This explicitly marks lock_file as used to avoid warning of unused variable
- to avoid an Link Time Optimization (LTO) error run cmake -G "CodeBlocks - MinGW Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DIPO=OFF
- put OFF in option(ENABLE_LTO "Use Link Time Optimisation" OFF) and I add set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) in Cmake
I finally gave up because of Windows console incompatibility (Winmain not found) without knowing the reason even after having, In codebleocks Project properties, Built target, type put Console application