Imported Upstream version 0.0.0+svn3498
Bas Couwenberg
9 years ago
58 | 58 | [options="header"] |
59 | 59 | |========================================================= |
60 | 60 | | Tag | Description | Required mkgmap option |
61 | | +mkgmap:way-has-pois+ | +true+ for ways that have at least one point with a tag +access=\*+, +barrier=\*+, or +highway=*+ | 'link-pois-to-ways' | |
62 | | +mkgmap:dead-end-check+ | Set to +false+ to disable the dead end check for a specific way | 'report-dead-ends' | |
63 | | +mkgmap:flare-check+ | Set to +true+ to force the flare check for a specific way, set to +false+ to disable it | 'check-roundabout-flares' | |
64 | | +mkgmap:dir-check+ | Set to +false+ to tell mkgmap to ignore the way when checking roundabouts for clockwise direction | 'check-roundabouts' | |
65 | | +mkgmap:no-dir-check+ | Set to +true+ to tell mkgmap to ignore the way when checking roundabouts for clockwise direction | 'check-roundabouts' | |
66 | ||
67 | |========================================================= | |
68 | ||
61 | | +mkgmap:way-has-pois+ | +true+ for ways that have at least one point with a tag +access=\*+, +barrier=\*+, or +highway=*+ | 'link-pois-to-ways' | |
62 | | +mkgmap:dead-end-check+ | Set to +false+ to disable the dead end check for a specific way | 'report-dead-ends' | |
63 | | +mkgmap:flare-check+ | Set to +true+ to force the flare check for a specific way, set to +false+ to disable it | 'check-roundabout-flares' | |
64 | | +mkgmap:dir-check+ | Set to +false+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts' | |
65 | | +mkgmap:no-dir-check+ | Set to +true+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts' | |
66 | | +mkgmap:synthesised+ | Set to +true+ to tell mkgmap that this is an additional way created using the continue statement in an action block and that it should be excluded from checks | 'check-roundabouts', 'check-roundabout-flares' | |
67 | ||
68 | |========================================================= | |
69 | ||
69 | 70 | |
70 | 71 | .POI address tags |
71 | 72 | [options="header"] |
726 | 726 | stacking two lines on top of each other. |
727 | 727 | For example if you want to mark a bridge in a distinctive way you |
728 | 728 | could match on +bridge=yes+, you would then almost always use +continue+ so |
729 | that the +highway+ tag could be matched later. If you failed to do this | |
730 | then there might be a break in the road for routing purposes. | |
731 | ||
732 | Note that by default when using the _continue_ statement the action block | |
733 | of the rule (if there is one) will only be applied _within this rule_ and | |
734 | not during any following rule matches. Use the _continue with_actions_ | |
735 | statement if you want to change this behaviour (see next section). | |
729 | that the +highway+ tag could be matched later. If you failed to do this | |
730 | then there might be a break in the road for routing purposes. | |
731 | ||
732 | Note that when using the _continue_ statement, the action block | |
733 | of the rule (if there is one) will only be applied _within this rule_ and | |
734 | not during any following rule matches. Use the _continue with_actions_ | |
735 | statement if you want to change this behaviour (see next section). | |
736 | 736 | |
737 | 737 | === continue with_actions === |
738 | 738 | The with_actions statement modifies the continue behaviour in such a way, |
0 | svn.version: 3478 | |
1 | build.timestamp: 2015-02-26T07:49:21+0000 | |
0 | svn.version: 3498 | |
1 | build.timestamp: 2015-03-18T08:13:59+0000 |
0 | 0 | # |
1 | # Sets the road speed based on the maxspeed tag. | |
2 | # In case mkgmap:road-speed-class is set the element | |
3 | # road_speed is overriden. | |
1 | # Sets the maximum road speed based on the maxspeed tag. | |
2 | # In case mkgmap:road-speed-max is set the element road_speed is limited. | |
4 | 3 | # |
5 | 4 | # road_speed classification: |
6 | 5 | # road_speed | highest speed |
14 | 13 | # 0 | 3 mph / 5 km/h |
15 | 14 | # |
16 | 15 | |
17 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 110 { set mkgmap:road-speed-class = 7 } | |
18 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 90 { set mkgmap:road-speed-class = 6 } | |
19 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 80 { set mkgmap:road-speed-class = 5 } | |
20 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 60 { set mkgmap:road-speed-class = 4 } | |
21 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 40 { set mkgmap:road-speed-class = 3 } | |
22 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 20 { set mkgmap:road-speed-class = 2 } | |
23 | # change class 1 to 10 km/h which is not correct but better handles living_streets with maxspeed=7 | |
24 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh() > 10 { set mkgmap:road-speed-class = 1 } | |
25 | maxspeed=* & mkgmap:road-speed-class!=* & maxspeedkmh()=* { set mkgmap:road-speed-class = 0 } | |
16 | maxspeed=walk { set maxspeed=10 } | |
17 | maxspeed~'.*:living_street' { set maxspeed=10 } | |
18 | ||
19 | maxspeed=RU:urban { set maxspeed=60 } | |
20 | maxspeed=UA:urban { set maxspeed=60 } | |
21 | maxspeed~'.*:urban' { set maxspeed=50 } | |
22 | ||
23 | maxspeed=AT:rural { set maxspeed=100 } | |
24 | maxspeed=DE:rural { set maxspeed=100 } | |
25 | maxspeed~'.*:rural' { set maxspeed=90 } | |
26 | ||
27 | maxspeed~'.*:trunk' { set maxspeed=100 } | |
28 | maxspeed~'.*:motorway' { set maxspeed=130 } | |
29 | ||
30 | # delete maxspeed if we still cannot convert it to km/h | |
31 | maxspeed=* & maxspeedkmh()!=* { delete maxspeed } | |
32 | ||
33 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 10 { set mkgmap:road-speed-max = 0 } | |
34 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 25 { set mkgmap:road-speed-max = 1 } | |
35 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 45 { set mkgmap:road-speed-max = 2 } | |
36 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 60 { set mkgmap:road-speed-max = 3 } | |
37 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 85 { set mkgmap:road-speed-max = 4 } | |
38 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 100 { set mkgmap:road-speed-max = 5 } | |
39 | maxspeed=* & mkgmap:road-speed-max!=* & maxspeedkmh() <= 120 { set mkgmap:road-speed-max = 6 } | |
40 | # mkgmap:road-speed-max = 7 has no effect | |
41 | #maxspeed=* & mkgmap:road-speed-max!=* { set mkgmap:road-speed-max = 7 }⏎ |
166 | 166 | Sort sort = getConfig().getSort(); |
167 | 167 | List<SortKey<Mdr7Record>> sortedStreets = new ArrayList<>(allStreets.size()); |
168 | 168 | for (Mdr7Record m : allStreets) { |
169 | String partialName = m.getPartialName(); | |
170 | String name = m.getName(); | |
171 | SortKey<Mdr7Record> nameKey = sort.createSortKey(m, m.getName(), m.getMapIndex()); | |
172 | SortKey<Mdr7Record> partialKey = name.equals(partialName) ? nameKey : sort.createSortKey(m, partialName); | |
173 | MultiSortKey<Mdr7Record> sortKey = new MultiSortKey<>(partialKey, nameKey, null); | |
174 | sortedStreets.add(sortKey); | |
169 | sortedStreets.add(new MultiSortKey<>( | |
170 | sort.createSortKey(m, m.getPartialName()), | |
171 | sort.createSortKey(m, m.getInitialPart(), m.getMapIndex()), | |
172 | null)); | |
175 | 173 | } |
176 | 174 | Collections.sort(sortedStreets); |
177 | 175 |
68 | 68 | return city; |
69 | 69 | } |
70 | 70 | |
71 | public int getNameOffset() { | |
72 | return nameOffset & 0xff; | |
73 | } | |
74 | ||
71 | 75 | public void setNameOffset(byte nameOffset) { |
72 | 76 | this.nameOffset = nameOffset; |
73 | 77 | } |
108 | 112 | public String toString() { |
109 | 113 | return name + " in " + city.getName(); |
110 | 114 | } |
115 | ||
116 | public String getInitialPart() { | |
117 | return name.substring(0, (nameOffset & 0xff)); | |
118 | } | |
111 | 119 | } |
455 | 455 | Way cycleWay = new Way(way.getId(), way.getPoints()); |
456 | 456 | cycleWay.copyTags(way); |
457 | 457 | |
458 | String name = way.getTag("name"); | |
459 | if(name != null) | |
460 | name += " (cycleway)"; | |
461 | else | |
462 | name = "cycleway"; | |
463 | cycleWay.addTag("name", name); | |
464 | 458 | cycleWay.addTag("access", "no"); |
465 | 459 | cycleWay.addTag("bicycle", "yes"); |
466 | cycleWay.addTag("foot", "no"); | |
467 | 460 | cycleWay.addTag("mkgmap:synthesised", "yes"); |
468 | 461 | cycleWay.addTag(onewayTagKey, "no"); |
462 | // remove explicit access tags | |
463 | cycleWay.deleteTag("foot"); | |
464 | cycleWay.deleteTag("motorcar"); | |
465 | cycleWay.deleteTag("goods"); | |
466 | cycleWay.deleteTag("hgv"); | |
467 | cycleWay.deleteTag("bus"); | |
468 | cycleWay.deleteTag("taxi"); | |
469 | cycleWay.deleteTag("emergency"); | |
470 | cycleWay.deleteTag("vehicle"); | |
471 | cycleWay.deleteTag("motor_vehicle"); | |
472 | cycleWay.deleteTag("carpool"); | |
473 | cycleWay.deleteTag("motorcycle"); | |
474 | cycleWay.deleteTag("psv"); | |
475 | cycleWay.deleteTag("truck"); | |
469 | 476 | return cycleWay; |
470 | 477 | } |
471 | 478 |