Repository navigation
fix(gpx): short-arc longitude across the date line; strict gap policy - #4
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TrackIndex.position_atinterpolated longitude as a plain number. A leg from 179 to -179 came out at 0, on the other side of the planet. Longitude now follows the shorter arc and is wrapped into [-180, 180]. Ordinary legs and endpoints are unchanged.strict=True,max_gap_minbounds the span between the two bracketing points, so a capture inside a long hole in the track is refused however close it sits to one end. Captures before the first or after the last point are refused.fix_at(), which returnsTrackFix(lat, lon, inferred).inferredis False only when the time equals a logged point.Plan units: ST-1, ST-2 (portfolio remediation 2026-09-29).
Compatibility
The default is unchanged.
strict=Falsekeeps the old nearest-endpoint rule,position_atstill returns a tuple, and the default window is still 90 minutes.Design decisions to review
fix_at, not onposition_at, to avoid breaking v0.1.0 callers.--strictflag on the command line tool. Consumers pick the mode in code.Test plan
ruff check .andruff format --check .clean.Acceptance
test_strict_mode_refuses_a_capture_inside_a_gap_wider_than_the_limit,test_legacy_mode_places_a_capture_near_an_endpoint_of_a_three_hour_gap, README policy section.