Ignore:
Timestamp:
2016-06-06T16:59:05+02:00 (8 years ago)
Author:
darya
Message:

RoadTypeTest added with a fix

Location:
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java

    r32209 r32221  
    77import org.openstreetmap.josm.plugins.pt_assistant.validation.GapTest;
    88import org.openstreetmap.josm.plugins.pt_assistant.validation.PlatformsFirstTest;
     9import org.openstreetmap.josm.plugins.pt_assistant.validation.RoadTypeTest;
    910
    1011/**
     
    2728
    2829                OsmValidator.addTest(PlatformsFirstTest.class);
     30                OsmValidator.addTest(RoadTypeTest.class);
    2931                OsmValidator.addTest(GapTest.class);
    3032
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java

    r32219 r32221  
    5858         * can be modeled with ways.
    5959         *
    60          * @param rm relation member to be checked
    61          * @return true if the relation member refers to a way in a public transport route, false otherwise.
     60         * @param rm
     61         *            relation member to be checked
     62         * @return true if the relation member refers to a way in a public transport
     63         *         route, false otherwise.
    6264         */
    6365        public static boolean isPTWay(RelationMember rm) {
     
    7476        }
    7577
     78        /**
     79         * Checks if the type of the way is suitable for buses to go on it. The
     80         * direction of the way (i.e. one-way roads) is irrelevant for this test.
     81         *
     82         * @param way
     83         *            to be checked
     84         * @return true if the way is suitable for buses, false otherwise.
     85         */
     86        public static boolean isWaySuitableForBuses(Way way) {
     87                if (way.hasTag("highway", "motorway") || way.hasTag("highway", "trunk") || way.hasTag("highway", "primary")
     88                                || way.hasTag("highway", "secondary") || way.hasTag("highway", "tertiary")
     89                                || way.hasTag("highway", "unclassified") || way.hasTag("highway", "road")
     90                                || way.hasTag("highway", "residential") || way.hasTag("highway", "service")
     91                                || way.hasTag("highway", "motorway_link") || way.hasTag("highway", "trunk_link")
     92                                || way.hasTag("highway", "primary_link") || way.hasTag("highway", "secondary_link")
     93                                || way.hasTag("highway", "tertiary_link") || way.hasTag("highway", "living_street")
     94                                || way.hasTag("highway", "bus_guideway") || way.hasTag("highway", "road")
     95                                || way.hasTag("cycleway", "share_busway") || way.hasTag("cycleway", "shared_lane")) {
     96                        return true;
     97                }
     98
     99                return false;
     100        }
     101
     102
    76103}
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/GapTest.java

    r32219 r32221  
    177177                                        final List<RelationMember> ways = new ArrayList<>();
    178178                                        for (RelationMember member : members) {
    179                                                 if (member.hasRole("") && OsmPrimitiveType.WAY.equals(member.getType())) {
     179                                                if (member.hasRole("") && OsmPrimitiveType.WAY.equals(member.getType())) { // FIXME
    180180                                                        ways.add(member);
    181181                                                } else { // stops (and if the relation has anything
Note: See TracChangeset for help on using the changeset viewer.