-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-bike.yml
469 lines (413 loc) · 23.6 KB
/
config-bike.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
graphhopper:
# OpenStreetMap input file PBF or XML, can be changed via command line -Ddw.graphhopper.datareader.file=some.pbf
datareader.file: ""
# Local folder used by graphhopper to store its data
graph.location: graph-cache
##### Vehicles #####
# More options: foot,hike,bike,bike2,mtb,racingbike,motorcycle,car4wd,wheelchair (comma separated)
# bike2 takes elevation data into account (like up-hill is slower than down-hill) and requires enabling graph.elevation.provider below.
# graph.flag_encoders: car
# Enable turn restrictions for car or motorcycle.
# graph.flag_encoders: car|turn_costs=true
# Add additional information to every edge. Used for path details (#1548), better instructions (#1844) and tunnel/bridge interpolation (#798).
# Default values are: road_class,road_class_link,road_environment,max_speed,road_access (since #1805)
# More are: surface,max_width,max_height,max_weight,max_axle_load,max_length,hazmat,hazmat_tunnel,hazmat_water,toll,track_type,
# mtb_rating,hiking_rating,horse_rating,lanes
graph.encoded_values: surface,max_speed,smoothness,lanes,road_class,average_slope,max_slope,osm_way_id,roundabout,bike_priority,bike_average_speed,racingbike_priority,racingbike_average_speed,mtb_priority,mtb_average_speed,road_access,track_type,max_height,max_width,get_off_bike,bike_access,racingbike_access,mtb_access
##### Routing Profiles ####
# Routing can be done for the following list of profiles. Note that it is required to specify all the profiles you
# would like to use here. The fields of each profile are as follows:
# - name (required): a unique string identifier for the profile
# - vehicle (required): refers to the `graph.flag_encoders` used for this profile
# - weighting (required): the weighting used for this profile, e.g. fastest,shortest or short_fastest
# - turn_costs (true/false, default: false): whether or not turn restrictions should be applied for this profile.
# this will only work if the `graph.flag_encoders` for the given `vehicle` is configured with `|turn_costs=true`.
#
# Depending on the above fields there are other properties that can be used, e.g.
# - distance_factor: 0.1 (can be used to fine tune the time/distance trade-off of short_fastest weighting)
# - u_turn_costs: 60 (time-penalty for doing a u-turn in seconds (only possible when `turn_costs: true`)).
# Note that since the u-turn costs are given in seconds the weighting you use should also calculate the weight
# in seconds, so for example it does not work with shortest weighting.
# - custom_model_file: when you specified "weighting: custom" you need to set a yaml or json file inside your custom_model_folder
# or working directory that defines the custom_model. If you want an empty model you can also set "custom_model_file: empty".
# You can also use th e`custom_model` field instead and specify your custom model in the profile directly.
#
# For more information about profiles and especially custom profiles have a look into the documentation
# at docs/core/profiles.md or the examples under web/src/test/resources/com/graphhopper/http/resources/ or
# the CustomWeighting class for the raw details.
#
# To prevent long running routing queries you should usually enable either speed or hybrid mode for all the given
# profiles (see below). Otherwise you should at least limit the number of `routing.max_visited_nodes`.
profiles:
# Bike doesn't consider elevation data.
- name: bike_default
custom_model_files: [bike.json]
- name: bike_shortest
custom_model_files: [bike.json]
- name: bike_fastest
custom_model_files: [bike.json]
# Bike2 considers elevation data (avoid uphills).
- name: bike2_default
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/bike.json
"priority": [
{ "if": "true", "multiply_by": "bike_priority" },
{ "if": "!bike_access && (!backward_bike_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!bike_access && backward_bike_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "bike_average_speed" },
{ "if": "!bike_access && backward_bike_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3"},
{ "else_if": "average_slope >= 12", "limit_to": "6"},
{ "else_if": "average_slope >= 8", "multiply_by": "0.80"},
{ "else_if": "average_slope >= 4", "multiply_by": "0.90"},
{ "else_if": "average_slope <= -4", "multiply_by": "1.10"}
]
}
- name: bike2_shortest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/bike.json
"priority": [
{ "if": "true", "multiply_by": "bike_priority" },
{ "if": "!bike_access && (!backward_bike_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!bike_access && backward_bike_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "bike_average_speed" },
{ "if": "!bike_access && backward_bike_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3"},
{ "else_if": "average_slope >= 12", "limit_to": "6"},
{ "else_if": "average_slope >= 8", "multiply_by": "0.80"},
{ "else_if": "average_slope >= 4", "multiply_by": "0.90"},
{ "else_if": "average_slope <= -4", "multiply_by": "1.10"}
]
}
- name: bike2_fastest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/bike.json
"priority": [
{ "if": "true", "multiply_by": "bike_priority" },
{ "if": "!bike_access && (!backward_bike_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!bike_access && backward_bike_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "bike_average_speed" },
{ "if": "!bike_access && backward_bike_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3"},
{ "else_if": "average_slope >= 12", "limit_to": "6"},
{ "else_if": "average_slope >= 8", "multiply_by": "0.80"},
{ "else_if": "average_slope >= 4", "multiply_by": "0.90"},
{ "else_if": "average_slope <= -4", "multiply_by": "1.10"}
]
}
- name: racingbike_default
custom_model_files: [racingbike.json]
- name: racingbike_shortest
custom_model_files: [racingbike.json]
- name: racingbike_fastest
custom_model_files: [racingbike.json]
- name: racingbike2_default
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/racingbike.json
"priority": [
{ "if": "true", "multiply_by": "racingbike_priority" },
{ "if": "!racingbike_access && (!backward_racingbike_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!racingbike_access && backward_racingbike_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "racingbike_average_speed" },
{ "if": "!racingbike_access && backward_racingbike_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: racingbike2_shortest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/racingbike.json
"priority": [
{ "if": "true", "multiply_by": "racingbike_priority" },
{ "if": "!racingbike_access && (!backward_racingbike_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!racingbike_access && backward_racingbike_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "racingbike_average_speed" },
{ "if": "!racingbike_access && backward_racingbike_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: racingbike2_fastest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/racingbike.json
"priority": [
{ "if": "true", "multiply_by": "racingbike_priority" },
{ "if": "!racingbike_access && (!backward_racingbike_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!racingbike_access && backward_racingbike_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "racingbike_average_speed" },
{ "if": "!racingbike_access && backward_racingbike_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: mtb_default
custom_model_files: [mtb.json]
- name: mtb_shortest
custom_model_files: [mtb.json]
- name: mtb_fastest
custom_model_files: [mtb.json]
- name: mtb2_default
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/mtb.json
"priority": [
{ "if": "true", "multiply_by": "mtb_priority" },
{ "if": "!mtb_access && (!backward_mtb_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!mtb_access && backward_mtb_access", "multiply_by": "0.2" },
],
"speed": [
{ "if": "true", "limit_to": "mtb_average_speed" },
{ "if": "!mtb_access && backward_mtb_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: mtb2_shortest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/mtb.json
"priority": [
{ "if": "true", "multiply_by": "mtb_priority" },
{ "if": "!mtb_access && (!backward_mtb_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!mtb_access && backward_mtb_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "mtb_average_speed" },
{ "if": "!mtb_access && backward_mtb_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: mtb2_fastest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/mtb.json
"priority": [
{ "if": "true", "multiply_by": "mtb_priority" },
{ "if": "!mtb_access && (!backward_mtb_access || roundabout)", "multiply_by": "0" },
{ "else_if": "!mtb_access && backward_mtb_access", "multiply_by": "0.2" }
],
"speed": [
{ "if": "true", "limit_to": "mtb_average_speed" },
{ "if": "!mtb_access && backward_mtb_access", "limit_to": "5" },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: cargo_default
custom_model_files: [cargo_bike.json]
- name: cargo_shortest
custom_model_files: [cargo_bike.json]
- name: cargo_fastest
custom_model_files: [cargo_bike.json]
- name: cargo2_default
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/cargo_bike.json
"priority": [
{ "if": "road_access == PRIVATE", "multiply_by": "0" },
{ "if": "road_class == STEPS", "multiply_by": 0 },
{ "if": "surface == SAND", "multiply_by": 0.5 },
{ "if": "track_type != MISSING && track_type != GRADE1", "multiply_by": 0.9 },
{ "if": "get_off_bike", "multiply_by": 0.5 },
{ "if": "max_height < 2.3", "multiply_by": 0 },
{ "if": "max_width < 1.2", "multiply_by": 0 }
],
"speed": [
{ "if": "road_class == PRIMARY", "limit_to": 28 },
{ "else": "", "limit_to": 25 },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: cargo2_shortest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/cargo_bike.json
"priority": [
{ "if": "road_access == PRIVATE", "multiply_by": "0" },
{ "if": "road_class == STEPS", "multiply_by": 0 },
{ "if": "surface == SAND", "multiply_by": 0.5 },
{ "if": "track_type != MISSING && track_type != GRADE1", "multiply_by": 0.9 },
{ "if": "get_off_bike", "multiply_by": 0.5 },
{ "if": "max_height < 2.3", "multiply_by": 0 },
{ "if": "max_width < 1.2", "multiply_by": 0 }
],
"speed": [
{ "if": "road_class == PRIMARY", "limit_to": 28 },
{ "else": "", "limit_to": 25 },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
- name: cargo2_fastest
custom_model: {
# See /core/src/main/resources/com/graphhopper/custom_models/cargo_bike.json
"priority": [
{ "if": "road_access == PRIVATE", "multiply_by": "0" },
{ "if": "road_class == STEPS", "multiply_by": 0 },
{ "if": "surface == SAND", "multiply_by": 0.5 },
{ "if": "track_type != MISSING && track_type != GRADE1", "multiply_by": 0.9 },
{ "if": "get_off_bike", "multiply_by": 0.5 },
{ "if": "max_height < 2.3", "multiply_by": 0 },
{ "if": "max_width < 1.2", "multiply_by": 0 }
],
"speed": [
{ "if": "road_class == PRIMARY", "limit_to": 28 },
{ "else": "", "limit_to": 25 },
# See /core/src/main/resources/com/graphhopper/custom_models/bike_elevation.json
{ "if": "average_slope >= 15", "limit_to": "3" },
{ "else_if": "average_slope >= 12", "limit_to": "6" },
{ "else_if": "average_slope >= 8", "multiply_by": "0.80" },
{ "else_if": "average_slope >= 4", "multiply_by": "0.90" },
{ "else_if": "average_slope <= -4", "multiply_by": "1.10" }
]
}
# Speed mode:
# Its possible to speed up routing by doing a special graph preparation (Contraction Hierarchies, CH). This requires
# more RAM/disk space for holding the prepared graph but also means less memory usage per request. Using the following
# list you can define for which of the above routing profiles such preparation shall be performed. Note that to support
# profiles with `turn_costs: true` a more elaborate preparation is required (longer preparation time and more memory
# usage) and the routing will also be slower than with `turn_costs: false`.
# Hybrid mode:
# Similar to speed mode, the hybrid mode (Landmarks, LM) also speeds up routing by doing calculating auxiliary data
# in advance. Its not as fast as speed mode, but more flexible.
#
# Advanced usage: It is possible to use the same preparation for multiple profiles which saves memory and preparation
# time. To do this use e.g. `preparation_profile: my_other_profile` where `my_other_profile` is the name of another
# profile for which an LM profile exists. Important: This only will give correct routing results if the weights
# calculated for the profile are equal or larger (for every edge) than those calculated for the profile that was used
# for the preparation (`my_other_profile`)
profiles_lm: []
##### Elevation #####
# To populate your graph with elevation data use SRTM, default is noop (no elevation). Read more about it in docs/core/elevation.md
graph.elevation.provider: dgm
# default location for cache is /tmp/srtm
# graph.elevation.cache_dir: ./srtmprovider/
# If you have a slow disk or plenty of RAM change the default MMAP to:
# graph.elevation.dataaccess: RAM_STORE
# To enable bilinear interpolation when sampling elevation at points (default uses nearest neighbor):
graph.elevation.interpolate: bilinear
# To increase elevation profile resolution, use the following two parameters to tune the extra resolution you need
# against the additional storage space used for edge geometries. You should enable bilinear interpolation when using
# these features (see #1953 for details).
# - first, set the distance (in meters) at which elevation samples should be taken on long edges
# graph.elevation.long_edge_sampling_distance: 60
# - second, set the elevation tolerance (in meters) to use when simplifying polylines since the default ignores
# elevation and will remove the extra points that long edge sampling added
# graph.elevation.way_point_max_distance: 10
#### Speed, hybrid and flexible mode ####
# To make CH preparation faster for multiple profiles you can increase the default threads if you have enough RAM.
# Change this setting only if you know what you are doing and if the default worked for you.
# prepare.ch.threads: 1
# To tune the performance vs. memory usage for the hybrid mode use
# prepare.lm.landmarks: 16
# Make landmark preparation parallel if you have enough RAM. Change this only if you know what you are doing and if
# the default worked for you.
# prepare.lm.threads: 1
# In many cases the road network consists of independent components without any routes going in between. In
# the most simple case you can imagine an island without a bridge or ferry connection. The following parameter
# allows setting a minimum size (number of edges) for such detached components. This can be used to reduce the number
# of cases where a connection between locations might not be found.
prepare.min_network_size: 200
##### Routing #####
# You can define the maximum visited nodes when routing. This may result in not found connections if there is no
# connection between two points within the given visited nodes. The default is Integer.MAX_VALUE. Useful for flexibility mode
# routing.max_visited_nodes: 1000000
# Control how many active landmarks are picked per default, this can improve query performance
# routing.lm.active_landmarks: 4
# You can limit the max distance between two consecutive waypoints of flexible routing requests to be less or equal
# the given distance in meter. Default is set to 1000km.
routing.non_ch.max_waypoint_distance: 1000000
##### Storage #####
# Excludes certain types of highways during the OSM import to speed up the process and reduce the size of the graph.
# A typical application is excluding 'footway','cycleway','path' and maybe 'pedestrian' and 'track' highways for
# motorized vehicles. This leads to a smaller and less dense graph, because there are fewer ways (obviously),
# but also because there are fewer crossings between highways (=junctions).
# Another typical example is excluding 'motorway', 'trunk' and maybe 'primary' highways for bicycle or pedestrian routing.
# import.osm.ignored_highways: footway,cycleway,path,pedestrian,steps # typically useful for motorized-only routing
import.osm.ignored_highways: motorway,trunk # typically useful for non-motorized routing
# configure the memory access, use RAM_STORE for well equipped servers (default and recommended)
graph.dataaccess: RAM_STORE
# will write way names in the preferred language (language code as defined in ISO 639-1 or ISO 639-2):
# datareader.preferred_language: en
# Sort the graph after import to make requests roughly ~10% faster. Note that this requires significantly more RAM on import.
# graph.do_sort: true
##### Spatial Rules #####
# Spatial Rules require some configuration and only work with the DataFlagEncoder.
# Spatial Rules require you to provide Polygons in which the rules are enforced
# The line below contains the default location for the files which define these borders
# spatial_rules.borders_directory: core/files/spatialrules
# You can define the maximum BBox for which spatial rules are loaded.
# You might want to do this if you are only importing a small area and don't need rules for other countries.
# Having less rules, might result in a smaller graph. The line below contains the world-wide bounding box, uncomment and adapt to your need.
# spatial_rules.max_bbox: -180,180,-90,90
# Dropwizard server configuration
server:
application_connectors:
- type: http
port: 8989
# for security reasons bind to localhost
bind_host: localhost
request_log:
appenders: []
admin_connectors:
- type: http
port: 8990
bind_host: localhost
# See https://www.dropwizard.io/1.3.8/docs/manual/configuration.html#logging
logging:
appenders:
- type: file
time_zone: UTC
current_log_filename: logs/graphhopper.log
log_format: "%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
archive: true
archived_log_filename_pattern: ./logs/graphhopper-%d.log.gz
archived_file_count: 30
never_block: true
- type: console
time_zone: UTC
log_format: "%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"