Multipolygons tagged with name only render yellow #3879
Reporter: Augustus Kling
I tried to name parts of a forest and found that Mapnik renders the named parts with a solid yellow background instead of the green forest texture.
The situation is as follows:
The big forest Buchenberger Wald'' renders correctly where it does not intersect one of its named parts. Where it intersects with the shown named part ''Hochbergstelle'' its background renders yellowish. The yellow color only appears if the name of the part is tagged using a multipolygon AND Mapnik decides to show the name of the part. The part ''Schwnde does not cause the yellowish color because Mapnik decides not to show the label.[[BR]]
Necessary change to rendering:[[BR]]
The text was updated successfully, but these errors were encountered:
Multipolygons that don't have a style do not render as an area at all. Except when one of their member ways does have a valid style, which is what's actually happening here.
In this case, one of the member ways (118236388) for this relation (1630390) is tagged a track, and osm2pgsql (the import tool for mapnik's db) decided to take this as the style of the entire multipolygon area. What you are seeing, then, is a track area, which appears in the colour you're seeing, and with an outline.
This behaviour(1) in osm2pgsql is triggered by an untagged relation (only type=) or if only an additional name= tag is present. You can prevent it by adding any other tag to the relation.
It has nothing to do with labels, but it just so happens track areas are shown starting at z14, and the label for this particular area also appears at z14.
Author: Augustus Kling
Thanks very much for the quick and detailed explanation.
Now, I'm still wondering about the named part in the south-west called Schwnde''. It's also tagged like ''Hochbergstelle'' (which showed up as track area) but it does not show up as track area. Instead only the name ''Schwnde'' is displayed as intended. To see the effect open  and zoom to level 15 because the label is not shown in zoom level 14 (probably due to an overlap with the elevation of mountain ''Hohenkapf).
Schwnde'' does as well have members in role outer which are tracks. Additionally one of its members is a highway=tertiary and there are members tagged as forest as well. Could it be that addItem (from the code your referenced) does only add a tag once and thus the order of the relation members affects the painting? If so, ''Hochbergstelle'' could coincidentally take the track style where ''Schwnde takes the forest style.
Shouldn't there be a restriction such as ignoring a multipolygon (only tagged with name) altogether if the tagging of the outer ways is not equal?
 http://www.openstreetmap.org/?relation=1630391 (zoom to level 15 to see label)
We've gone a few rounds of trying to fix this in openstreetmap/osm2pgsql#80
I think we've got it fixed. Multipolygon processing is a tangle of special cases, so it's possible I'm wrong.
Assigning to osm2pgsql as it's an import issue, not a stylesheet issue.