Closed demkalkov closed 8 years ago
Is everything a Number in your passed in polygon
? String coordinates won't work.
The polygon's value is [[0,0]]
.
Seems like for the current scale this states are too small. So in this case the area will be equal to zero, and there will be division by zero
Ah, yes, 0/0 is NaN, but N/0 is Infinity.
Agreed. We should probably bail out early in case of zero-area polygons.
In my case I've used us states map and have been trying to find the center of the states, but faced an infinite loop for some states because getCentroidCell used to return structure like
{ x: NaN, y: NaN, d: NaN . . . }
so when it tried to compare the numbers later, it had always the negative result