Changeset 5246 in osm for applications/editors


Ignore:
Timestamp:
2007-10-30T14:21:23+01:00 (17 years ago)
Author:
gabriel
Message:

validator plugin: Check for ways with just one node.

Location:
applications/editors/josm/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedWay.java

    r4843 r5246  
    2626        /** Unnamed way error */
    2727        protected static final int UNNAMED_WAY  = 2;
     28        /** One node way error */
     29        protected static final int ONE_NODE_WAY = 3;
    2830
    2931    /** Tags allowed in a way */
     
    4850        public UntaggedWay()
    4951        {
    50                 super(tr("Untagged ways."),
    51                           tr("This test checks for untagged ways."));
     52                super(tr("Untagged, empty, and one node ways."),
     53                          tr("This test checks for untagged, empty and one node ways."));
    5254        }
    5355
     
    9294        }
    9395       
     96        if( w.nodes.size() == 1 )
     97        {
     98            errors.add( new TestError(this, Severity.ERROR, tr("One node ways"), w, ONE_NODE_WAY) );
     99        }
     100       
    94101        }               
    95102       
     
    99106                if( testError.getTester() instanceof UntaggedWay )
    100107                {
    101                         return testError.getInternalCode() == EMPTY_WAY;
     108                        return testError.getInternalCode() == EMPTY_WAY
     109                                || testError.getInternalCode() == ONE_NODE_WAY;
    102110                }
    103111               
Note: See TracChangeset for help on using the changeset viewer.