Skip to content

Commit 0196265

Browse files
show route type in route relation display name
This displays e.g. `hiking route ("foo-bar")` instead of just `route ("foo-bar")`, making it easier to distinguish different route relations.
1 parent 1f6a262 commit 0196265

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,12 @@ public Comparator<IRelation<?>> getRelationComparator() {
410410

411411
private static String getRelationTypeName(IRelation<?> relation) {
412412
// see https://josm.openstreetmap.de/browser/osm/applications/editors/josm/i18n/specialmessages.java
413-
String name = trc("Relation type", relation.get("type"));
413+
String type = relation.get("type");
414+
String name = trc("Relation type", type);
415+
String route = trc("Route type", relation.get("route"));
416+
if (type != null && type.equals("route") && route != null) {
417+
name = route + " " + name;
418+
}
414419
if (name == null) {
415420
name = relation.hasKey("public_transport") ? tr("public transport") : null;
416421
}

0 commit comments

Comments
 (0)