Ticket #3879 (closed defect: fixed)

Opened 3 years ago

Last modified 9 days ago

Multipolygons tagged with name only render yellow

Reported by: Augustus Kling Owned by: mapnik-team@…
Priority: minor Milestone:
Component: osm2pgsql Version:
Keywords: multipolygon Cc: augustus.kling@…

Description

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="Schwände")
  • There is a named area (way 12002714752 version 1, name="Schönbuchen", 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 Schwände does not cause the yellowish color because Mapnik decides not to show the label.
The named part Schönbuchen that does not use a multipolygon for its definition but overlapping ways instead, renders as expected.

Necessary change to rendering:
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

Attachments

multipolygon.png Download (158.7 KB) - added by Augustus Kling 3 years ago.
Screenshot of the example region. The forest south of the street OA20 is the big multipolygon called Buchenberger Wald.

Change History

Changed 3 years ago by Augustus Kling

Screenshot of the example region. The forest south of the street OA20 is the big multipolygon called Buchenberger Wald.

comment:1 Changed 3 years ago by Ldp

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

comment:2 Changed 3 years ago by 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 Schwände. 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 Schwände 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).

Schwände 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 Schwände 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)

comment:3 Changed 9 days ago by pnorman

  • Keywords multipolygon added; multipolygon, name-only, yellow, yellowish, orange removed
  • Resolution set to fixed
  • Status changed from new to closed
  • Component changed from mapnik to osm2pgsql

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  https://github.com/openstreetmap/osm2pgsql/issues/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.

Note: See TracTickets for help on using tickets.