Skip to content
This repository has been archived by the owner. It is now read-only.

Multipolygons tagged with name only render yellow #3879

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

Multipolygons tagged with name only render yellow #3879

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Reporter: Augustus Kling
[Submitted to the original trac issue database at 9.36am, Saturday, 2nd July 2011]

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:

  • There is a big forest (multipolygon 556678 version 7, name="Buchenberger Wald", landuse=forest)
  • There is a named part of it (multipolygon 1630390 version 2, name="Hochbergstelle)
  • There is another named part of it (multipolygon 1630391 version 1, name="Schwnde")
  • There is a named area (way 12002714752 version 1, name="Schnbuchen", area=yes)

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]]
The named part Schnbuchen that does not use a multipolygon for its definition but overlapping ways instead, renders as expected.

Necessary change to rendering:[[BR]]
Multipolygons that don't have a style (for example only specify names but no landuse), should be rendered with a transparent background instead of a yellowish background.

Example: http://www.openstreetmap.org/?lat=47.6968&lon=10.1797&zoom=14&layers=M

@openstreetmap-trac
Copy link
Author

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Author: Ldp
[Added to the original trac issue at 7.41pm, Saturday, 2nd July 2011]

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.

(1) http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/output-pgsql.c#L1004

@openstreetmap-trac
Copy link
Author

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Author: Augustus Kling
[Added to the original trac issue at 11.32am, Sunday, 3rd July 2011]

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 [1] 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?

[1] http://www.openstreetmap.org/?relation=1630391 (zoom to level 15 to see label)

@openstreetmap-trac
Copy link
Author

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Author: pnorman
[Added to the original trac issue at 11.02pm, Monday, 7th April 2014]

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?

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant