List<List<Node>> innerWays = joinWays(polygon.getInnerWays()); // Side effect - sets nonClosedWays
List<List<Node>> outerWays = joinWays(polygon.getOuterWays());
if (styles != null) {
AreaElemStyle area = ElemStyles.getAreaElemStyle(r, false);
boolean areaStyle = area != null;
// If area style was not found for relation then use style of ways
if (area == null) {
for (Way w : polygon.getOuterWays()) {
area = ElemStyles.getAreaElemStyle(w, true);
if (area != null) {
break;
}
}
if (!"boundary".equals(r.get("type"))) {
if (area == null) {
addError(r, new TestError(this, Severity.OTHER, tr("No style for multipolygon"), NO_STYLE, r));
} else {
addError(r, new TestError(this, Severity.OTHER, tr("No style in multipolygon relation"),
NO_STYLE_POLYGON, r));
}
}
}
if (area != null) {
for (Way wInner : polygon.getInnerWays()) {
AreaElemStyle areaInner = ElemStyles.getAreaElemStyle(wInner, false);
if (areaInner != null && area.equals(areaInner)) {
List<OsmPrimitive> l = new ArrayList<>();
l.add(r);
l.add(wInner);
addError(r, new TestError(this, Severity.WARNING, tr("Style for inner way equals multipolygon"),
INNER_STYLE_MISMATCH, l, Collections.singletonList(wInner)));
}
}
if(!areaStyle) {
for (Way wOuter : polygon.getOuterWays()) {
AreaElemStyle areaOuter = ElemStyles.getAreaElemStyle(wOuter, false);
if (areaOuter != null && !area.equals(areaOuter)) {
List<OsmPrimitive> l = new ArrayList<>();
l.add(r);
l.add(wOuter);
addError(r, new TestError(this, Severity.WARNING, tr("Style for outer way mismatches"),