forked from SKARF-Routing-Algorithm/SKARF-Routing-Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathosm2po.config
More file actions
482 lines (378 loc) · 19.5 KB
/
osm2po.config
File metadata and controls
482 lines (378 loc) · 19.5 KB
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
470
471
472
473
474
475
476
477
478
479
480
481
482
# ____ _____ __ __ ___ _____ ____
# / __ \ / ____| \/ |__ \| __ \ / __ \
# | | | | (___ | \ / | ) | |__) | | | |
# | | | |\___ \| |\/| | / /| ___/| | | |
# | |__| |____) | | | |/ /_| | | |__| |
# \____/|_____/|_| |_|____|_| \____/ DEFAULT CONFIGURATION
#
######################################################################
#
# PLACEHOLDERS
#
######################################################################
# Since Version 5.1.21 the config allows complex placeholders.
# e.g: "foo=[bar]baz" where "bar" must be another key.
# Nested expression are possible. Circular dependencies are not.
# Keys themselves may be written in a compressed way. e.g.:
# "a[b|c]=d" will be expanded to "ab=d" and "ac=d" at the end.
# Nested expression like "a[b[c|d]]=e" are not allowed here.
# Also possible is a simple case(profile)/default config set. For e.g.
# ".myconf.foo=bar" and ".yourconf.foo=baz" either set "case=myconf"
# or "case=yourconf", otherwise both will be removed. To declare
# defaults use the normal form "foo=bar" or ".default.foo=bar".
# The latter will be removed if a different "case" was set, the first
# will always survive but then the declaration order matters.
# The final step normalizes everything back to the "foo=bar"-form.
# To combine multiple cases use a minus as separator. case=c1-c2,...
# [key]s are usually defined here or on the command line.
# If not found, osm2po also looks for matches in the System.Properties,
# the Environment and finally for a file with this name.
# For the latter [key] must contain at least one path separator.
# In order to suppress substitution of values, e.g. for Patterns like
# [x|y], enclose it in double quotes "[x|y]" or escape single special
# characters by preceding single quotes '[x|y']
######################################################################
#
# CONVERTER
#
######################################################################
# tileSize is the most important parameter for the first conversion
# step. It controls the balance between available memory and
# data size. The rule is simple: The more memory and the larger a tile
# the better. tileSize accepts two sub-values, separated by kommas.
# The pattern is: [<Y>x<X>|x][,<buffer>]
# It defaults to tileSize=10x10,1 (in degrees) where Y,X are Integers and
# buffer a Float. This is a pessimistic value and should be increased
# for larger countries. It is possible to set 7x9 e.g. but divisors of
# 90 and 180 are recommended. The buffer is needed for ways that cross tiles.
# If a way is too long and the buffer too small, it cannot be resolved and will
# be dropped. Setting tileSize=x disables tiling, which is optimal but directly
# dependent on the memory given by the -Xmx Java-Parameter.
# For most countries I recommend tileSize=x with -Xmx1g.
# Since Version 5.0.2 the additional sub-value 'c' is not supported anymore
# and is set by default.
#tileSize = 10x10,1
# osm2po detects the correct parser implementation by file extension.
# It is also possible to override this bahavior
#parser.class = de.cm.osm2po.converter.parser.OsmXmlParser
# you can even set a different handler. Default below.
#parser.handler.class = de.cm.osm2po.converter.Tiler
# Most OSM-Sources are sorted, so nodes come first, then ways
# and finally relations. osm2po relies on this hidden agreement and
# releases resources as soon as possible. In very rare cases e.g.
# when calling the overpass-api using unions, the order becomes
# arbitrary.
#parser.arbitrary=true
# A too small tileSize (size and/or buffer) ignores ways which are
# tagged as one long section. In order to catch these, either increase
# the tileSize values (recommended) or use the following option (slow).
# Tip: Read the Log while and/or after conversion,
# osm2po will report a warn message in such a case.
#rescueOrphanedWays = true
# osm2po's Joiner/TileManager must be able to cache lots of
# tiles (nodes). Therefore it has to estimate the remaining ram.
# If osm2po runs into OutOfMemoryErrors here, which mostly happens
# under 64 Bit Java, increase osm2po's own reservedXmx parameter (in Mb).
#reservedXmx = 512
# Skip regions with too few nodes (faster but less accurate). Default is 0.
#tileThreshold = 100
# If tiling is enabled, caching as many tiles as possible per pass
# is the fastest strategy. In some cases, mostly if these tiles contain hardly
# any nodes, this optimization may cause the opposite effect.
#maxTilesPerLoop = 100
# Very useful but slow postprocess of the segmenter which renumbers
# vertexIDs by their location.
#useQuadTileOrder = true
# In the first conversion step osm2po usually writes nodes to a temp file,
# collects NodeIds referenced by ways and relations and filters them as
# early as possible. Ways will also be pre-filtered here.
# This is memory friendly and fast but in few cases, mostly if special
# relations come into play, not wanted.
#disablePreFilter = true
# In order to ignore or modify ways programmatically the joinFilter is your
# first hook into the Java-API. It acts like a deferred antagonist of the
# disablePreFilter parameter.
#joinFilter.class = de.cm.osm2po.converter.joiner.DefaultJoinFilter
# In few cases the disablePreFilter is overshoot, especially if
# street types of Routes are known. A shuttle train relation e.g. is usually
# a railway. So we can allow it in the PreFilter using the finalMask
# and post-validate it here, by dropping all other railways which are not
# member of a route.
#joinFilter.routeWayClazzes = 3,4,...
# The DefaultJoinFilter drops invalid ways (see finalMask) but bypasses
# validation if a way is referenced by a relevant relation.
# In some rare cases, it might be necessary to enrich the speed if a
# way has not been declared above. It defaults to 30 kmh.
#joinFilter.defaultSpeed = 50
# The DefaultJoinFilter also supports clipping of regions.
# Two LatLon-Pairs denote a rectangle, more than two an outer polygon.
# Multiple clippings can be separated by semicolons.
#joinFilter.boundings = 53.5,10.0,53.6,10.1,53.5,10.1,53.5,10.0
# If you need LonLat- instead of LatLon-Order set
#joinFilter.boundings.longitudeFirst = true
# If your coordinates are in a file, set sth. like this
#myPoly = [path/to/poly.sth]
#joinFilter.boundings = [myPoly]; [anotherPoly]; ...; 53.5,10.0...
# The file may contain simple latLon-Pairs, or poly.file syntax.
# For the latter you'll have to set longitudeFirst=true.
######################################################################
#
# WAY TAG RESOLVER
#
######################################################################
# A WayTagResolver transforms OSM-tags into a simple and flat representation
# containing name, speed, usage, ..., etc.
# Some attributes are hard-coded, the name e.g., others are configurable:
# The clazz (byte 1-127) denotes the anchor/main-type. The second one are the
# flags (Integer32). Each parsed tag can indicate its existence in one Bit.
# These bits must be declared in the flagList before.
# The third attribute is meta, which can only be set programmatically.
# If you need a special behavior, which is not covered by this default
# mechanism, feel free to implement your own WayTagResolver or extend the
# DefaultWayTagResolver.
#wayTagResolver.class = de.cm.osm2po.converter.tiler.DefaultWayTagResolver
# Declare up to 32 custom flags with ascending binary values 0x1, 0x2, 0x4,...
# You may also set these values directly, but this is not very verbose.
wtr.flagList = car, bike, foot, rail, ferry, poly
# Only convert ways with these flags. If finalMask is not set,
# any flag is valid. However, a way with clazz<=0 or flags<=0 is invalid
# and will be ignored.
# --------------------------------------------
# !!! MAJOR CHANGE IN 5.2.72 !!!
# --------------------------------------------
# Use "," instead of "|" to list alternatives.
# Use "|" instead of "&" for binary OR-operations.
# From now on complex masks like "bike|foot&goodgrade" must be written
# as "bike,foot|goograde, which is consequent and more intuitive!
wtr.finalMask = car
#wtr.finalMask = car,bike
# In some rare cases it can be useful to prevent Ways from being
# processed by the segmenter and to exclude them from the road network.
# Converting streets and polygons in one pass is such a case, but this
# should be avoided. Declare the corresponding indicator flag here.
wtr.polyMask = poly
# osm2po needs to know the anchor-tag and some default values if not tagged.
# To avoid ambiguities configure a well chosen priority.
# Main-Tag definitions. Params 1-4:
# 1) priority
# 2) clazz identifier (1-127)
# 3) default speed in kmh
# 4) flags (optional) - allowed transportation types
wtr.tag.highway.motorway = 1, 11, 120, car
wtr.tag.highway.motorway_link = 1, 12, 30, car
wtr.tag.highway.trunk = 1, 13, 90, car
wtr.tag.highway.trunk_link = 1, 14, 30, car
wtr.tag.highway.primary = 1, 15, 70, car
wtr.tag.highway.primary_link = 1, 16, 30, car
wtr.tag.highway.secondary = 1, 21, 60, car
wtr.tag.highway.secondary_link = 1, 22, 30, car
wtr.tag.highway.tertiary = 1, 31, 40, car|bike
wtr.tag.highway.tertiary_link = 1, 32, 20, car|bike
wtr.tag.highway.residential = 1, 41, 40, car|bike
wtr.tag.highway.road = 1, 42, 50, car|bike
wtr.tag.highway.unclassified = 1, 43, 50, car|bike
#wtr.tag.highway.service = 1, 51, 5, car|bike
#wtr.tag.highway.living_street = 1, 63, 7, car|bike|foot
#wtr.tag.highway.pedestrian = 1, 62, 5, bike|foot
#wtr.tag.highway.track = 1, 71, 10, bike|foot
#wtr.tag.highway.path = 1, 72, 10, bike|foot
#wtr.tag.highway.cycleway = 1, 81, 15, bike
#wtr.tag.highway.footway = 2, 91, 5, foot
#wtr.tag.highway.steps = 2, 92, 5, foot
#wtr.tag.route.ferry = 2, 1, 10, ferry
#wtr.tag.railway.rail = 3, 3, 50, rail
# Other tags may also overwrite the default flags (transportation types) above.
# There is a priority (order) in which flags are set or unset again
# It is tag (defaults set above), avoid, allow and finally deny
wtr.avoid.access.no = car|bike|foot|rail|ferry
wtr.allow.motor[car|_vehicle].[yes|destination] = car
wtr.allow.[bicycle|cycleway].yes = bike
wtr.deny.tracktype.grade[4|5] = car|bike
wtr.deny.vehicle.no = car|bike
wtr.deny.motor_vehicle.no = car
wtr.deny.motorcar.no = car
wtr.deny.bicycle.no = bike
wtr.deny.foot.no = foot
wtr.deny.footway.none = foot
# Allow one or more osm-tags to override the default speeds above.
# The priority increases from left to right. Meaning, if more than one tag
# exists, the last one wins. In order to disable this behavior,
# remove the following line or add a leading #.
wtr.maxSpeedTags = maxspeed
#wtr.maxSpeedTags = maxspeed, maxspeed:hgv
# MAJOR CHANGE IN 5.3.4: Patterns are not supported anymore
######################################################################
#
# RELATION TAG RESOLVER
#
######################################################################
#relationTagResolver.class = de.cm.osm2po.converter.tiler.DefaultRelationTagResolver
# The DefaultRelationTagResolver can take some Relation types into account.
# By default it only accepts Restrictions.
#rtr.support.restrictions = false
#rtr.support.boundaries = true
#rtr.support.route.types = bus, bicycle
# For each relation type osm2po assigns a clazz value.
# The list below excludes them again. Example:
# -60 is a country boundary and -127 a no-left-turn restriction
# An overview of all clazzes can be found in the JavaDoc
#rtr.exclude.clazzes = -60, -127
# prefer i18n-name, if given. The priority increases from left to right
#rtr.preferredLangCodes = en, de
# Polygons, if supported, have too many types to press them into one byte.
# Here the DefaultRelationTagResolver uses the flags as additional type attribute.
#rtr.support.polygon.type.10=natural/water
#rtr.support.polygon.type.11=natural/water,water/river
#rtr.support.polygon.type.12=natural/water,water/lake
######################################################################
#
# NODE TAG RESOLVER
#
######################################################################
#nodeTagResolver.class = de.cm.osm2po.converter.tiler.DefaultNodeTagResolver
######################################################################
#
# LOGGER
#
######################################################################
# This is the global max LogLevel for all writers. Possible values are
# data, bugfix, debug, progress, note, warn, info, error, message, alert and fatal.
#log.level = debug
# Declare default or custom writers this way. If none of them has been
# configured explicitly, osm2po will add a LogConsoleWriter and a
# LogFileWriter at index 0 and 1.
#log.0.class = de.cm.osm2po.logging.LogConsoleWriter
#log.1.class = de.cm.osm2po.logging.LogFileWriter
#log.2.class = de.cm.osm2po.logging.LogJclWriter
#log.3.class = de.cm.osm2po.logging.LogMailWriter
#log.4.class = de.cm.osm2po.logging.LogSlackWriter
# Customize Parameters by using the index declared above
# Samples below are the default values
#log.0.level = progress
#log.1.level = debug
#log.1.file = [workDir]/[prefix]_2po.log
#log.1.append = true
# If necessary, redirect the LogConsoleWriter to explicit output streams.
# Possible values are out (default), err or null (quiet).
#log.0.to = out
######################################################################
#
# POSTPROCESSORS
#
######################################################################
postp.0.class = de.cm.osm2po.plugins.postp.PgRoutingWriter
postp.0.writeMultiLineStrings = true
postp.1.class = de.cm.osm2po.plugins.postp.PgVertexWriter
postp.2.class = de.cm.osm2po.plugins.postp.PgPolyWayWriter
postp.3.class = de.cm.osm2po.plugins.postp.PgPolyRelWriter
postp.4.class = de.cm.osm2po.postp.SndExtensionBuilder
postp.5.class = de.cm.osm2po.postp.BndExtensionBuilder
postp.6.class = de.cm.osm2po.postp.MlgExtensionBuilder
postp.6.id = 0
postp.6.maxLevel = 3, 1.0
postp.7.class = de.cm.osm2po.sd.postp.SdGraphBuilder
Pg*Writer usually create sql files. Enable the following
parameter to redirect them to stdout (console) e.g.:
postp.1.pipeOut = false
# Tip 1:
# If you want this program to be one link in a transformation chain
# e.g. curl | bzcat | osm2po | psql
# you must set both, log.0.to=err and postp.0.pipeOut=true.
# log.0 is supposed to be a LogConsoleWriter.
# It is recommended to run curl, bzcat and psql in silent/quiet mode.
# Example (one line):
# curl -s -L http://download.geofabrik.de/europe/germany/hamburg-latest.osm.bz2 |
# bzcat -c |
# java -jar osm2po-core.jar prefix=hh postp.0.pipeOut=true log.0.to=err
# postp.0.class=de.cm.osm2po.plugins.postp.PgRoutingWriter |
# psql -q -U myuser -s -d mydb
# Tip 2:
# For the SdGraphBuilder it is highly recommended to convert
# with useQuadTileOrder=true and activated MlgExtensionBuilder in the
# prior conversion steps.
######################################################################
#
# OSM2PO-Routing
#
######################################################################
# This pluggable class translates other properties like kmh or flags
# and allows to mix in external data programmatically.
#graph.build.interceptor.class = de.cm.osm2po.converter.graph.DefaultGraphBuildInterceptor
# osm2po doubles segments to handle forward and reverse directions.
# Reverse edges derived from one-way-segments will be written by default.
# This is useful for bike routing but not for car routing and blows up your graph.
# In order to exclude them use the following parameter
#graph.build.excludeWrongWays = true
# Runtime parameters for the osm2po-Graph:
# In order to speed up the path builder you may want to set
# graph.support.inmemory=true. This disables HardDisk-Lookups for geometries
# and street names but needs much more RAM (Xmx).
# Setting graph.support.edgeflags=true is useful for GeoJson-Requests.
# If not set, the street type always returns 0.
# Setting graph.support.reverse=true creates an additional Reverse-Graph.
# graph.support.raster[.e|.v] is another RAM-consuming addition, which creates
# a raster index for vertices (v) or edges (e) or if '.e' and '.v'
# are missing, for both.
#graph.support.inmemory = true
#graph.support.edgeflags = true
#graph.support.reverse = true
#graph.support.raster = true
#graph.support.raster.e = true
#graph.support.raster.v = true
#graph.support.barriers = true
#graph.support.extensions = true
# Here are osm2po's modified Dijkstra/AStar algorithms.
# OvlRouters are not restricted to vertices (crossings) and can handle
# virtual locations at runtime.
# EdgeRouters traverse each street twice and return more accurate results
# with regards to the turn-restriction.
# MlgRouters are fast but need preprocessed data by the MlgExtensionBuilder,
# otherwise they will fall back to default behavior.
# In order to take the latter into account at runtime you must
# set graph.support.extensions = true (see above)
# The MlgExtensionBuilder defines IDs for different use cases, as there are:
# ID 0 : Default Car-Routing with TurnRestrictions.
# ID +1 : For Shortest Path (not recommended)
# ID +2 : Ignore OneWay-Restrictions
# ID +4 : Ignore Turn-Restrictions
#router.0.class=de.cm.osm2po.routing.VertexRouter
#router.1.class=de.cm.osm2po.routing.EdgeRouter
#router.2.class=de.cm.osm2po.routing.BidiVertexRouter
#router.3.class=de.cm.osm2po.routing.MultilevelVertexRouter
#router.4.class=de.cm.osm2po.routing.OverlayVertexRouter
#router.5.class=de.cm.osm2po.routing.OverlayEdgeRouter
#router.6.class=de.cm.osm2po.routing.OverlayMultilevelEdgeRouter
######################################################################
#
# OSM2PO-TinyWebServer
#
######################################################################
#service.domain = localhost
#service.port = 8888
#service.index.html = osm2po.html
#service.context=Osm2poService
#service.webdir=osm2po-web
# if needed, register your custom ajax handlers this way
#service.handler.0.class=de.cm.osm2po.service.handlers.RouteHandler
# since v5.2.20 the osm2po-service supports simple filters and https.
# Currently there is a HttpLogFilter, which logs Requests and a
# RateLimitFilter which monitors IPs and API-KEYS (x-api-key).
# The apikeys.txt in the examples below must be a properties file
# with lines like [apikey=10,20,2018-07-01], meaning:
# 10 Requests in 20 Seconds with a fixed expiration date.
#service.filter.1.class=de.cm.osm2po.service.filters.HttpLogFilter
#service.filter.2.class=de.cm.osm2po.service.filters.RateLimitFilter
#service.filter.2.keystore=[user.home]/Desktop/apikeys.txt
#service.filter.2.backup=[user.home]/Desktop/apikeys.backup
#service.filter.2.ttl=1
#service.filter.2.refresh=1
# SSL/HTTPS runs on service.port +1, here 8889.
#service.ssl.only=true
# A real server usually provides a trusted certificate
#service.ssl.keystore.path=[path/to/keystore.p12]
#service.ssl.keystore.pass=[keystorePassword]
# Tip: In order to hide the password from the command history or
# Log (-Files), set it as environment variable. Some systems
# don't like dots, so you can mix both, Env and Java System.Properties
# e.g. java -Dservice.ssl.keystore.pass=[pass] osm2po.jar ...
# Somewhere in the OS: export pass=mysecret