Skip to content

Fix extreme grade at low distance - #29

Merged
nreinicke merged 1 commit into
mainfrom
ndr/low-dist-extreme-grade
May 26, 2026
Merged

Fix extreme grade at low distance#29
nreinicke merged 1 commit into
mainfrom
ndr/low-dist-extreme-grade

Conversation

@nreinicke

Copy link
Copy Markdown
Collaborator

Closes #28 by adding a minimum distance threshold for computing the grade from the rise over run between points. As distances approach zero, the grade grows asymptotically and so we allow the caller to define when those distances should be ignored. The default value is 1ft but this might need to be tuned depending on the nature of the data. If a segment falls below this distance, the previous grade is carried forward. In the vehicle space, this could represent when a vehicle comes to a stop and the distance approaches zero as the speed approaches zero. In those cases, the previous grade is valid since the vehicle has not moved in space.

@nreinicke
nreinicke merged commit b44c9d4 into main May 26, 2026
5 checks passed
@nreinicke
nreinicke deleted the ndr/low-dist-extreme-grade branch August 14, 2026 21:58
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.

get_grade produces unbounded grades when consecutive coordinates are nearly coincident

1 participant