Skip to content
Advertisement

turf’s mask() function does not run with 10 or more polygons

I can not run the turf.mask() function with more than 9 randomly created points. It just does not return any result.

JavaScript

This works as expected. There are nine holes (created through the randomPoints() function) in the polygon. However, as soon as I change howManyCircles to a number greater than 9, I do not get any result. It calculates and calculates but does not come to an end. Here is a fiddle to play around with: https://jsfiddle.net/6m3qsnu1/

Why is that?

“@turf/helpers”: “^6.3.0”, “@turf/random”: “^6.3.0”, “@turf/turf”: “^6.3.0”,

Advertisement

Answer

Apparently this is a known bug and got fixed in v7. However, yarn add @turf/turf or npm i @turf/turf installs turf 6.3.0. In order to install the most recent version use npm i turf@7.0.0-alpha.1

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement