-
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
lineArc with leaflet - end angle problem? #2446
Comments
Thanks for raising - I haven't got the time to fully debug this right now but looking at your reproduction case (thank you for including) it does seem odd and there is nothing immediately obvious wrong with your code or the data. I noticed if you change the steps option down to 14 it passes without an error. I'll flag this as a bug and hopefully when I or someone gets more time we can investigate. |
Oh, this is a good one! 🤯 Basically, if 360 / number of steps in options equals end angle - start angle, this function errors out. So when you changed the angle by a single degree in either direction it was enough to upset that relationship and let the code work. A fix shouldn't be too difficult. Stay tuned. |
Looking into this a bit more @tj26x it has already been fixed and was included in 7.0.0-alpha.0 and later. Would you mind confirming that you're using that version? Just noted that the Turf version in your jsfiddle is still 6.5.0. |
…ct number of steps. Also a bit related to Turfjs#2446, which should have been fixed a while ago by a previous fix to the previous version of this code (see Turfjs#2142). Including a unit test to make sure we don't go backwards with this approach.
So it looks like I am using 6.5.0 but everywhere i go to download the minified (turf.min.js) release 7.0.x points me to this: https://npmcdn.com/@turf/turf@6.5.0/turf.min.js putting 7.0.0 in the address does not work? Where can I download an actual 7.0.x release? Thank you. |
7.0.0 isn't officially released yet so please try https://npmcdn.com/@turf/turf@7.0.0-alpha.2/turf.min.js That's the latest alpha release. |
Release 7.0.0 fix my problem. Is it to be officially released soon? Thank you very much. |
…rated arc (#2525) * Fixes #2524 where lineArc isn't dividing the arc into the correct number of steps. Also a bit related to #2446, which should have been fixed a while ago by a previous fix to the previous version of this code (see #2142). Including a unit test to make sure we don't go backwards with this approach. * Flow on changes to turf-sector and turf-angle unit test outputs as a result of fix to turf-line-arc. All changes checked visually using geojson.io, noting start and end coords are identical and it's only the intermediate ones changing due to the curve being smoother by default. * Update changelog. * Clarifying what the "steps" param means in the documentation. Haven't rebuilt the readme as generate-readmes needs some work. Will make that a seperate PR though.
Thanks for confirming @tj26x. Will close this issue. Sorry, I'm not aware of any planned release date for v7. |
Hello,
I am having trouble with turf lineArc returning the error: coordinates must be an array of two or more positions.
for the example below for RA if I change the endAngley to a value of 276 or 278 turf.lineArc works correctly but a value of 277 always gives an error. R8A also gives the same error.
here is a jsfiddle showing the problem.
https://jsfiddle.net/7g9smnkd/1/
I have thousands of these types of lineArc calculations but these 2 are the only ones that cause an error.
Any help would be greatly appreciated.
Thank you.
Using turfjs 7.0.0-alpha.0 (but experienced problem on previous release too)
The text was updated successfully, but these errors were encountered: