Skip to content

Fix simplification of closed tracks with coincident endpoints - #308

Open
xiehuanyi wants to merge 1 commit into
tkrajina:devfrom
xiehuanyi:fix/simplify-coincident-endpoints-round3
Open

xiehuanyi wants to merge 1 commit into
tkrajina:devfrom
xiehuanyi:fix/simplify-coincident-endpoints-round3

Conversation

@xiehuanyi

Copy link
Copy Markdown

Simplifying a closed track whose points share a longitude can currently delete the entire excursion. With identical endpoints, the approximate baseline has no direction and selects the first interior point rather than the farthest point; a nearby first point then makes a 200 km loop collapse to two identical endpoints.

For coincident endpoints, select the farthest interior point by its 2D distance from the endpoint. Ordinary open-polyline simplification keeps its existing path.

Validation: a public track-segment regression fails on the original code, and a small-loop control still collapses within tolerance. All 154 unit tests pass. Strict mypy reports the same 19 existing errors on the unchanged base and this branch; repository CI runs the unit suite.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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