Getting error “code”: 6099, “message”: “Unable to compute a distance/duration matrix.”

post url - http://localhost:8080/ors/v2/matrix/driving-hgv

request body in json -

 {
“locations”: [
[
77.6450753832665,
12.890161192241047
],
[
77.58014653879195,
12.93696097321439
],
[
77.7211134,
12.9342266
],
[
77.61899183967064,
12.942851647333391
]
],
“sources”: [
0
],
“metrics”: [
“distance”
],
“units”: “km”
}

error response i got - {
“error”: {
“code”: 6099,
“message”: “Unable to compute a distance/duration matrix.”
},
“info”: {
“engine”: {
“version”: “6.7.0”,
“build_date”: “2022-07-01T16:32:53Z”
},
“timestamp”: 1656697880409
}
}

my pbf file is - Easyupload.io - Upload files for free and transfer big files easily.

my docker file -

FROM openjdk:11-jdk

ENV MAVEN_OPTS=“-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true”
ENV MAVEN_CLI_OPTS=“–batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true”

ARG ORS_CONFIG=./openrouteservice/src/main/resources/ors-config-sample.json
ARG OSM_FILE=./openrouteservice/src/main/files/bengaluru.pbf
ENV BUILD_GRAPHS=“False”
ARG UID=1000
ARG TOMCAT_VERSION=8.5.69

# Create user

RUN useradd -u $UID -md /ors-core ors

# Create directories

RUN mkdir -p /usr/local/tomcat /ors-conf /var/log/ors &&
chown ors:ors /usr/local/tomcat /ors-conf /var/log/ors

# Install dependencies and locales

RUN apt-get update -qq &&
apt-get install -qq -y locales nano maven moreutils jq &&
rm -rf /var/lib/apt/lists/* &&
locale-gen en_US.UTF-8

USER ors:ors
WORKDIR /ors-core

COPY --chown=ors:ors openrouteservice /ors-core/openrouteservice
COPY --chown=ors:ors $OSM_FILE /ors-core/data/osm_file.pbf
COPY --chown=ors:ors $ORS_CONFIG /ors-core/openrouteservice/src/main/resources/ors-config-sample.json
COPY --chown=ors:ors ./docker-entrypoint.sh /ors-core/docker-entrypoint.sh

# Install tomcat

RUN wget -q [https://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz](https://archive.apache.org/dist/tomcat/tomcat-8/v%24%7BTOMCAT_VERSION%7D/bin/apache-tomcat-%24%7BTOMCAT_VERSION%7D.tar.gz) -O /tmp/tomcat.tar.gz &&
cd /tmp &&
tar xvfz tomcat.tar.gz &&
cp -R /tmp/apache-tomcat-${TOMCAT_VERSION}/* /usr/local/tomcat/ &&
rm -r /tmp/tomcat.tar.gz /tmp/apache-tomcat-${TOMCAT_VERSION}

# Configure ors config

RUN cp /ors-core/openrouteservice/src/main/resources/ors-config-sample.json /ors-core/openrouteservice/src/main/resources/ors-config.json &&
# Replace paths in ors-config.json to match docker setup
jq ‘.ors.services.routing.sources[0] = “data/osm_file.pbf”’ /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json &&
jq ‘.ors.services.routing.profiles.default_params.elevation_cache_path = “data/elevation_cache”’ /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json &&
jq ‘.ors.services.routing.profiles.default_params.graphs_root_path = “data/graphs”’ /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json &&
# init_threads = 1, > 1 been reported some issues
jq ‘.ors.services.routing.init_threads = 1’ /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json && \


# Delete all profiles but car
jq 'del(.ors.services.routing.profiles.active[1,2,3,4,5,6,7,8])' /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json


# Make all directories writable, to allow the usage of other uids via “docker run -u”

RUN chmod -R go+rwX /ors-core /ors-conf /usr/local/tomcat /var/log/ors

# Define volumes

VOLUME [“/ors-core/data/graphs”, “/ors-core/data/elevation_cache”, “/ors-conf”, “/usr/local/tomcat/logs”, “/var/log/ors”]

# Start the container

EXPOSE 8080
ENTRYPOINT [“/bin/bash”, “/ors-core/docker-entrypoint.sh”]

docker-compose.yml file-

version: ‘2.4’
services:
ors-app:
container_name: ors-app
ports:
- 8080:8080
- 9001:9001
image: openrouteservice/openrouteservice:latest
build:
context: …/
args:
ORS_CONFIG: ./openrouteservice/src/main/resources/ors-config-sample.json
OSM_FILE: ./openrouteservice/src/main/files/bengaluru.pbf
user: “${ORS_UID:-0}:${ORS_GID:-0}”
volumes:
- ./graphs:/ors-core/data/graphs
- ./elevation_cache:/ors-core/data/elevation_cache
- ./logs/ors:/var/log/ors
- ./logs/tomcat:/usr/local/tomcat/logs
- ./conf:/ors-conf
# - ./your_osm.pbf:/ors-core/data/osm_file.pbf
environment:
- BUILD_GRAPHS=False # Forces the container to rebuild the graphs, e.g. when PBF is changed
- “JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g”
- “CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost”

my ors-config.json file is -

{
“ors”: {
“info”: {
“base_url”: “https://openrouteservice.org/”,
“support_mail”: “[support@openrouteservice.org](mailto:support@openrouteservice.org)”,
“author_tag”: “openrouteservice”,
“content_licence”: “LGPL 3.0”
},
“services”: {
“matrix”: {
“enabled”: true,
“maximum_routes”: 1000000,
“maximum_routes_flexible”: 25,
“maximum_search_radius”: 5000,
“maximum_visited_nodes”: 100000,
“allow_resolve_locations”: true,
“attribution”: “[openrouteservice.org](http://openrouteservice.org/), OpenStreetMap contributors”
},
“isochrones”: {
“enabled”: true,
“maximum_range_distance”: [
{
“profiles”: “any”,
“value”: 50000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 100000
}
],
“maximum_range_time”: [
{
“profiles”: “any”,
“value”: 18000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 3600
}
],
“fastisochrones”: {
“maximum_range_distance”: [
{
“profiles”: “any”,
“value”: 50000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 500000
}
],
“maximum_range_time”: [
{
“profiles”: “any”,
“value”: 18000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 10800
}
],
“profiles”: {
“default_params”: {
“enabled”: false,
“threads”: 12,
“weightings”: “recommended”,
“maxcellnodes”: 5000
},
“profile-hgv”: {
“enabled”: false,
“threads”: 12,
“weightings”: “recommended, shortest”,
“maxcellnodes”: 5000
}
}
},
“maximum_intervals”: 10,
“maximum_locations”: 2,
“allow_compute_area”: true
},
“routing”: {
“enabled”: true,
“mode”: “normal”,
“routing_description”: “This is a routing file from openrouteservice”,
“routing_name”: “openrouteservice routing”,
“sources”: [
“data/osm_file.pbf”
],
“init_threads”: 1,
“attribution”: “[openrouteservice.org](http://openrouteservice.org/), OpenStreetMap contributors”,
“elevation_preprocessed”: false,
“profiles”: {
“active”: [
“hgv”
],
“default_params”: {
“encoder_flags_size”: 8,
“graphs_root_path”: “data/graphs”,
“elevation_provider”: “multi”,
“elevation_cache_path”: “data/elevation_cache”,
“elevation_cache_clear”: false,
“instructions”: true,
“maximum_distance”: 100000,
“maximum_distance_dynamic_weights”: 100000,
“maximum_distance_avoid_areas”: 100000,
“maximum_waypoints”: 50,
“maximum_snapping_radius”: 400,
“maximum_avoid_polygon_area”: 200000000,
“maximum_avoid_polygon_extent”: 20000,
“maximum_distance_alternative_routes”: 100000,
“maximum_alternative_routes”: 3,
“maximum_distance_round_trip_routes”: 100000,
“maximum_speed_lower_bound”: 80,
“preparation”: {
“min_network_size”: 200,
“min_one_way_network_size”: 200,
“methods”: {
“lm”: {
“enabled”: true,
“threads”: 1,
“weightings”: “recommended,shortest”,
“landmarks”: 16
}
}
},
“execution”: {
“methods”: {
“lm”: {
“disabling_allowed”: true,
“active_landmarks”: 8
}
}
}
},
“profile-car”: {
“profiles”: “driving-car”,
“parameters”: {
“encoder_flags_size”: 8,
“encoder_options”: “turn_costs=true|block_fords=false|use_acceleration=true”,
“maximum_distance”: 100000,
“elevation”: true,
“maximum_snapping_radius”: 350,
“preparation”: {
“min_network_size”: 200,
“min_one_way_network_size”: 200,
“methods”: {
“ch”: {
“enabled”: true,
“threads”: 1,
“weightings”: “fastest”
},
“lm”: {
“enabled”: false,
“threads”: 1,
“weightings”: “fastest,shortest”,
“landmarks”: 16
},
“core”: {
“enabled”: true,
“threads”: 1,
“weightings”: “fastest,shortest”,
“landmarks”: 64,
“lmsets”: “highways;allow_all”
}
}
},
“execution”: {
“methods”: {
“ch”: {
“disabling_allowed”: true
},
“lm”: {
“disabling_allowed”: true,
“active_landmarks”: 6
},
“core”: {
“disabling_allowed”: true,
“active_landmarks”: 6
}
}
},
“ext_storages”: {
“WayCategory”: {},
“HeavyVehicle”: {},
“WaySurfaceType”: {},
“RoadAccessRestrictions”: {
“use_for_warnings”: true
}
}
}
},
“profile-hgv”: {
“profiles”: “driving-hgv”,
“parameters”: {
“encoder_flags_size”: 8,
“encoder_options”: “turn_costs=true|block_fords=false|use_acceleration=true”,
“maximum_distance”: 100000,
“elevation”: true,
“preparation”: {
“min_network_size”: 200,
“min_one_way_network_size”: 200,
“methods”: {
“ch”: {
“enabled”: true,
“threads”: 1,
“weightings”: “recommended”
},
“core”: {
“enabled”: true,
“threads”: 1,
“weightings”: “recommended,shortest”,
“landmarks”: 64,
“lmsets”: “highways;allow_all”
}
}
},
“execution”: {
“methods”: {
“ch”: {
“disabling_allowed”: true
},
“core”: {
“disabling_allowed”: true,
“active_landmarks”: 6
}
}
},
“ext_storages”: {
“WayCategory”: {},
“HeavyVehicle”: {
“restrictions”: true
},
“WaySurfaceType”: {}
}
}
},
“profile-bike-regular”: {
“profiles”: “cycling-regular”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-bike-mountain”: {
“profiles”: “cycling-mountain”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-bike-road”: {
“profiles”: “cycling-road”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-bike-electric”: {
“profiles”: “cycling-electric”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-walking”: {
“profiles”: “foot-walking”,
“parameters”: {
“encoder_options”: “block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-hiking”: {
“profiles”: “foot-hiking”,
“parameters”: {
“encoder_options”: “block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-wheelchair”: {
“profiles”: “wheelchair”,
“parameters”: {
“encoder_options”: “block_fords=true”,
“elevation”: true,
“maximum_snapping_radius”: 50,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“Wheelchair”: {
“KerbsOnCrossings”: “true”
},
“OsmId”: {}
}
}
}
}
}
},
“logging”: {
“enabled”: true,
“level_file”: “DEBUG_LOGGING.json”,
“location”: “/var/log/ors”,
“stdout”: true
},
“system_message”: [
{
“active”: false,
“text”: “This message would be sent with every routing bike fastest request”,
“condition”: {
“request_service”: “routing”,
“request_profile”: “cycling-regular,cycling-mountain,cycling-road,cycling-electric”,
“request_preference”: “fastest”
}
},
{
“active”: false,
“text”: “This message would be sent with every request for geojson response”,
“condition”: {
“api_format”: “geojson”
}
},
{
“active”: false,
“text”: “This message would be sent with every request on API v1 from January 2020 until June 2050”,
“condition”: {
“api_version”: 1,
“time_after”: “2020-01-01T00:00:00Z”,
“time_before”: “2050-06-01T00:00:00Z”
}
},
{
“active”: false,
“text”: “This message would be sent with every request”
}
]
}
}

please help me in this.

1 Like

There’s an open issue on this, see here.