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

Fix along with negative distance was undefined #2573

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Leffe108
Copy link

@Leffe108 Leffe108 commented Jan 20, 2024

This changes so that if distance is negative, then it measures along the line in reverse. Before, it would use bearing and return a point before the start.

Also document what happens if abs(distance) is larger than the length of the line.

Resolves #2567, resolves #2148


Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Have read How To Contribute.
  • Run npm test at the sub modules where changes have occurred.
  • Run npm run lint to ensure code style at the turf module level.

This changes so that if distance is negative, then it measures
along the line in reverse. Before, it would use bearing and
return a point before the start.

Also document what happens if abs(distance) is larger than the length
of the line.
Copy link

@magnusburton magnusburton left a comment

Choose a reason for hiding this comment

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

Much needed change, thanks! It might be breaking for some who've come to expect this pattern however.

@smallsaucepan
Copy link
Member

Thanks for taking a look at this @Leffe108. Have made a request above if you could expand the tests to cover some more of the functionality that would be fantastic.

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.

along with negative distance along should support negative offset
3 participants