Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Intersected polygons rendered unexpected #84

Open
apachemaven opened this issue Jun 27, 2014 · 6 comments
Open

Intersected polygons rendered unexpected #84

apachemaven opened this issue Jun 27, 2014 · 6 comments
Labels

Comments

@apachemaven
Copy link

Two polygons which belong to the same layer, I mean they have the same tags in vtm, when they are intersect with another, the intersection part may disappear.
Screenshot: http://pbrd.co/1lU7OyU.

The intersection part of the two water area is rendered with white color while it should be blue.

What's the problem?

@hjanetzek
Copy link
Member

The PolygonLayer uses the stencilbuffer method for polygon rendering without tessellation which requires elements from one layer to not overlap. I treat it as a hint that some data within a layer is overlapping and should be unioned to avoid unnecessary overdraw.

In VectorTileLoader there is a hardcoded value for USE_MESH_POLY to enable tessellation but the MeshLayer is still missing a lot of features.

@apachemaven
Copy link
Author

So fix the data is the only solution ? But we have too much polygon data which means it would be a hard job to process all of them . Any hack solution ?

@hjanetzek
Copy link
Member

you could change VectorTileLoader to use MeshLayer for only specific tags, improve MeshLayer if you need some features not yet implemented. Bonus points for making this configurable through the theme

or count the maximum possible members for a clique of overlapping polygons in your data, assign an arbitrary but unique tag to each polygon in a clique like n:1-n:100, add style rules to render each polygon (n) with a separate PolygonLayer :)

@apachemaven
Copy link
Author

@hjanetzek , thank you. I will have a try.

However I have two more questions:

1 How do you handle this kind of data?

I think there must be some features which have the same tags crossed with each other, do you split them or something else?

2 MeshLayer

I am not exactly sure what does the mesh layer do ? Any difference from that of the polygon layer?

@devemux86
Copy link

devemux86 commented Nov 16, 2016

Bonus points for making this configurable through the theme

In the fork by Mapsforge I added tessellation option mesh in area style at render themes.

See mapsforge#37

@devemux86
Copy link

devemux86 commented Feb 8, 2022

Fixed in Mapsforge fork mapsforge#903 mapsforge#905.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants