Changeset 32417 in osm for applications/editors/josm/plugins/pt_assistant
- Timestamp:
- 2016-06-27T13:43:11+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RoadTypeTest.java
r32415 r32417 49 49 // be a route of public_transport:version 2 50 50 boolean isCorrectRoadType = true; 51 boolean isUnderConstruction = false; 52 51 53 if (r.hasTag("route", "bus") || r.hasTag("route", "share_taxi")) { 52 54 if (!RouteUtils.isWaySuitableForBuses(way)) { 53 55 isCorrectRoadType = false; 54 56 } 57 if (way.hasTag("highway", "construction") && way.hasKey("construction")) { 58 isUnderConstruction = true; 59 } 55 60 } else if (r.hasTag("route", "trolleybus")) { 56 61 if (!(RouteUtils.isWaySuitableForBuses(way) && way.hasTag("trolley_wire", "yes"))) { 57 62 isCorrectRoadType = false; 58 63 } 64 if (way.hasTag("highway", "construction") && way.hasKey("construction")) { 65 isUnderConstruction = true; 66 } 59 67 } else if (r.hasTag("route", "tram")) { 60 68 if (!way.hasTag("railway", "tram")) { 61 69 isCorrectRoadType = false; 62 70 } 71 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 72 isUnderConstruction = true; 73 } 63 74 } else if (r.hasTag("route", "subway")) { 64 75 if (!r.hasTag("railway", "subway")) { 65 76 isCorrectRoadType = false; 66 77 } 78 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 79 isUnderConstruction = true; 80 } 67 81 } else if (r.hasTag("route", "light_rail")) { 68 82 if (!r.hasTag("raiilway", "subway")) { 69 83 isCorrectRoadType = false; 70 84 } 85 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 86 isUnderConstruction = true; 87 } 71 88 } else if (r.hasTag("route", "light_rail")) { 72 89 if (!r.hasTag("railway", "light_rail")) { 73 90 isCorrectRoadType = false; 74 91 } 92 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 93 isUnderConstruction = true; 94 } 75 95 } else if (r.hasTag("route", "train")) { 76 96 if (!r.hasTag("railway", "train")) { 77 97 isCorrectRoadType = false; 78 98 } 79 } 80 81 if (!isCorrectRoadType) { 99 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 100 isUnderConstruction = true; 101 } 102 } 103 104 if (!isCorrectRoadType && !isUnderConstruction) { 82 105 83 106 List<Relation> primitives = new ArrayList<>(1); … … 90 113 } 91 114 92 if ( (way.hasTag("highway", "construction") || way.hasTag("railway", "construction")) && way.hasKey("construction")) {115 if (isUnderConstruction) { 93 116 List<Relation> primitives = new ArrayList<>(1); 94 117 primitives.add(r); -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java
r32415 r32417 53 53 54 54 boolean isCorrectRoadType = true; 55 boolean isUnderConstruction = false; 55 56 if (relation.hasTag("route", "bus") || relation.hasTag("route", "share_taxi")) { 56 57 if (!isWaySuitableForBuses(way)) { 57 58 isCorrectRoadType = false; 58 59 } 60 if (way.hasTag("highway", "construction") && way.hasKey("construction")) { 61 isUnderConstruction = true; 62 } 59 63 } else if (relation.hasTag("route", "trolleybus")) { 60 64 if (!(isWaySuitableForBuses(way) && way.hasTag("trolley_wire", "yes"))) { 61 65 isCorrectRoadType = false; 62 66 } 67 if (way.hasTag("highway", "construction") && way.hasKey("construction")) { 68 isUnderConstruction = true; 69 } 63 70 } else if (relation.hasTag("route", "tram")) { 64 71 if (!way.hasTag("railway", "tram")) { 65 72 isCorrectRoadType = false; 66 73 } 74 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 75 isUnderConstruction = true; 76 } 67 77 } else if (relation.hasTag("route", "subway")) { 68 78 if (!relation.hasTag("railway", "subway")) { 69 79 isCorrectRoadType = false; 70 80 } 81 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 82 isUnderConstruction = true; 83 } 71 84 } else if (relation.hasTag("route", "light_rail")) { 72 85 if (!relation.hasTag("raiilway", "subway")) { 73 86 isCorrectRoadType = false; 74 87 } 88 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 89 isUnderConstruction = true; 90 } 75 91 } else if (relation.hasTag("route", "light_rail")) { 76 92 if (!relation.hasTag("railway", "light_rail")) { 77 93 isCorrectRoadType = false; 78 94 } 95 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 96 isUnderConstruction = true; 97 } 79 98 } else if (relation.hasTag("route", "train")) { 80 99 if (!relation.hasTag("railway", "train")) { 81 100 isCorrectRoadType = false; 82 101 } 83 } 84 85 if (!isCorrectRoadType) { 102 if (way.hasTag("railway", "construction") && way.hasKey("construction")) { 103 isUnderConstruction = true; 104 } 105 } 106 107 if (!isCorrectRoadType && !isUnderConstruction) { 86 108 87 109 List<Relation> primitives = new ArrayList<>(1); … … 96 118 } 97 119 98 if ( (way.hasTag("highway", "construction") || way.hasTag("railway", "construction")) && way.hasKey("construction")) {120 if (isUnderConstruction) { 99 121 List<Relation> primitives = new ArrayList<>(1); 100 122 primitives.add(relation);
Note:
See TracChangeset
for help on using the changeset viewer.