Skip to content
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

Turf distance measurement doesn't match TurfJS #1167

Open
ac87 opened this issue Aug 14, 2020 · 1 comment
Open

Turf distance measurement doesn't match TurfJS #1167

ac87 opened this issue Aug 14, 2020 · 1 comment

Comments

@ac87
Copy link

ac87 commented Aug 14, 2020

I am trying to port transformRotate from Turf.JS as I need it for a project.

In the method comments there are some examples with the expected result, my port didn't match. In trying to debug this I've noticed that the distance tests don't match between JS and the Java port.

The standard test points [-75.343,39.984][-75.534, 39.123] used the km distance in TurfJS is 97.12922118967835

Those same points are tested in the port but the expected result is different: 97.15957803131901

This third party suggests TurfJS is correct.

I've noticed Earth radius is different between the implementations so I guess this is the why

6371008.8

6378137

I see JS nearly changed to the same value for earth's radius but got reverted.

Is there a reason the port doesn't produce the same result as the original?

@1ec5
Copy link
Contributor

1ec5 commented Aug 25, 2020

Related: mapbox/turf-swift#26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants