OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2019-05-28 08:20:38

mlankenau
Member
Registered: 2019-05-28
Posts: 3

Creating Textures from OSM-Data, Issue with forest

Hi,

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

test.png

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:
https://gist.github.com/mlankenau/cf6a7 … eb49544f95

Any help is highly appreciated

Last edited by mlankenau (2019-05-28 08:25:54)

Offline

#2 2019-05-28 09:57:48

SomeoneElse
Member
Registered: 2010-10-13
Posts: 1,148

Re: Creating Textures from OSM-Data, Issue with forest

Can you link to that area in OSM?

Offline

#3 2019-05-28 10:27:17

mlankenau
Member
Registered: 2019-05-28
Posts: 3

Re: Creating Textures from OSM-Data, Issue with forest

sure: is this link helpful:
https://www.openstreetmap.org/#map=13/47.7356/12.4648

the image is a little bit stretched in y dimension.

Offline

#4 2019-05-28 22:24:05

Tordanik
Moderator
From: Germany
Registered: 2008-06-17
Posts: 2,413
Website

Re: Creating Textures from OSM-Data, Issue with forest

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:

Multipolygon_Illustration_3.svg

Offline

#5 2019-05-28 22:27:32

SomeoneElse
Member
Registered: 2010-10-13
Posts: 1,148

Re: Creating Textures from OSM-Data, Issue with forest

mlankenau wrote:

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

Offline

#6 2019-05-29 06:11:10

mlankenau
Member
Registered: 2019-05-28
Posts: 3

Re: Creating Textures from OSM-Data, Issue with forest

Tordanik wrote:

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:

https://wiki.openstreetmap.org/w/images … tion_3.svg

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!

Offline

Board footer

Powered by FluxBB