Ignore:
Timestamp:
2014-09-20T20:54:48+02:00 (10 years ago)
Author:
stoecker
Message:

see #10529 - some better warnings for old style multipolygon tagging

File:
1 edited

Legend:

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

    r7565 r7569  
    5454    protected static final int NO_STYLE = 1610;
    5555    protected static final int NO_STYLE_POLYGON = 1611;
     56    protected static final int STYLE_ON_WAY = 1612;
     57    protected static final int OUTER_STYLE = 1613;
    5658
    5759    private static ElemStyles styles;
     
    241243                    for (Way wOuter : polygon.getOuterWays()) {
    242244                        AreaElemStyle areaOuter = ElemStyles.getAreaElemStyle(wOuter, false);
    243                         if (areaOuter != null && !area.equals(areaOuter)) {
     245                        if (areaOuter != null) {
    244246                            List<OsmPrimitive> l = new ArrayList<>();
    245247                            l.add(r);
    246248                            l.add(wOuter);
    247                             addError(r, new TestError(this, Severity.WARNING, !areaStyle ? tr("Style for outer way mismatches")
    248                             : tr("Style for outer way mismatches polygon"),
    249                             OUTER_STYLE_MISMATCH, l, Collections.singletonList(wOuter)));
    250                         }
     249                            if (!area.equals(areaOuter)) {
     250                                addError(r, new TestError(this, Severity.WARNING, !areaStyle ? tr("Style for outer way mismatches")
     251                                : tr("Style for outer way mismatches polygon"),
     252                                OUTER_STYLE_MISMATCH, l, Collections.singletonList(wOuter)));
     253                            } else if (areaStyle) { /* style on outer way of multipolygon, but equal to polygon */
     254                                addError(r, new TestError(this, Severity.WARNING, tr("Style on outer way"), OUTER_STYLE,
     255                                l, Collections.singletonList(wOuter)));
     256                            }
     257                        }
     258                    }
     259                    if(!areaStyle) { /* old style multipolygon - solve: copy tags from outer way to multipolygon */
     260                        addError(r, new TestError(this, Severity.WARNING, tr("Style is on way and not on multipolygon"), STYLE_ON_WAY, r));
    251261                    }
    252262                }
Note: See TracChangeset for help on using the changeset viewer.