turf
turf copied to clipboard
turf.voronoi report an error:Cannot read properties of null (reading '0')
When I used turf.voronoi to generate Voronoi polygons, the following error occurred:
Uncaught TypeError: Cannot read properties of null (reading '0')
at turf.min.js:80:68643
at new Ra (turf.min.js:80:69303)
at r (turf.min.js:88:412086)
at r.polygons (turf.min.js:88:412247)
at t.voronoi (turf.min.js:88:412923)
at turf.html:174:30
this points will report an error.the problem is [119.33893, 25.731901] and [119.338931, 25.731901].Could you please see why the error was reported?thanks.
points:
[
[119.365891, 26.049549],
[119.360972, 25.731612],
[119.335263, 25.724399],
[119.345076, 25.703511],
[119.33893, 25.731901],
[119.338931, 25.731901]
]
bbox:
[118.69595817618412, 25.493916216401107, 119.41693595938725, 26.139962823065883]
Hey, thanks for raising your issue. In order to help diagnose the issue we'd need a the code/data for a minimal reproduction of the issue. You could use something like https://codesandbox.io/ to do this and share it here.
My guess is that the last two points are considered as duplicates and the error is the result. It's difficult to guess where exactly the error appears, though.