Use destination:ref where is possible

This commit is contained in:
Victor Shcherb 2014-12-10 00:27:03 +01:00
parent f3cc0eb94b
commit d43d5255c1
2 changed files with 9 additions and 2 deletions

View file

@ -200,6 +200,7 @@ public class BinaryMapRouteReaderAdapter {
int nameTypeRule = -1;
int refTypeRule = -1;
int destinationTypeRule = -1;
int destinationRefTypeRule = -1;
public RouteTypeRule quickGetEncodingRule(int id) {
return routeEncodingRules.get(id);
@ -216,6 +217,8 @@ public class BinaryMapRouteReaderAdapter {
refTypeRule = id;
} else if (tags.equals("destination")) {
destinationTypeRule = id;
} else if (tags.equals("destination:ref")) {
destinationRefTypeRule = id;
}
}

View file

@ -66,14 +66,18 @@ public class RouteDataObject {
}
public String getRef(){
if(names != null ) {
if (names != null) {
String ref = names.get(region.destinationRefTypeRule);
if (ref != null) {
return ref;
}
return names.get(region.refTypeRule);
}
return null;
}
public String getDestinationName(){
if(names != null ) {
if(names != null) {
return names.get(region.destinationTypeRule);
}
return null;