Changeset 4704 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2011-12-23T14:44:32+01:00 (13 years ago)
Author:
simon04
Message:

fix #2746 - improve validation: Way connected to Area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java

    r4682 r4704  
    3535
    3636    private void testForError(Way w, Node wayNode, OsmPrimitive p) {
    37         if (ElemStyles.hasAreaElemStyle(p, false)) {
     37        if (isArea(p)) {
    3838            addError(w, wayNode, p);
    3939        } else {
     
    4141                if (r instanceof Relation
    4242                        && r.hasTag("type", "multipolygon")
    43                         && ElemStyles.hasAreaElemStyle(r, false)) {
     43                        && isArea(r)) {
    4444                    addError(w, wayNode, p);
    4545                    break;
     
    4747            }
    4848        }
     49    }
     50
     51    private boolean isArea(OsmPrimitive p) {
     52        return (p.hasKey("landuse") || p.hasKey("natural"))
     53                && ElemStyles.hasAreaElemStyle(p, false);
    4954    }
    5055
Note: See TracChangeset for help on using the changeset viewer.