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

Port midpoint tests from turf.js #4

Merged
merged 1 commit into from
Nov 7, 2020

Conversation

baparham
Copy link
Member

@baparham baparham commented Nov 7, 2020

Midpoint tests taken from https://github.com/Turfjs/turf commit SHA
23d5cb91d77e0c1e2e903a2252f525797f1d0d09 (the current master commit as of writing)

Spawned by test failure referenced in issue #3

Basically a direct port of the turf.js tests, with the addition of the existing lat/lng in range check the existing turf_dart test had.

Two of these tests still fail, but perhaps that points to an implementation bug in midpoint. It seemed starting with the turf.js tests would help identify if there was in fact a bug in the implementation.

Midpoint tests taken from https://github.com/Turfjs/turf commit SHA
23d5cb91d77e0c1e2e903a2252f525797f1d0d09
);
Point result = midpoint(pt1, pt2);

checkLatLngInRange(result);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test is actually missing the distance check that the other tests have, which also perhaps could be pulled out into a separate function, like checkLatLngInRange. I'll keep the fix on hold in case there is other feedback that should be addressed in another patch.

@lukas-h
Copy link
Member

lukas-h commented Nov 7, 2020

Hi @baparham, thanks for the pull request, there is not directly a bug in the implementation but it's due to a lack of normalization of coordinates (meridian/antimeridian boundaries)

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

Successfully merging this pull request may close these issues.

2 participants