Changeset 32299 in osm for applications/editors/josm/plugins/pt_assistant/src/org
- Timestamp:
- 2016-06-17T19:05:12+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
r32297 r32299 66 66 if (rm.getType().equals(OsmPrimitiveType.RELATION)) { 67 67 if (rm.getRole().equals("stop_area")) { 68 return true; 69 } else if (rm.getRole().equals("platform") || rm.getRole().equals("platform_entry_only") || rm.getRole().equals("platform_exit_only")){ 68 70 return true; 69 71 } else { -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java
r32297 r32299 11 11 import org.openstreetmap.josm.data.osm.Way; 12 12 13 /** 14 * Assigns stops to ways in following steps: (1) checks if the stop is in the 15 * list of already assigned stops, (2) checks if the stop has a stop position, 16 * (3) calculates it using proximity / growing bounding boxes 17 * 18 * @author darya 19 * 20 */ 13 21 public final class StopToWayAssigner { 14 22 … … 23 31 return stopToWay.get(stop.getId()); 24 32 } 25 26 33 27 28 29 34 if (stop.getType().equals(OsmPrimitiveType.NODE)) { 30 35 List<OsmPrimitive> referrers = stop.getReferrers(); 31 36 List<Way> referredWays = new ArrayList<>(); 32 for (OsmPrimitive referrer : referrers) {37 for (OsmPrimitive referrer : referrers) { 33 38 if (referrer.getType().equals(OsmPrimitiveType.WAY)) { 34 referredWays.add((Way) referrer);39 referredWays.add((Way) referrer); 35 40 } 36 41 } … … 45 50 return null; 46 51 } 47 52 48 53 /** 49 54 * Remove a map entry 55 * 50 56 * @param stopId 51 57 */ -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java
r32297 r32299 19 19 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; 20 20 21 public class RouteChecker { 21 /** 22 * Performs tests of a route at the level of the whole route: sorting test 23 * 24 * @author darya 25 * 26 */ 27 public class RouteChecker extends Checker { 22 28 23 // test which created this WayChecker:24 private final Test test;25 26 // relation that is checked:27 private Relation relation;28 29 // stores all found errors (on way level):30 private ArrayList<TestError> errors = new ArrayList<>();31 32 29 private boolean hasGap; 33 30 34 31 List<RelationMember> sortedMembers; 35 32 36 public RouteChecker(Relation r , Testt) {33 public RouteChecker(Relation relation, Test test) { 37 34 38 this.test = t; 39 this.relation = r; 40 35 super(relation, test); 36 41 37 this.hasGap = false; 42 38 … … 60 56 61 57 if (hasGap(waysToCheck)) { 62 58 63 59 this.hasGap = true; 64 60 65 61 RelationSorter sorter = new RelationSorter(); 66 62 sortedMembers = sorter.sortMembers(waysToCheck); … … 103 99 } 104 100 105 /**106 * Returns errors107 */108 public List<TestError> getErrors() {109 110 return errors;111 }112 113 101 public List<RelationMember> getSortedMembers() { 114 102 … … 116 104 117 105 } 118 106 119 107 public boolean getHasGap() { 120 108 121 109 return this.hasGap; 122 110 123 111 } 124 112 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java
r32297 r32299 19 19 20 20 /** 21 * Performs t he DirectionTest and RoadTypeTest at the level of single ways21 * Performs tests of a route at the level of single ways: DirectionTest and RoadTypeTest 22 22 * 23 23 * @author darya 24 24 * 25 25 */ 26 public class WayChecker {26 public class WayChecker extends Checker { 27 27 28 // test which created this WayChecker: 29 private final Test test; 28 public WayChecker(Relation relation, Test test) { 30 29 31 // relation that is checked: 32 private Relation relation; 33 34 // stores all found errors (on way level): 35 private ArrayList<TestError> errors = new ArrayList<>(); 36 37 // stores all ways that were found wrong and need to be removed: 38 private ArrayList<Way> wrongWays = new ArrayList<>(); 39 40 public WayChecker(Relation r, Test test) { 41 42 this.test = test; 43 this.relation = r; 30 super(relation, test); 44 31 45 32 this.performDirectionTest(); … … 160 147 } 161 148 162 public List<TestError> getErrors() {163 164 return errors;165 }166 167 149 /** 168 150 * Checks if the type of the way is suitable for buses to go on it. The
Note:
See TracChangeset
for help on using the changeset viewer.