Changeset 11782 in josm
- Timestamp:
- 2017-03-26T22:11:56+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r11739 r11782 158 158 } 159 159 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")) 161 161 .primitives(r) 162 162 .build()); … … 175 175 private void checkStyleConsistency(Relation r, Multipolygon polygon) { 176 176 ElemStyles styles = MapPaintStyles.getStyles(); 177 if (styles != null && !r. hasTag("type", "boundary")) {177 if (styles != null && !r.isBoundary()) { 178 178 AreaElement area = ElemStyles.getAreaElemStyle(r, false); 179 179 boolean areaStyle = area != null; … … 193 193 } else { 194 194 /* 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) 196 196 .message(trn("Multipolygon relation should be tagged with area tags and not the outer way", 197 197 "Multipolygon relation should be tagged with area tags and not the outer ways", … … 224 224 .build()); 225 225 } 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) 227 227 .message(tr("Area style on outer way")) 228 228 .primitives(Arrays.asList(r, wOuter)) … … 250 250 List<Node> openNodes = polygon.getOpenEnds(); 251 251 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) 253 253 .message(tr("Multipolygon is not closed")) 254 254 .primitives(combineRelAndPrimitives(r, openNodes)) … … 467 467 RelationMember member = wayMap.get(wayId); 468 468 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) 470 470 .message(RelationChecker.ROLE_VERIF_PROBLEM_MSG, 471 471 marktr("Role for ''{0}'' should be ''{1}''"), … … 477 477 if (pol.level == 0 && "inner".equals(member.getRole())) { 478 478 // 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) 480 480 .message(tr("Multipolygon inner way is outside")) 481 481 .primitives(Arrays.asList(r, member.getMember())) … … 564 564 : samePoly ? tr("Multipolygon ring contains segments twice") 565 565 : 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) 567 567 .message(msg) 568 568 .primitives(Arrays.asList(r, ways.get(0), ways.get(1))) … … 654 654 } 655 655 } else { 656 if (!r m.hasRole("admin_centre", "label", "subarea", "land_area")) {656 if (!r.isBoundary() || !rm.hasRole("admin_centre", "label", "subarea", "land_area")) { 657 657 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")) 659 659 .primitives(Arrays.asList(r, rm.getMember())) 660 660 .build());
Note:
See TracChangeset
for help on using the changeset viewer.