Skip to content

Commit 28b6a3d

Browse files
authored
Merge pull request #291 from Project-OSRM/named_intersections
Named intersections
2 parents a4f5694 + 09a4b09 commit 28b6a3d

File tree

166 files changed

+5317
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+5317
-426
lines changed

index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,23 @@ module.exports = function(version) {
190190
var wayName = this.getWayName(language, step, options);
191191

192192
// Decide which instruction string to use
193-
// Destination takes precedence over name
193+
// In order of precedence:
194+
// - exit + destination signage
195+
// - destination signage
196+
// - exit signage
197+
// - junction name
198+
// - road name
199+
// - waypoint name (for arrive maneuver)
200+
// - default
194201
var instruction;
195202
if (step.destinations && step.exits && instructionObject.exit_destination) {
196203
instruction = instructionObject.exit_destination;
197204
} else if (step.destinations && instructionObject.destination) {
198205
instruction = instructionObject.destination;
199206
} else if (step.exits && instructionObject.exit) {
200207
instruction = instructionObject.exit;
208+
} else if (step.junction_name && instructionObject.junction_name) {
209+
instruction = instructionObject.junction_name;
201210
} else if (wayName && instructionObject.name) {
202211
instruction = instructionObject.name;
203212
} else if (options.waypointName && instructionObject.named) {
@@ -230,7 +239,8 @@ module.exports = function(version) {
230239
'modifier': instructions[language][version].constants.modifier[modifier],
231240
'direction': this.directionFromDegree(language, step.maneuver.bearing_after),
232241
'nth': nthWaypoint,
233-
'waypoint_name': options.waypointName
242+
'waypoint_name': options.waypointName,
243+
'junction_name': (step.junction_name || '').split(';')[0]
234244
};
235245

236246
return this.tokenize(language, instruction, replaceTokens, options);

languages/translations/ar.json

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,28 +131,33 @@
131131
},
132132
"sharp left": {
133133
"default": "انعطف يساراً حاداً",
134-
"name": "انعطف يساراً حاداً لتبقى على {way_name}",
135-
"destination": "انعطف يساراً حاداً نحو {destination}"
134+
"name": "انعطف يساراً حاداً لتبقى على {way_name}",
135+
"destination": "انعطف يساراً حاداً نحو {destination}",
136+
"junction_name": "انعطف يساراً حاداً لتبقى على {junction_name}"
136137
},
137138
"sharp right": {
138139
"default": "انعطف يمينا حاداً ",
139140
"name": "انعطف يميناً حاداً لتبقى على {way_name}",
140-
"destination": "انعطف يميناً حاداً نحو {destination}"
141+
"destination": "انعطف يميناً حاداً نحو {destination}",
142+
"junction_name": "انعطف يميناً حاداً لتبقى على {junction_name}"
141143
},
142144
"slight left": {
143145
"default": "انعطف يساراً قليلاً",
144-
"name": " انعطف يساراً قليلاً لتبقى على {way_name} ",
145-
"destination": "انعطف يساراً قليلاً نحو {destination}"
146+
"name": "انعطف يساراً قليلاً لتبقى على {way_name}",
147+
"destination": "انعطف يساراً قليلاً نحو {destination}",
148+
"junction_name": "انعطف يساراً قليلاً لتبقى على {junction_name}"
146149
},
147150
"slight right": {
148151
"default": "انعطف يميناً قليلاً",
149152
"name": "انعطف يميناً قليلاً لتبقى على {way_name}",
150-
"destination": "انعطف يميناً قليلاً نحو {destination} "
153+
"destination": "انعطف يميناً قليلاً نحو {destination}",
154+
"junction_name": "انعطف يميناً قليلاً نحو {junction_name}"
151155
},
152156
"uturn": {
153157
"default": "انعطف دوراناً عكسياً",
154158
"name": "انعطف دوراناً عكسياً وتابع نحو {way_name}",
155-
"destination": "انعطف دوراناً عكسياً نحو {destination}"
159+
"destination": "انعطف دوراناً عكسياً نحو {destination}",
160+
"junction_name": "انعطف دوراناً عكسياً وتابع نحو {junction_name}"
156161
}
157162
},
158163
"depart": {
@@ -166,17 +171,20 @@
166171
"default": {
167172
"default": "انعطف {modifier}ا",
168173
"name": "انعطف {modifier}ا على {way_name}",
169-
"destination": "انعطف {modifier}ا نحو {destination}"
174+
"destination": "انعطف {modifier}ا نحو {destination}",
175+
"junction_name": "انعطف {modifier}ا على {junction_name}"
170176
},
171177
"straight": {
172178
"default": "تابع قدماً",
173179
"name": "تابع إلى الأمام على {way_name}",
174-
"destination": "تابع قدماً نحو {destination}"
180+
"destination": "تابع قدماً نحو {destination}",
181+
"junction_name": "تابع إلى الأمام على {junction_name}"
175182
},
176183
"uturn": {
177184
"default": "انعطف دوراناً عكسياً عند نهاية الطريق",
178185
"name": "انعطف دوراناً عكسياً على {way_name} عند نهاية الطريق",
179-
"destination": "انعطف دوراناً عكسياً نحو {destination} عند نهاية الطريق"
186+
"destination": "انعطف دوراناً عكسياً نحو {destination} عند نهاية الطريق",
187+
"junction_name": "انعطف دوراناً عكسياً نحو {junction_name}"
180188
}
181189
},
182190
"fork": {
@@ -463,22 +471,26 @@
463471
"default": {
464472
"default": "انعطف نحو {modifier}",
465473
"name": "انعطف {modifier} على {way_name}",
466-
"destination": "انعطف {modifier} نحو {destination}"
474+
"destination": "انعطف {modifier} نحو {destination}",
475+
"junction_name": "انعطف {modifier} على {junction_name}"
467476
},
468477
"left": {
469478
"default": "انعطف يسارا",
470479
"name": "اسلك مسار الدوران يسارا على {way_name}",
471-
"destination": "انعطف يسارا نحو {destination}"
480+
"destination": "انعطف يسارا نحو {destination}",
481+
"junction_name": "اسلك مسار الدوران يسارا على {junction_name}"
472482
},
473483
"right": {
474484
"default": "انعطف يمينا",
475485
"name": "اسلك مسار الدوران يمينا على {way_name}",
476-
"destination": "انعطف يمينا نحو {destination}"
486+
"destination": "انعطف يمينا نحو {destination}",
487+
"junction_name": "اسلك مسار الدوران يمينا على {junction_name}"
477488
},
478489
"straight": {
479490
"default": "انطلق قدما",
480491
"name": "انطلق قدما على {way_name}",
481-
"destination": "انطلق قدما نحو {destination}"
492+
"destination": "انطلق قدما نحو {destination}",
493+
"junction_name": "انطلق قدما على {junction_name}"
482494
}
483495
},
484496
"use lane": {

languages/translations/da.json

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,32 @@
132132
"sharp left": {
133133
"default": "Drej skarpt til venstre",
134134
"name": "Drej skarpt til venstre videre ad {way_name}",
135-
"destination": "Drej skarpt til venstre mod {destination}"
135+
"destination": "Drej skarpt til venstre mod {destination}",
136+
"junction_name": "Drej skarpt til venstre videre ved {junction_name}"
136137
},
137138
"sharp right": {
138139
"default": "Drej skarpt til højre",
139140
"name": "Drej skarpt til højre videre ad {way_name}",
140-
"destination": "Drej skarpt til højre mod {destination}"
141+
"destination": "Drej skarpt til højre mod {destination}",
142+
"junction_name": "Drej skarpt til højre videre ved {junction_name}"
141143
},
142144
"slight left": {
143145
"default": "Drej let til venstre",
144146
"name": "Drej let til venstre videre ad {way_name}",
145-
"destination": "Drej let til venstre mod {destination}"
147+
"destination": "Drej let til venstre mod {destination}",
148+
"junction_name": "Drej let til venstre videre ved {junction_name}"
146149
},
147150
"slight right": {
148151
"default": "Drej let til højre",
149152
"name": "Drej let til højre videre ad {way_name}",
150-
"destination": "Drej let til højre mod {destination}"
153+
"destination": "Drej let til højre mod {destination}",
154+
"junction_name": "Drej let til højre videre ved {junction_name}"
151155
},
152156
"uturn": {
153157
"default": "Foretag en U-vending",
154158
"name": "Foretag en U-vending tilbage ad {way_name}",
155-
"destination": "Foretag en U-vending mod {destination}"
159+
"destination": "Foretag en U-vending mod {destination}",
160+
"junction_name": "Foretag en U-vending tilbage ved {junction_name}"
156161
}
157162
},
158163
"depart": {
@@ -166,17 +171,20 @@
166171
"default": {
167172
"default": "{modifier:turn}",
168173
"name": "{modifier:turn} ad {way_name}",
169-
"destination": "{modifier:turn} mod {destination}"
174+
"destination": "{modifier:turn} mod {destination}",
175+
"junction_name": "{modifier:turn} ved {junction_name}"
170176
},
171177
"straight": {
172178
"default": "Fortsæt ligeud",
173179
"name": "Fortsæt ligeud ad {way_name}",
174-
"destination": "Fortsæt ligeud mod {destination}"
180+
"destination": "Fortsæt ligeud mod {destination}",
181+
"junction_name": "Fortsæt ligeud ved {junction_name}"
175182
},
176183
"uturn": {
177184
"default": "Foretag en U-vending for enden af vejen",
178185
"name": "Foretag en U-vending ad {way_name} for enden af vejen",
179-
"destination": "Foretag en U-vending mod {destination} for enden af vejen"
186+
"destination": "Foretag en U-vending mod {destination} for enden af vejen",
187+
"junction_name": "Foretag en U-vending ved {junction_name}"
180188
}
181189
},
182190
"fork": {
@@ -463,22 +471,26 @@
463471
"default": {
464472
"default": "{modifier:turn}",
465473
"name": "{modifier:turn} ad {way_name}",
466-
"destination": "{modifier:turn} mod {destination}"
474+
"destination": "{modifier:turn} mod {destination}",
475+
"junction_name": "{modifier:turn} ved {junction_name}"
467476
},
468477
"left": {
469478
"default": "Drej til venstre",
470479
"name": "Drej til venstre ad {way_name}",
471-
"destination": "Drej til venstre mod {destination}"
480+
"destination": "Drej til venstre mod {destination}",
481+
"junction_name": "Drej til venstre ved {junction_name}"
472482
},
473483
"right": {
474484
"default": "Drej til højre",
475485
"name": "Drej til højre ad {way_name}",
476-
"destination": "Drej til højre mod {destination}"
486+
"destination": "Drej til højre mod {destination}",
487+
"junction_name": "Drej til højre ved {junction_name}"
477488
},
478489
"straight": {
479490
"default": "Kør ligeud",
480491
"name": "Kør ligeud ad {way_name}",
481-
"destination": "Kør ligeud mod {destination}"
492+
"destination": "Kør ligeud mod {destination}",
493+
"junction_name": "Kør ligeud ved {junction_name}"
482494
}
483495
},
484496
"use lane": {

languages/translations/de.json

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,32 @@
132132
"sharp left": {
133133
"default": "Scharf links",
134134
"name": "Scharf links weiterfahren auf {way_name}",
135-
"destination": "Scharf links Richtung {destination}"
135+
"destination": "Scharf links Richtung {destination}",
136+
"junction_name": "Scharf links weiterfahren an {junction_name}"
136137
},
137138
"sharp right": {
138139
"default": "Scharf rechts",
139140
"name": "Scharf rechts weiterfahren auf {way_name}",
140-
"destination": "Scharf rechts Richtung {destination}"
141+
"destination": "Scharf rechts Richtung {destination}",
142+
"junction_name": "Scharf rechts weiterfahren an {junction_name}"
141143
},
142144
"slight left": {
143145
"default": "Leicht links",
144146
"name": "Leicht links weiter auf {way_name}",
145-
"destination": "Leicht links weiter Richtung {destination}"
147+
"destination": "Leicht links weiter Richtung {destination}",
148+
"junction_name": "Leicht links weiter an {junction_name}"
146149
},
147150
"slight right": {
148151
"default": "Leicht rechts weiter",
149152
"name": "Leicht rechts weiter auf {way_name}",
150-
"destination": "Leicht rechts weiter Richtung {destination}"
153+
"destination": "Leicht rechts weiter Richtung {destination}",
154+
"junction_name": "Leicht rechts weiter an {junction_name}"
151155
},
152156
"uturn": {
153157
"default": "180°-Wendung",
154158
"name": "180°-Wendung auf {way_name}",
155-
"destination": "180°-Wendung Richtung {destination}"
159+
"destination": "180°-Wendung Richtung {destination}",
160+
"junction_name": "180°-Wendung an {junction_name}"
156161
}
157162
},
158163
"depart": {
@@ -166,24 +171,27 @@
166171
"default": {
167172
"default": "{modifier} abbiegen",
168173
"name": "{modifier} abbiegen auf {way_name}",
169-
"destination": "{modifier} abbiegen Richtung {destination}"
174+
"destination": "{modifier} abbiegen Richtung {destination}",
175+
"junction_name": "{modifier} abbiegen an {junction_name}"
170176
},
171177
"straight": {
172178
"default": "Geradeaus weiterfahren",
173179
"name": "Geradeaus weiterfahren auf {way_name}",
174-
"destination": "Geradeaus weiterfahren Richtung {destination}"
180+
"destination": "Geradeaus weiterfahren Richtung {destination}",
181+
"junction_name": "Geradeaus weiterfahren an {junction_name}"
175182
},
176183
"uturn": {
177184
"default": "180°-Wendung am Ende der Straße",
178185
"name": "180°-Wendung auf {way_name} am Ende der Straße",
179-
"destination": "180°-Wendung Richtung {destination} am Ende der Straße"
186+
"destination": "180°-Wendung Richtung {destination} am Ende der Straße",
187+
"junction_name": "180°-Wendung an {junction_name}"
180188
}
181189
},
182190
"fork": {
183191
"default": {
184192
"default": "{modifier} halten an der Gabelung",
185193
"name": "{modifier} halten an der Gabelung auf {way_name}",
186-
"destination": "{modifier} halten an der Gabelung Richtung {destination}"
194+
"destination": "{modifier} halten an der Gabelung Richtung {destination}"
187195
},
188196
"slight left": {
189197
"default": "Links halten an der Gabelung",
@@ -493,22 +501,26 @@
493501
"default": {
494502
"default": "{modifier} abbiegen",
495503
"name": "{modifier} abbiegen auf {way_name}",
496-
"destination": "{modifier} abbiegen Richtung {destination}"
504+
"destination": "{modifier} abbiegen Richtung {destination}",
505+
"junction_name": "Make a {modifier} at {junction_name}"
497506
},
498507
"left": {
499508
"default": "Links abbiegen",
500509
"name": "Links abbiegen auf {way_name}",
501-
"destination": "Links abbiegen Richtung {destination}"
510+
"destination": "Links abbiegen Richtung {destination}",
511+
"junction_name": "Links abbiegen an {junction_name}"
502512
},
503513
"right": {
504514
"default": "Rechts abbiegen",
505515
"name": "Rechts abbiegen auf {way_name}",
506-
"destination": "Rechts abbiegen Richtung {destination}"
516+
"destination": "Rechts abbiegen Richtung {destination}",
517+
"junction_name": "Rechts abbiegen an {junction_name}"
507518
},
508519
"straight": {
509520
"default": "Geradeaus weiterfahren",
510521
"name": "Geradeaus weiterfahren auf {way_name}",
511-
"destination": "Geradeaus weiterfahren Richtung {destination}"
522+
"destination": "Geradeaus weiterfahren Richtung {destination}",
523+
"junction_name": "Geradeaus weiterfahren an {junction_name}"
512524
}
513525
},
514526
"use lane": {

0 commit comments

Comments
 (0)