Ignore:
Timestamp:
2016-09-12T01:51:38+02:00 (8 years ago)
Author:
darya
Message:

changed platform definition in StopUtils

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  
    77 * Utils class for stop areas
    88 *
    9  * @author 
     9 * @author
    1010 *
    1111 */
     
    1616        }
    1717
    18        
    1918        /**
    2019         * Checks if a given relation is a stop_area.
     
    3534                return false;
    3635        }
    37        
     36
    3837        /**
    3938         * Checks if a given object is a stop_position.
     
    5453                return false;
    5554        }
    56        
     55
    5756        /**
    5857         * Checks if a given object is a platform.
     
    6867                }
    6968
    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")) {
    7171                        return true;
    7272                }
     
    7474        }
    7575
    76        
    7776        /**
    7877         * Checks if a given object is part of an stop area relation
     
    8988                        }
    9089                }
    91         return false;
     90                return false;
    9291        }
    93        
     92
    9493}
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssistantValidatorTest.java

    r32963 r32990  
    123123                }
    124124               
     125               
    125126                // Do some testing on stop area relations
    126127                if (Main.pref.getBoolean("pt_assistant.stop-area-tests", true) == true && StopUtils.isStopArea(r)) {
     
    141142                        this.errors.addAll(stopChecker.getErrors());
    142143                }
     144               
    143145
    144146                if (!RouteUtils.isTwoDirectionRoute(r)) {
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/StopChecker.java

    r32855 r32990  
    1818 * Performs tests of the stop area relations
    1919 *
    20  * @author 
     20 * @author
    2121 *
    2222 */
     
    2727        protected StopChecker(Relation relation, Test test) {
    2828                super(relation, test);
    29                
     29
    3030                this.members = relation.getMemberPrimitives();
    3131        }
    32        
     32
    3333        /**
    3434         * Checks if the given stop area relation has a stop position.
    3535         */
    3636        protected void performStopAreaStopPositionTest() {
    37                
     37
    3838                // No errors if there is a member tagged as stop position.
    3939                for (OsmPrimitive member : members) {
     
    4242                        }
    4343                }
    44                
     44
    4545                // Throw error message
    4646                List<OsmPrimitive> primitives = new ArrayList<>(1);
     
    5151        }
    5252
    53        
    5453        /**
    5554         * Checks if the given stop area relation has a platform.
    5655         */
    5756        protected void performStopAreaPlatformTest() {
    58                
     57
    5958                // No errors if there is a member tagged as platform.
    6059                for (OsmPrimitive member : members) {
     
    6362                        }
    6463                }
    65                
     64
    6665                // Throw error message
    6766                List<OsmPrimitive> primitives = new ArrayList<>(1);
     
    7069                                PTAssistantValidatorTest.ERROR_CODE_STOP_AREA_NO_PLATFORM, primitives);
    7170                errors.add(e);
    72                
     71
    7372        }
    74        
    7573
    7674        /**
    77          * Checks if the stop_position(s) of an stop area belong to the same route relations as
    78          * 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).
    7977         *
    8078         * @param n
     
    8583                HashMap<Long, Long> platformRelationIds = new HashMap<>();
    8684
    87 
    8885                // Loop through all members
    8986                for (OsmPrimitive member : members) {
    90                        
     87
    9188                        // For stop positions...
    9289                        if (StopUtils.verifyStopAreaStopPosition(member)) {
    93                                
     90
    9491                                // Create a list of assigned route relations
    9592                                for (Relation referrer : OsmPrimitive.getFilteredList(member.getReferrers(), Relation.class)) {
     
    9996                                }
    10097                        }
    101                        
     98
    10299                        // For platforms...
    103100                        else if (StopUtils.verifyStopAreaPlatform(member)) {
     
    109106                                        }
    110107                                }
    111                         }       
     108                        }
    112109                }
    113                
     110
    114111                // Check if the stop_position has no referrers at all. If it has no
    115112                // referrers, then no error should be reported (changed on 11.08.2016 by
     
    123120                        return;
    124121                }
    125                
     122
    126123                // Throw error message
    127124                List<OsmPrimitive> primitives = new ArrayList<>(1);
     
    132129                errors.add(e);
    133130        }
    134        
     131
    135132}
Note: See TracChangeset for help on using the changeset viewer.