-
Notifications
You must be signed in to change notification settings - Fork 953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pointToPolygonDistance failing if polygon's last points are redundant #2807
Comments
Redundant coordinates can cause problems. Can you try using the turf |
The GeoJSON specification allows redundant points. So there is a point in allowing that for consistency reasons. I think I would wish at least a better error handling that describes the issue clearly. |
I also encountered the same error message, and I have already used the cleanCoord method. |
Same issue here |
Please provide the following when reporting an issue:
.geojson
). Simple reproducible examples are preferrable.Problem
Version: 7.2.0
pointToPolygonDistance
When using the method
pointToPolygonDistance
I get an error that sayscoordinates must contain numbers
. It definitely has something to do with the redundant points at the end of the polygon. (Look at the last 2 entries of the polygon in the GeoJSON section below, they are equal). If I remove one of them, the method works.When debugging, I see that it is failing because coordinates seems to be
NaN
:Code:
Stacktrace:
GeoJson:
The text was updated successfully, but these errors were encountered: