Changeset 11782 in josm


Ignore:
Timestamp:
2017-03-26T22:11:56+02:00 (5 months ago)
Author:
stoecker
Message:

see #10529 - increase important multipolygon problems to error level, better separate output of boundary and multipolygon

File:
1 edited

Legend:

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

    r11739 r11782  
    158158        }
    159159        errors.add(TestError.builder(this, Severity.WARNING, MISSING_OUTER_WAY)
    160                 .message(tr("No outer way for multipolygon"))
     160                .message(r.isBoundary() ? tr("No outer way for boundary") : tr("No outer way for multipolygon"))
    161161                .primitives(r)
    162162                .build());
     
    175175    private void checkStyleConsistency(Relation r, Multipolygon polygon) {
    176176        ElemStyles styles = MapPaintStyles.getStyles();
    177         if (styles != null && !r.hasTag("type", "boundary")) {
     177        if (styles != null && !r.isBoundary()) {
    178178            AreaElement area = ElemStyles.getAreaElemStyle(r, false);
    179179            boolean areaStyle = area != null;
     
    193193                } else {
    194194                    /* old style multipolygon - solve: copy tags from outer way to multipolygon */
    195                     errors.add(TestError.builder(this, Severity.WARNING, NO_STYLE_POLYGON)
     195                    errors.add(TestError.builder(this, Severity.ERROR, NO_STYLE_POLYGON)
    196196                            .message(trn("Multipolygon relation should be tagged with area tags and not the outer way",
    197197                                    "Multipolygon relation should be tagged with area tags and not the outer ways",
     
    224224                                    .build());
    225225                        } else if (areaStyle) { /* style on outer way of multipolygon, but equal to polygon */
    226                             errors.add(TestError.builder(this, Severity.WARNING, OUTER_STYLE)
     226                            errors.add(TestError.builder(this, Severity.ERROR, OUTER_STYLE)
    227227                                    .message(tr("Area style on outer way"))
    228228                                    .primitives(Arrays.asList(r, wOuter))
     
    250250        List<Node> openNodes = polygon.getOpenEnds();
    251251        if (!openNodes.isEmpty()) {
    252             errors.add(TestError.builder(this, Severity.WARNING, NON_CLOSED_WAY)
     252            errors.add(TestError.builder(this, Severity.ERROR, NON_CLOSED_WAY)
    253253                    .message(tr("Multipolygon is not closed"))
    254254                    .primitives(combineRelAndPrimitives(r, openNodes))
     
    467467                RelationMember member = wayMap.get(wayId);
    468468                if (!member.getRole().equals(calculatedRole)) {
    469                     errors.add(TestError.builder(this, Severity.WARNING, WRONG_MEMBER_ROLE)
     469                    errors.add(TestError.builder(this, Severity.ERROR, WRONG_MEMBER_ROLE)
    470470                            .message(RelationChecker.ROLE_VERIF_PROBLEM_MSG,
    471471                                    marktr("Role for ''{0}'' should be ''{1}''"),
     
    477477                    if (pol.level == 0 && "inner".equals(member.getRole())) {
    478478                        // maybe only add this error if we found an outer ring with correct role(s) ?
    479                         errors.add(TestError.builder(this, Severity.WARNING, INNER_WAY_OUTSIDE)
     479                        errors.add(TestError.builder(this, Severity.ERROR, INNER_WAY_OUTSIDE)
    480480                                .message(tr("Multipolygon inner way is outside"))
    481481                                .primitives(Arrays.asList(r, member.getMember()))
     
    564564                                : samePoly ? tr("Multipolygon ring contains segments twice")
    565565                                        : tr("Multipolygon outer way shares segment(s) with other ring");
    566                         errors.add(TestError.builder(this, Severity.WARNING, CROSSING_WAYS)
     566                        errors.add(TestError.builder(this, Severity.ERROR, CROSSING_WAYS)
    567567                                .message(msg)
    568568                                .primitives(Arrays.asList(r, ways.get(0), ways.get(1)))
     
    654654                }
    655655            } else {
    656                 if (!rm.hasRole("admin_centre", "label", "subarea", "land_area")) {
     656                if (!r.isBoundary() || !rm.hasRole("admin_centre", "label", "subarea", "land_area")) {
    657657                    errors.add(TestError.builder(this, Severity.WARNING, WRONG_MEMBER_TYPE)
    658                             .message(tr("Non-Way in multipolygon"))
     658                            .message(r.isBoundary() ? tr("Non-Way in boundary") : tr("Non-Way in multipolygon"))
    659659                            .primitives(Arrays.asList(r, rm.getMember()))
    660660                            .build());
Note: See TracChangeset for help on using the changeset viewer.