Changeset 10141 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-04-11T22:06:50+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/PublicTransportRouteTest.java
r9937 r10141 5 5 6 6 import java.util.ArrayList; 7 import java.util.Arrays; 8 import java.util.HashSet; 7 9 import java.util.List; 10 import java.util.Set; 8 11 12 import org.openstreetmap.josm.data.osm.Node; 13 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 9 14 import org.openstreetmap.josm.data.osm.Relation; 10 15 import org.openstreetmap.josm.data.osm.RelationMember; … … 40 45 41 46 final List<RelationMember> membersToCheck = new ArrayList<>(); 47 final Set<Node> routeNodes = new HashSet<>(); 42 48 for (RelationMember member : r.getMembers()) { 43 49 if (member.hasRole("forward", "backward")) { 44 50 errors.add(new TestError(this, Severity.WARNING, tr("Route relation contains a ''{0}'' role", "forward/backward"), 3601, r)); 45 51 return; 46 } else if (member.hasRole("") ) {52 } else if (member.hasRole("") && OsmPrimitiveType.WAY.equals(member.getType())) { 47 53 membersToCheck.add(member); 54 routeNodes.addAll(member.getWay().getNodes()); 48 55 } 49 56 } … … 65 72 } 66 73 74 for (RelationMember member : r.getMembers()) { 75 if (member.hasRole("stop", "stop_exit_only", "stop_entry_only") 76 && OsmPrimitiveType.NODE.equals(member.getType()) 77 && !routeNodes.contains(member.getNode())) { 78 errors.add(new TestError(this, Severity.WARNING, tr("Stop position not part of route"), 3603, Arrays.asList(member.getMember(), r))); 79 } 80 } 81 67 82 } 68 83 }
Note:
See TracChangeset
for help on using the changeset viewer.