Skip to content

Preserve lap information in PathSimplifier#1209

Merged
gerhardol merged 1 commit into
jonasoreland:masterfrom
Emilv2:preserve_lap_information
Jan 25, 2026
Merged

Preserve lap information in PathSimplifier#1209
gerhardol merged 1 commit into
jonasoreland:masterfrom
Emilv2:preserve_lap_information

Conversation

@Emilv2

@Emilv2 Emilv2 commented Mar 21, 2025

Copy link
Copy Markdown
Contributor

I noticed lap times and distances changed quite a bit when simplifying the path, this PR tries to change that.

It looks like the code already simplifies by segment, I tried to make it so that every lap is a segment. I quickly tested it and it seems to work, but it's possible I overlooked some things.

@Emilv2

Emilv2 commented May 31, 2025

Copy link
Copy Markdown
Contributor Author

No comments?

@gerhardol

Copy link
Copy Markdown
Collaborator

I do not use the simplifier myself, have not considered the implications.
The PR was in draft, so I was kind of waiting for it to be updated. Can you rebase after the code was reformatted?

@gerhardol

Copy link
Copy Markdown
Collaborator

Can you rebase, we are preparing a release?

@Emilv2 Emilv2 force-pushed the preserve_lap_information branch 2 times, most recently from 85cf5b6 to b7a331b Compare January 19, 2026 22:12
@Emilv2 Emilv2 marked this pull request as ready for review January 19, 2026 22:56
@Emilv2

Emilv2 commented Jan 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the reminder, I rebased.

@gerhardol gerhardol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have not run, but should be fine.
This limits the segments that can be simplified, so the parts may become a little "zig-zag".
But still better to keep the points.

} else if (((lstate == Constants.DB.LOCATION.TYPE_PAUSE)
|| (lstate == Constants.DB.LOCATION.TYPE_END))
// also keep first and last location of a lap to preserve lap information
|| ((lstate == Constants.DB.LOCATION.TYPE_GPS) && lap != lap_prev)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

&& lap != lap_prev
is not needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right, it can be removed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

parenthesis should have been removed to, but we can leave it at this

Keep the first and last location of a lap so lap times and distances
are preserved when the path is simplified.
@Emilv2 Emilv2 force-pushed the preserve_lap_information branch from b7a331b to 8bd6e35 Compare January 22, 2026 22:36
@gerhardol gerhardol merged commit 489c3e9 into jonasoreland:master Jan 25, 2026
1 check passed
@gerhardol

Copy link
Copy Markdown
Collaborator

thanks!

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