Closed liujiusheng closed 6 months ago
Can you provide the data and tile number for the province, so I can debug? Possible issues are polygon not closed (endpoints not the same), or the wrong winding order. But hard to know without the actual data.
thanks.
it may happen when zoom>9
z: 10,x: 817,y: 422
z: 10,x: 816,y: 421
z: 10,x: 816,y: 420
the ring function in orb lead to the problem when the clip bound is in the polygon and whitout intersect with the polygon outline.
I am not able to duplicate.
One thing to consider is that Clip modifies the input data. If you need to reuse it then you need to Clone()
it before passing it in.
thanks. Maybe it recurrence only when we render the whole map. mapbox mapbox/tippecanoe project use Vatti algorithm called "wagyu",your clip algorithm is Sutherland-Hodgeman clip algorithm. Sutherland-Hodgeman clip algorithm can not deal with polyon with hole and Concave polygon.
Sutherland-Hodgeman clip algorithm can not deal with polyon with hole and Concave polygon.
Is that true? the wikipedia page has an example of a concave polygon. From the Vatti clipping algorithm wikipedia page it says it support "Even complex (self-intersecting) polygons" which I bet Sutherland-Hodgeman doesn't support.
You could try https://github.com/paulmach/orb/tree/master/clip/smartclip I don't remember how it handles all the edge cases, but it is smarter.
When i use a large polygon to generate Mapbox Vector Tile,it looks bad. But it has no problem in mapbox studio,with the same data. My data is a China province boundary.
I have try to remove the Clip function,and then it looks right,but the result mvt binary is too big.