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/rhumb-destination issue at 180th meridian #770

Closed
stebogit opened this issue May 29, 2017 · 5 comments · Fixed by #771
Closed

@turf/rhumb-destination issue at 180th meridian #770

stebogit opened this issue May 29, 2017 · 5 comments · Fixed by #771
Assignees
Labels
Milestone

Comments

@stebogit
Copy link
Collaborator

The 180th meridian problem

When rhumb-destination crosses the 180th meridian from east to west, for example from an origin with negative longitude (i.e. -179.5) to a destination point 100 kilometers west of it, it returns a positive longitude for the destination, which is generally interpreted by the Map (i.e. Bing/Google) as a point at the other side of the map.

Example:

var destination = getCoord(rhumbDestination(point([-179.5, 16.5]), 100, -90));

Current output: //= [ 179.56205350889832, -16.5]
screen shot 2017-05-29 at 1 44 28 am

Solution

A quick solution that works for most Web Mercator Maps is to return a longitude value greater than 180 degrees.
Correct/expected output://= [-180.4379464911, -16.5]
screen shot 2017-05-29 at 1 52 47 am

@stebogit
Copy link
Collaborator Author

stebogit commented May 29, 2017

@DenisCarriere out of curiosity, what does this mean? What tasks?
screen shot 2017-05-29 at 2 50 14 am

@DenisCarriere DenisCarriere added this to the 4.4.0 milestone May 29, 2017
@DenisCarriere
Copy link
Member

DenisCarriere commented May 29, 2017

Those 3 of 3 tasks show up when you add bullets/lists in your first comment for PRs & Issues.

  • Task uncompleted
  • Task completed

@DenisCarriere
Copy link
Member

👍 This issue, also this will help calculating distances using both Rhumb Line & Haversine formulas.

@stebogit
Copy link
Collaborator Author

Shall I create a new PR like 180th meridian fix to fix the issue in all related modules? Do we need also a new issue?

@DenisCarriere
Copy link
Member

DenisCarriere commented May 29, 2017

Submitting a new PR is useful to contain all edits related to a specific issue or a new feature.

No need to create a new issue.

Issues are used as references, something you point your PR to or simply add all the details of the issue in the PR itself. You've already identified the 180th meridian issue here, just reference your PR to this issue since it's practically the same thing.

Major Release

We might want to consider doing a breaking change (Major release) for @turf/destination since many other modules/libraries might depend on it in it's current state.

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

Successfully merging a pull request may close this issue.

2 participants