Creating Textures from OSM-Data, Issue with forest


I try to create a terrain renderer for unity3d using elevation data. Since I am to lazy to paint all the forest-areas and streets, I try to use OSM data to paint images, that describe the kind of landuse for each location. Right now I am only trying to render forest.

My current output is

The Problem is the white area on the top right (arrow). It looks like I am missing one large polygon. I am going through all the relations and draw all referenced ways that have outer in green in all that have inner in grey (to see them). In addition I go through all ways that have landuse=forest and draw them as polygon as well.

I think that I misunderstood the relation thing.

The code can be found here:

Any help is highly appreciated

Can you link to that area in OSM?

sure: is this link helpful:

the image is a little bit stretched in y dimension.

Just a guess, as I couldn’t find the particular forest multipolygon that’s causing you trouble and have only scanned your code, but: Are you handling non-closed ways correctly? Any outer or inner ring of a multipolygon may potentially consist of more than one way, like in this illustration:

Not really - there’s no idea of scale in the posted image, and the map link at zoom 13 covers a huge area.

I think that is exeactly my problem. I did not understand that the outer boundary could consist of more than one way.

Thx alot for your help!