Changeset 32990 in osm for applications/editors/josm/plugins/pt_assistant
- Timestamp:
- 2016-09-12T01:51:38+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopUtils.java
r32791 r32990 7 7 * Utils class for stop areas 8 8 * 9 * @author 9 * @author 10 10 * 11 11 */ … … 16 16 } 17 17 18 19 18 /** 20 19 * Checks if a given relation is a stop_area. … … 35 34 return false; 36 35 } 37 36 38 37 /** 39 38 * Checks if a given object is a stop_position. … … 54 53 return false; 55 54 } 56 55 57 56 /** 58 57 * Checks if a given object is a platform. … … 68 67 } 69 68 70 if (rm.hasTag("public_transport", "platform")) { 69 if (rm.hasTag("public_transport", "platform") || rm.hasTag("highway", "bus_stop") 70 || rm.hasTag("highway", "platform") || rm.hasTag("railway", "platform")) { 71 71 return true; 72 72 } … … 74 74 } 75 75 76 77 76 /** 78 77 * Checks if a given object is part of an stop area relation … … 89 88 } 90 89 } 91 return false; 90 return false; 92 91 } 93 92 94 93 } -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssistantValidatorTest.java
r32963 r32990 123 123 } 124 124 125 125 126 // Do some testing on stop area relations 126 127 if (Main.pref.getBoolean("pt_assistant.stop-area-tests", true) == true && StopUtils.isStopArea(r)) { … … 141 142 this.errors.addAll(stopChecker.getErrors()); 142 143 } 144 143 145 144 146 if (!RouteUtils.isTwoDirectionRoute(r)) { -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/StopChecker.java
r32855 r32990 18 18 * Performs tests of the stop area relations 19 19 * 20 * @author 20 * @author 21 21 * 22 22 */ … … 27 27 protected StopChecker(Relation relation, Test test) { 28 28 super(relation, test); 29 29 30 30 this.members = relation.getMemberPrimitives(); 31 31 } 32 32 33 33 /** 34 34 * Checks if the given stop area relation has a stop position. 35 35 */ 36 36 protected void performStopAreaStopPositionTest() { 37 37 38 38 // No errors if there is a member tagged as stop position. 39 39 for (OsmPrimitive member : members) { … … 42 42 } 43 43 } 44 44 45 45 // Throw error message 46 46 List<OsmPrimitive> primitives = new ArrayList<>(1); … … 51 51 } 52 52 53 54 53 /** 55 54 * Checks if the given stop area relation has a platform. 56 55 */ 57 56 protected void performStopAreaPlatformTest() { 58 57 59 58 // No errors if there is a member tagged as platform. 60 59 for (OsmPrimitive member : members) { … … 63 62 } 64 63 } 65 64 66 65 // Throw error message 67 66 List<OsmPrimitive> primitives = new ArrayList<>(1); … … 70 69 PTAssistantValidatorTest.ERROR_CODE_STOP_AREA_NO_PLATFORM, primitives); 71 70 errors.add(e); 72 71 73 72 } 74 75 73 76 74 /** 77 * Checks if the stop_position(s) of an stop area belong to the same route relations as78 * its related platform(s). 75 * Checks if the stop_position(s) of an stop area belong to the same route 76 * relations as its related platform(s). 79 77 * 80 78 * @param n … … 85 83 HashMap<Long, Long> platformRelationIds = new HashMap<>(); 86 84 87 88 85 // Loop through all members 89 86 for (OsmPrimitive member : members) { 90 87 91 88 // For stop positions... 92 89 if (StopUtils.verifyStopAreaStopPosition(member)) { 93 90 94 91 // Create a list of assigned route relations 95 92 for (Relation referrer : OsmPrimitive.getFilteredList(member.getReferrers(), Relation.class)) { … … 99 96 } 100 97 } 101 98 102 99 // For platforms... 103 100 else if (StopUtils.verifyStopAreaPlatform(member)) { … … 109 106 } 110 107 } 111 } 108 } 112 109 } 113 110 114 111 // Check if the stop_position has no referrers at all. If it has no 115 112 // referrers, then no error should be reported (changed on 11.08.2016 by … … 123 120 return; 124 121 } 125 122 126 123 // Throw error message 127 124 List<OsmPrimitive> primitives = new ArrayList<>(1); … … 132 129 errors.add(e); 133 130 } 134 131 135 132 }
Note:
See TracChangeset
for help on using the changeset viewer.