help needed on implementing S3DB


after adding support for colors in OSG-Explorer, I noticed many visual artifacts in some test areas. These artifacts result from z-fighting between multiple faces with different colors, so I assume that not all ways that are only intended as outline for 2D maps are filtered out for my 3D reconstruction yet. This is especially visible in the test area Schwerin. Other 3D renderers seem to have no problems with it.

In particular, i try to figure out how to filter out way
It is tagged as building, but covers many smaller building parts, so I assume it should not be used for 3D rendering. However, I could not find an outline tag. There is a building relation connecting to it but the role is empty. What am i missing here?

Another example:
It hides an overlapping building part with different height and color, but sharing same edges. My renderer fails to remove it from 3D rendering because it finds no outline tag or role.

how can I fix this?
btw, I think that this area looks great already with all these details.

Basically we have two main approach:

Algorithm inside O2W and F4:

  1. Draw outline polygon (building=yes)
  2. Cut of all building parts form outline polygon (building:part=yes which are inside outline or connected with outline)
  3. Create 3d model from remains of outline
  4. Create 3d model from building parts

So no relations are need.

Algorithm inside Kendzi3d:

  1. Crate 3d models for building outlines or building parts which are not members of relation (type=building)
  2. If relation contains any building part member, create 3d model for building parts from relation
  3. If relation doesn’t contains any building part member, create 3d model for building outline from relation

So relations only collect outlines and parts, no roles are need. Role is determined from tags on members (tags building=yes or building:part=yes)

Personally I’m fan of relation approach.

Thanks for the concise answer

Hm, since I am not running a database or specialized 3D server, this approach might be too complicated for this app. The spatial operations you describe require at least a spatial index structure for avoiding n to n comparisons and handling of complex polygons for computing geometric intersections and differences. That’s quite expensive.

I need to stick with the second approach and see how many issues i can fix with this. Actually its just a minor modification of my implementation. I was relying on the outline tag to be present.
Still, it won’t fix this one, for which I cannot find a building relation.
I could fix it manually by adding a relation myself, but if the remains of the outline after the cutting operation are still used for 3D rendering as you described, I would break the visualization in O2W and F4, or wouldn’t I? I need to try.

I added missing relation for that building. Relation wont brake rendering inside O2W or F4 as they don’t use relations.