Skip to content

Commit 8dd2509

Browse files
committed
call oneWay satisfiability in mend action
1 parent c4d384e commit 8dd2509

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/org/openstreetmap/josm/plugins/pt_assistant/actions/MendRelationAction.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,9 +1041,7 @@ List<Way> removeInvalidWaysFromParentWays(List<Way> parentWays, Node node, Way w
10411041
// one way direction doesn't match
10421042
for (Way w : parentWays) {
10431043
if (w.isOneway() != 0) {
1044-
if (w.isOneway() == 1 && w.lastNode().equals(node)) {
1045-
waysToBeRemoved.add(w);
1046-
} else if (w.isOneway() == -1 && w.firstNode().equals(node)) {
1044+
if (checkOneWaySatisfiability(w, node)) {
10471045
waysToBeRemoved.add(w);
10481046
}
10491047
}
@@ -1092,7 +1090,6 @@ List<Way> removeInvalidWaysFromParentWays(List<Way> parentWays, Node node, Way w
10921090
waysToBeRemoved.clear();
10931091

10941092
// check restrictions
1095-
System.out.println("Hello");
10961093
for (Way w : parentWays) {
10971094
if (isRestricted(w, way, node)) {
10981095
waysToBeRemoved.add(w);
@@ -1113,9 +1110,7 @@ List<Way> removeInvalidWaysFromParentWaysOfRoundabouts(List<Way> parents, Node n
11131110
// one way direction doesn't match
11141111
for (Way w : parentWays) {
11151112
if (w.isOneway() != 0) {
1116-
if (w.isOneway() == 1 && w.lastNode().equals(node)) {
1117-
waysToBeRemoved.add(w);
1118-
} else if (w.isOneway() == -1 && w.firstNode().equals(node)) {
1113+
if (checkOneWaySatisfiability(w, node)) {
11191114
waysToBeRemoved.add(w);
11201115
}
11211116
}
@@ -1460,7 +1455,7 @@ boolean checkOneWaySatisfiability(Way way, Node node) {
14601455
String[] acceptedTags = new String[] { "yes", "designated" };
14611456

14621457
if ((way.hasTag("oneway:bus", acceptedTags) || way.hasTag("oneway:psv", acceptedTags))
1463-
&& way.lastNode().equals(node))
1458+
&& way.lastNode().equals(node) && relation.hasTag("route", "bus"))
14641459
return false;
14651460

14661461
if (!isNonSplitRoundAbout(way) && way.hasTag("junction", "roundabout")) {

0 commit comments

Comments
 (0)