Skip to content

turf.intersection slower on v7.2.0 #2810

Answered by twelch
tsairinius asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for starting the discussion. Turf in 7.2.0 switched from using the polygon-clipping library to the polyclip-ts fork, which trades speed for floating point accuracy, resolving a lot of issues - #2729. If you need the performance back I would suggest trying to use the polygon-clipping package directly.

I see you are also calling intersect for each grid feature on the saudi arabia polygon. Consider seeing if you can boil this down to a single intersect call. Maybe merge your grid polygons into a single multipolygon. Then call intersect(saudiArabia, gridMultiPoly).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tsairinius
Comment options

Answer selected by tsairinius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants