-
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
Error: coordinates must contain numbers #2809
Comments
Same problem here with the "nearestPointOnLine" function. |
I discovered that the problem is related to a line with two consecutive equal coordinates |
In case it helps, I've run into a similar issue. I thought it might have to do with the consecutive equal coordinates as well, but if I remove any of the coordinates in this sample file, the problem resolves itself. |
Likely to be closely related to #2807 |
Same issue for me recently, and I arrived at the same conclusion as @paulomesquita-wsn - this is what happens when two adjacent coords are identical. Maybe there's a good reason for the function to require deduplicated coords on the input, but in such case it should print a clearer error message, and document this requirement. Duct-tape-fixed on our end by sanitizing the input geojsons to filter out duplicate coords. |
I also just experienced this. The last two points in my line string were duplicates. The error message is incredibly unhelpful. I used |
Thanks @colinperepelken. What would make the error more helpful to you? Including the value of the invalid coordinate in the message? |
@smallsaucepan Currently the error is "Error: coordinates must contain numbers", which is confusing because when I checked all of my input coordinates to Something like "Error: coordinates contain duplicates, use cleanCoords to remove them". Or better yet, can this just not throw an error, or remove the duplicates automatically? |
Oh definitely, we'll fix the condition that caused the original problem. The error message that pops up is thrown in a lower level function though, so it's not able to tell why the coordinates weren't numbers. Will see what we can do to improve both aspects 👍 |
Version: 7.2.0
Code:
Stacktrace:
The text was updated successfully, but these errors were encountered: