Turf distance measurement doesn't match TurfJS
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 438
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
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
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with services-turf/src/main/java/com/mapbox/turf/TurfMeasurement.java and compare its distance calculation with TurfJS, then inspect services-turf/src/test/java/com/mapbox/turf/TurfMeasurementTest.java. Determine why the implementations produce different values and update the implementation or expectations so the distance test reflects the intended TurfJS behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100