-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add triangulate
property to geojsonToBinary
#2571
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean PR.
- It would be nice to also add a bullet to the
whats-new
page. - It would be good to mention on the doc page that the new option is only available from v4.0 to avoid confusion.
I generally refer to what earcut does as polygon tesselation
. Thinking that maybe the option should be called tesselate
instead of triangulate
.
If you need this asap, please backport to 3.4-release branch and notify @belom88 so that it makes it into the weekly patch release.
We'd probably not mention it in the 3.4 docs as it is a late patch.
Background
We have found that the
geojsonToBinary
function can be very slow (multiple seconds) when processing large polygons due to the triangulation done via earcut. This PR adds a new optional parameter to disable the triangulation. By defaulting totrue
we maintain back compatibility but enable fast processing when needed (e.g. for a realtime API).The result is that the output data structure doesn't include the
polygons.triangles
property. deck.gl is able to cope with this and will perform the tesselation at render time, much like it does when rendering GeoJSON.Changelist
geojsonToBinary
flat-geojson-to-binary.ts