Ignore:
Timestamp:
2016-06-17T01:39:18+02:00 (8 years ago)
Author:
darya
Message:

Fix bad commit

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  
    6666                if (rm.getType().equals(OsmPrimitiveType.RELATION)) {
    6767                        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")){
    7068                                return true;
    7169                        } else {
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java

    r32296 r32297  
    1111import org.openstreetmap.josm.data.osm.Way;
    1212
    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  */
    2113public final class StopToWayAssigner {
    2214
     
    3123                        return stopToWay.get(stop.getId());
    3224                }
     25               
    3326
     27               
     28               
    3429                if (stop.getType().equals(OsmPrimitiveType.NODE)) {
    3530                        List<OsmPrimitive> referrers = stop.getReferrers();
    3631                        List<Way> referredWays = new ArrayList<>();
    37                         for (OsmPrimitive referrer : referrers) {
     32                        for (OsmPrimitive referrer: referrers) {
    3833                                if (referrer.getType().equals(OsmPrimitiveType.WAY)) {
    39                                         referredWays.add((Way) referrer);
     34                                        referredWays.add((Way)referrer);
    4035                                }
    4136                        }
     
    5045                return null;
    5146        }
    52 
     47       
    5348        /**
    5449         * Remove a map entry
    55          *
    5650         * @param stopId
    5751         */
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java

    r32296 r32297  
    1919import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils;
    2020
    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 {
     21public class RouteChecker {
    2822
     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       
    2932        private boolean hasGap;
    3033
    3134        List<RelationMember> sortedMembers;
    3235
    33         public RouteChecker(Relation relation, Test test) {
     36        public RouteChecker(Relation r, Test t) {
    3437
    35                 super(relation, test);
    36 
     38                this.test = t;
     39                this.relation = r;
     40               
    3741                this.hasGap = false;
    3842
     
    5660
    5761                if (hasGap(waysToCheck)) {
    58 
     62                       
    5963                        this.hasGap = true;
    60 
     64                       
    6165                        RelationSorter sorter = new RelationSorter();
    6266                        sortedMembers = sorter.sortMembers(waysToCheck);
     
    99103        }
    100104
     105        /**
     106         * Returns errors
     107         */
     108        public List<TestError> getErrors() {
     109
     110                return errors;
     111        }
     112
    101113        public List<RelationMember> getSortedMembers() {
    102114
     
    104116
    105117        }
    106 
     118       
    107119        public boolean getHasGap() {
    108 
     120               
    109121                return this.hasGap;
    110 
     122               
    111123        }
    112124
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java

    r32296 r32297  
    1919
    2020/**
    21  * Performs tests of a route at the level of single ways: DirectionTest and RoadTypeTest
     21 * Performs the DirectionTest and RoadTypeTest at the level of single ways
    2222 *
    2323 * @author darya
    2424 *
    2525 */
    26 public class WayChecker extends Checker {
     26public class WayChecker {
    2727
    28         public WayChecker(Relation relation, Test test) {
     28        // test which created this WayChecker:
     29        private final Test test;
    2930
    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;
    3144
    3245                this.performDirectionTest();
     
    147160        }
    148161
     162        public List<TestError> getErrors() {
     163
     164                return errors;
     165        }
     166
    149167        /**
    150168         * 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;
     1package org.openstreetmap.josm.plugins.pt_assistant;
    22
    33import org.junit.BeforeClass;
     
    3636 public static final String PATH_TO_PLATFORM_AS_WAY = "test/data/route-with-platform-as-way.osm";
    3737 
    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";
    4138 
    4239 
  • 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;
     1package org.openstreetmap.josm.plugins.pt_assistant;
    22
    33/**
  • 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;
     1package org.openstreetmap.josm.plugins.pt_assistant;
    22
    33import 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;
     1package org.openstreetmap.josm.plugins.pt_assistant.validation;
    22
    33import static org.junit.Assert.assertEquals;
     
    1212import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest;
    1313
    14 import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
    15 import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
     14import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
     15import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
    1616
    1717public 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;
     1package org.openstreetmap.josm.plugins.pt_assistant.validation;
    22
    33import static org.junit.Assert.assertEquals;
     
    1212import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest;
    1313
    14 import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
    15 import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
     14import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
     15import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
    1616
    1717public 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;
     1package org.openstreetmap.josm.plugins.pt_assistant.validation;
    22
    33import static org.junit.Assert.assertEquals;
     
    1212import org.openstreetmap.josm.plugins.pt_assistant.validation.PlatformsFirstTest;
    1313
    14 import unit.org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
    15 import unit.org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
     14import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest;
     15import org.openstreetmap.josm.plugins.pt_assistant.ImportUtils;
    1616
    1717public class PlatformsFirstTestTest extends AbstractTest {
Note: See TracChangeset for help on using the changeset viewer.