Closed huangyingjie closed 7 years ago
@ddimaria it use two or more polyons, but here it is just one polygon..
This is a technical limitation — we currently have no way to properly triangulate invalid self-intersecting polygons.
Hello @mourner , could you please describe the technical limitation
in detail? article、issue etc.
@huangyingjie there is no fast, stable algorithm for triangulating non-simple (self-intersecting) polygons. For triangulation, we use https://github.com/mapbox/earcut, which is very fast, but assumes that polygons do not self-intersect.
We clean up all self-intersections in our vector tiles, but don't do so yet in JavaScript when rendering GeoJSON sources. Detecting and resolving self-intersections is a very hard problem, which I started exploring in https://github.com/mapbox/polysnap project, but haven't finished yet.
Problem and code
What's my expectation
Why not forbid overlapping?
I shall do this later, but there was too much data overlaps; and customers ask to show as my description before.