Changeset 32297 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-06-17T01:39:18+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant
- Files:
-
- 5 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
r32296 r32297 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")){70 68 return true; 71 69 } else { -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java
r32296 r32297 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 the15 * list of already assigned stops, (2) checks if the stop has a stop position,16 * (3) calculates it using proximity / growing bounding boxes17 *18 * @author darya19 *20 */21 13 public final class StopToWayAssigner { 22 14 … … 31 23 return stopToWay.get(stop.getId()); 32 24 } 25 33 26 27 28 34 29 if (stop.getType().equals(OsmPrimitiveType.NODE)) { 35 30 List<OsmPrimitive> referrers = stop.getReferrers(); 36 31 List<Way> referredWays = new ArrayList<>(); 37 for (OsmPrimitive referrer 32 for (OsmPrimitive referrer: referrers) { 38 33 if (referrer.getType().equals(OsmPrimitiveType.WAY)) { 39 referredWays.add((Way) 34 referredWays.add((Way)referrer); 40 35 } 41 36 } … … 50 45 return null; 51 46 } 52 47 53 48 /** 54 49 * Remove a map entry 55 *56 50 * @param stopId 57 51 */ -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java
r32296 r32297 19 19 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; 20 20 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 { 21 public class RouteChecker { 28 22 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 29 32 private boolean hasGap; 30 33 31 34 List<RelationMember> sortedMembers; 32 35 33 public RouteChecker(Relation r elation, Test test) {36 public RouteChecker(Relation r, Test t) { 34 37 35 super(relation, test); 36 38 this.test = t; 39 this.relation = r; 40 37 41 this.hasGap = false; 38 42 … … 56 60 57 61 if (hasGap(waysToCheck)) { 58 62 59 63 this.hasGap = true; 60 64 61 65 RelationSorter sorter = new RelationSorter(); 62 66 sortedMembers = sorter.sortMembers(waysToCheck); … … 99 103 } 100 104 105 /** 106 * Returns errors 107 */ 108 public List<TestError> getErrors() { 109 110 return errors; 111 } 112 101 113 public List<RelationMember> getSortedMembers() { 102 114 … … 104 116 105 117 } 106 118 107 119 public boolean getHasGap() { 108 120 109 121 return this.hasGap; 110 122 111 123 } 112 124 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java
r32296 r32297 19 19 20 20 /** 21 * Performs t ests of a route at the level of single ways: DirectionTest and RoadTypeTest21 * Performs the DirectionTest and RoadTypeTest at the level of single ways 22 22 * 23 23 * @author darya 24 24 * 25 25 */ 26 public class WayChecker extends Checker{26 public class WayChecker { 27 27 28 public WayChecker(Relation relation, Test test) { 28 // test which created this WayChecker: 29 private final Test test; 29 30 30 super(relation, test); 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; 31 44 32 45 this.performDirectionTest(); … … 147 160 } 148 161 162 public List<TestError> getErrors() { 163 164 return errors; 165 } 166 149 167 /** 150 168 * Checks if the type of the way is suitable for buses to go on it. The -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java
r32296 r32297 1 package unit.org.openstreetmap.josm.plugins.pt_assistant;1 package org.openstreetmap.josm.plugins.pt_assistant; 2 2 3 3 import org.junit.BeforeClass; … … 36 36 public static final String PATH_TO_PLATFORM_AS_WAY = "test/data/route-with-platform-as-way.osm"; 37 37 38 public static final String PATH_TO_ROUNDABOUT_ONEWAY = "test/data/duesseldorf_roundabout.osm";39 40 public static final String PATH_TO_ROAD_TYPE_ERROR = "test/data/road-type.osm";41 38 42 39 -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/ImportUtils.java
r32296 r32297 1 package unit.org.openstreetmap.josm.plugins.pt_assistant;1 package org.openstreetmap.josm.plugins.pt_assistant; 2 2 3 3 /** -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/TestUtil.java
r32296 r32297 1 package unit.org.openstreetmap.josm.plugins.pt_assistant;1 package org.openstreetmap.josm.plugins.pt_assistant; 2 2 3 3 import static org.junit.Assert.assertEquals; -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/GapTestTest.java
r32296 r32297 1 package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;1 package org.openstreetmap.josm.plugins.pt_assistant.validation; 2 2 3 3 import static org.junit.Assert.assertEquals; … … 12 12 import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest; 13 13 14 import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;15 import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;14 import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; 15 import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils; 16 16 17 17 public class GapTestTest extends AbstractTest { -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformAsWayTest.java
r32296 r32297 1 package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;1 package org.openstreetmap.josm.plugins.pt_assistant.validation; 2 2 3 3 import static org.junit.Assert.assertEquals; … … 12 12 import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest; 13 13 14 import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;15 import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;14 import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; 15 import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils; 16 16 17 17 public class PlatformAsWayTest extends AbstractTest{ -
applications/editors/josm/plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/validation/PlatformsFirstTestTest.java
r32296 r32297 1 package unit.org.openstreetmap.josm.plugins.pt_assistant.validation;1 package org.openstreetmap.josm.plugins.pt_assistant.validation; 2 2 3 3 import static org.junit.Assert.assertEquals; … … 12 12 import org.openstreetmap.josm.plugins.pt_assistant.validation.PlatformsFirstTest; 13 13 14 import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;15 import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;14 import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; 15 import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils; 16 16 17 17 public class PlatformsFirstTestTest extends AbstractTest {
Note:
See TracChangeset
for help on using the changeset viewer.