Closed dimonkomaron closed 2 weeks ago
Hi @dimonkomaron, thank you for bringing this issue to our attention. 👍 👍
Would you be open to contribute and create a pull request to fix this problem?
Otherwise it might take longer until this bug is fixed.
@lukas-h Yes, ok, will try :)
Also have a question is there reason why spherical radius is used as it can loss precision near the equator or ellipsoidal radius has it's own flaws?
/// Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth. const earthRadius = 6371008.8;
P.S. Also seems I have no rights to push in the repository
@dimonkomaron
P.S. Also seems I have no rights to push in the repository
just start by
Also have a question is there reason why spherical radius is used as it can loss precision near the equator or ellipsoidal radius has it's own flaws?
/// Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth. const earthRadius = 6371008.8;
we didn't decide on that ourselves, rather it was a decision made by TurfJS, the original javascript library that turf_dart is very much influenced by.
Perplexity gave me this answer: https://www.perplexity.ai/search/in-turfjs-is-there-reason-why-DDd.UpGSRo6Awus4iot7iA
If you have an idea/concept for ellipsoidal calculations how to do it, let me know, I'd be happy to discuss and add it to the library 😄
@lukas-h PR is done. You can find it here: https://github.com/dartclub/turf_dart/pull/194
@dimonkomaron It is merged. Until the next turf release on pub.dev you can just use the package like this in your pubspec.yaml:
dependencies:
turf:
git:
url: https://github.com/dartclub/turf_dart.git
ref: main
I will mark this issue as done.
Seems like conversion from radians to length if using Unit.yards calculates wrong because 1 meter = 1.09361 yards, but in factors earthRadius is divided on 1.0936 but there we should multiply.