Opened 11 years ago

Closed 7 years ago

#2082 closed defect (fixed)

Holes of multipolygon relation not rendered

Reported by: augustus.kling@… Owned by: jburgess777@…
Priority: critical Milestone:
Component: mapnik Version:
Keywords: multipolygon, relation, hole, direction, polygon Cc: openstreetmap@…


Mapnik does not render inner polygons of the multipolygon relation 172181. It consists of one outer polygon (26940083) tagged as natural=water and multiple inner polygons. The inner polygons are tagged as natural=wood and should be rendered as islands within the lake. Osmarender and JOSM are rendering the multipolygon correctly.

The holes (ways 23493419 and 23493421) in the nearby forest are rendered correctly in Mapnik, too. Link to the area:

The direction of the inner polygons are differing. It seems that multipolygon relations are only rendered correctly if the outer polygon goes clockwise and the inner polygon goes counterclockwise. This behavior is documented in the English and German wiki-pages covering multipolygon relations. The wiki also clearly states that the directions of the polygons does not matter.

In the fixed issue #1113 it is said that the directions should be fixed during the osm2pgsql conversion process. This makes me wonder what causes the wrong rendering described above.

Does the polygon direction still matter for Mapnik?
If yes:

  • Why is issue #1113 closed as fixed?
  • Is Mapnik able to render nested multipolygons where the inner polygon of one relation is the outer polygon of the other relation?

Change History (10)

comment:1 Changed 11 years ago by augustus.kling@…

The islands within the lake are rendered by Mapnik for zoom level 11 or smaller.

comment:2 Changed 11 years ago by steve8@…

Owner: changed from steve8@… to jburgess777@…

John - could you have a look at this one. Multipolygon relations boggle my mind.

comment:3 Changed 10 years ago by twain

Cc: openstreetmap@… added

comment:4 Changed 10 years ago by Ldp

I believe it currently renders fine and as expected? If agreed, this ticket can be closed.

comment:5 Changed 10 years ago by augustus.kling@…

You're right, the originally mentioned example looks great now.

Unfortunately, I found another example where islands don't show up in Mapnik (but look fine in Osmarender and JOSM). See
The lake / loch called “Rohrsee” should have 3 islands. The lake is tagged with area=yes which could be the problem although it should not matter. It might also help to move the classification natural=water to the relation instead of having it on the outer way. However I did not change the tags to have a working (or better not working) example.

Cheers for looking into this.

comment:6 Changed 10 years ago by steve8@…

Resolution: fixed
Status: newclosed

I have added natural=land to the three inner parts of the multipolygon for Rohrsee and it seems to have resolved it. This is the way I normally tag multipolygons, and I think tagging the inners is the key.

comment:7 Changed 10 years ago by augustus.kling@…

Resolution: fixed
Status: closedreopened

I don't agree that tagging the inner objects resolves the problem. It does fix the rendering, though.
If the inner objects are not tagged at all it is still defined that the outer object has to end where the inner object begins. Within a lake it is quite obvious that there is land where the water ends (like you tagged it). However if we think about, say a forest, it is no longer obvious what is within the inner area. One might want to end the forest (or any other type of outer object) without specifying the content of the inner area (because it is unknown). Therefore Mapnik shouldn't paint within the inner objects' areas even if they remain untagged.

comment:8 Changed 9 years ago by Michael Kleidt

I think this problem is generally solved. Mapnik is normally leaving the holes in multipolygons empty. But sometimes it seams, that the mapnik DB is in an inconsistent state. This happens if there are several updates to to the MP and the inner/outer ways. In this case it could happend, that the holes are not correctly rendered. Only deleting and inserting ways and relation solf the problem for me (I run into this problem twice). But I can't tell you which opperations corruptede the mapnik DB.

comment:9 Changed 8 years ago by joriskofman@…

I have spotted this problem in some multipolygons located here: I have not been able to spot any problems with the multipolygons, it seems that there are some in this area that render just fine, while others dont.

comment:10 Changed 7 years ago by Andy Allan

Resolution: fixed
Status: reopenedclosed

As far as I'm aware, all multipolyon handling in osm2pgsql is working fine. If there are currently problems with multipolygons, that's the component to add new tickets to.

Note: See TracTickets for help on using tickets.