Closed leiflinse-trivector closed 5 months ago
@leiflinse-trivector thanks for the contributions. We will shortly publish this with a new minor release on pub.dev
Thank you.
There was an error related to the format of a test, so I auto-formatted it and pushed to the PR.
One question, I made along return null if the line has no coordinates, but maybe that should have been an Exception?
One question, I made along return null if the line has no coordinates, but maybe that should have been an Exception?
I think both behaviours are fine, I don't have a preference here. What does the JS-Version do?
I will look into what turf.js does.
I also want to revision that I used a pure LineString as input while turf.js uses a Feature
Also realized I could make use of internal helper getCoords
in places where I didn't.
I have now got the PR in line with the behaviour that upstream turf.js wants when distance is negative. (counting from back) A PR for upstream is open: https://github.com/Turfjs/turf/pull/2573
And changed so line parameter is a Feature
Thank you very much for your contribution. I have made a few small comments. Also, a unit test fails for me. Is it successful for you?
Thank you for the review. I believe I have addressed all your points now.
Thanks, and I realize I messed up the formatting of length_test.dart that fails the format test in main. I will enable auto format on save for future work.
Implements
length()
andalong()
by porting from turf.js.Tests are included and the
along()
test useslength()
so therefore I created one PR instead of two.One difference to turf.js is that for
along()
the dart implementation has a guard to return first point in case the provided distance is negative, while the turf.js implementation will return a different point than the start.Related issue: https://github.com/dartclub/turf_dart/issues/152