Adjust number of lanes displayed for both way roads

This commit is contained in:
Victor Shcherb 2012-10-10 01:53:36 +02:00
parent 1a84122417
commit f69fecacea
2 changed files with 14 additions and 0 deletions

View file

@ -47,6 +47,8 @@ public class MapRoutingTypes {
TAGS_TO_SAVE.add("hgv"); TAGS_TO_SAVE.add("hgv");
TAGS_TO_SAVE.add("horse"); TAGS_TO_SAVE.add("horse");
TAGS_TO_SAVE.add("lanes"); TAGS_TO_SAVE.add("lanes");
TAGS_TO_SAVE.add("lanes:forward");
TAGS_TO_SAVE.add("lanes:backward");
TAGS_TO_SAVE.add("maxspeed"); TAGS_TO_SAVE.add("maxspeed");
TAGS_TO_SAVE.add("maxweight"); TAGS_TO_SAVE.add("maxweight");
TAGS_TO_SAVE.add("minspeed"); TAGS_TO_SAVE.add("minspeed");

View file

@ -1082,6 +1082,9 @@ public class BinaryRoutePlanner {
boolean kr = false; boolean kr = false;
List<RouteSegmentResult> attachedRoutes = rr.getAttachedRoutes(rr.getStartPointIndex()); List<RouteSegmentResult> attachedRoutes = rr.getAttachedRoutes(rr.getStartPointIndex());
int ls = prev.getObject().getLanes(); int ls = prev.getObject().getLanes();
if(ls >= 0 && prev.getObject().getOneway() == 0) {
ls = (ls + 1) / 2;
}
int left = 0; int left = 0;
int right = 0; int right = 0;
boolean speak = false; boolean speak = false;
@ -1095,6 +1098,9 @@ public class BinaryRoutePlanner {
if ((ex < TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex >= 0) { if ((ex < TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex >= 0) {
kl = true; kl = true;
int lns = rs.getObject().getLanes(); int lns = rs.getObject().getLanes();
if(rs.getObject().getOneway() == 0) {
lns = (lns + 1) / 2;
}
if (lns > 0) { if (lns > 0) {
right += lns; right += lns;
} }
@ -1102,6 +1108,9 @@ public class BinaryRoutePlanner {
} else if ((ex > -TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex <= 0) { } else if ((ex > -TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex <= 0) {
kr = true; kr = true;
int lns = rs.getObject().getLanes(); int lns = rs.getObject().getLanes();
if(rs.getObject().getOneway() == 0) {
lns = (lns + 1) / 2;
}
if (lns > 0) { if (lns > 0) {
left += lns; left += lns;
} }
@ -1116,6 +1125,9 @@ public class BinaryRoutePlanner {
right = 1; right = 1;
} }
int current = rr.getObject().getLanes(); int current = rr.getObject().getLanes();
if(rr.getObject().getOneway() == 0) {
current = (current + 1) / 2;
}
if (current <= 0) { if (current <= 0) {
current = 1; current = 1;
} }