Ticket #20663: 20663.patch

File 20663.patch, 4.2 KB (added by GerdP, 5 years ago)

always show warning when outer way has area style, adapt unit test data

  • nodist/data/multipolygon.osm

     
    41904190  <relation id='-42115' action='modify'>
    41914191    <member type='way' ref='-41755' role='inner' />
    41924192    <member type='way' ref='-41791' role='outer' />
    4193     <tag k='josm_error_codes' v='1607' />
    4194     <tag k='name' v='06/03 - Mismatching way styles' />
     4193    <tag k='josm_error_codes' v='1613' />
     4194    <tag k='name' v='06/03 - Area style on outer way' />
    41954195    <tag k='natural' v='water' />
    41964196    <tag k='type' v='multipolygon' />
    41974197  </relation>
  • src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

     
    5656    public static final int INNER_WAY_OUTSIDE = 1605;
    5757    /** Intersection between multipolygon ways */
    5858    public static final int CROSSING_WAYS = 1606;
    59     /** Style for outer way mismatches / With the currently used mappaint style(s) the style for outer way mismatches the area style */
    60     public static final int OUTER_STYLE_MISMATCH = 1607;
     59    // 1607 is no longer used: With the currently used mappaint style(s) the style for outer way mismatches the area style
    6160    /** With the currently used mappaint style the style for inner way equals the multipolygon style */
    6261    public static final int INNER_STYLE_MISMATCH = 1608;
    63     // no longer used: Area style way is not closed NOT_CLOSED = 1609
     62    // 1609 is no longer used: Area style way is not closed
    6463    /** No area style for multipolygon */
    6564    public static final int NO_STYLE = 1610;
    66     // no longer used: Multipolygon relation should be tagged with area tags and not the outer way(s) NO_STYLE_POLYGON = 1611;
     65    // 1611 is no longer used: Multipolygon relation should be tagged with area tags and not the outer way(s)
    6766    /** Area style on outer way */
    6867    public static final int OUTER_STYLE = 1613;
    6968    /** Multipolygon member repeated (same primitive, same role */
     
    125124     * Various style-related checks:<ul>
    126125     * <li>{@link #NO_STYLE}: No area style for multipolygon</li>
    127126     * <li>{@link #INNER_STYLE_MISMATCH}: With the currently used mappaint style the style for inner way equals the multipolygon style</li>
    128      * <li>{@link #OUTER_STYLE_MISMATCH}: With the currently used mappaint style the style for outer way mismatches the area style</li>
    129127     * <li>{@link #OUTER_STYLE}: Area style on outer way</li>
    130128     * </ul>
    131129     * @param r relation
     
    154152                        continue;
    155153                    AreaElement areaOuter = ElemStyles.getAreaElemStyle(wOuter, false);
    156154                    if (areaOuter != null) {
    157                         if (!area.equals(areaOuter)) {
    158                             errors.add(TestError.builder(this, Severity.OTHER, OUTER_STYLE_MISMATCH)
    159                                     .message(tr("With the currently used mappaint style the style for outer way mismatches the area style"))
    160                                     .primitives(Arrays.asList(r, wOuter))
    161                                     .highlight(wOuter)
    162                                     .build());
    163                         } else { /* style on outer way of multipolygon, but equal to polygon */
    164                             errors.add(TestError.builder(this, Severity.WARNING, OUTER_STYLE)
    165                                     .message(tr("Area style on outer way"))
    166                                     .primitives(Arrays.asList(r, wOuter))
    167                                     .highlight(wOuter)
    168                                     .build());
    169                         }
     155                        errors.add(TestError.builder(this, Severity.WARNING, OUTER_STYLE)
     156                                .message(tr("Area style on outer way"))
     157                                .primitives(Arrays.asList(r, wOuter))
     158                                .highlight(wOuter)
     159                                .build());
    170160                    }
    171161                }
    172162            }