turf icon indicating copy to clipboard operation
turf copied to clipboard

turf.voronoi report an error:Cannot read properties of null (reading '0')

Open younggis opened this issue 1 year ago • 2 comments

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]

younggis avatar Aug 02 '23 08:08 younggis

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.

JamesLMilner avatar Aug 20 '23 10:08 JamesLMilner

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.

maral avatar Dec 30 '23 21:12 maral