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

Interpolate/Resample the gpx track #4

Open
burrscurr opened this issue Jan 4, 2021 · 0 comments
Open

Interpolate/Resample the gpx track #4

burrscurr opened this issue Jan 4, 2021 · 0 comments
Assignees
Labels
accuracy Conceptual changes in how deviation from a straight line is being calculated

Comments

@burrscurr
Copy link
Owner

burrscurr commented Jan 4, 2021

Currently, linesman compares each point of the gpx file with its closest point on the straight line. This means, that a section has a bigger density of GPS measurements, its influence on the accuracy measure of the whole line is bigger than that of a section with small density (for instance, when making good progress and thus moving faster).

As a straight line mission is about spatial accuracy, linesman should judge sections independently from the density of GPS measurements. Instead, the given GPS points should be used to interpolate the actual movement and calculate the deviation of the interpolated line from equidistant points on the straight line.

Interpolating the track

The simplest way of interpolating the track is to connect consecutive points with straight lines. The interpolation segments may be called edges.

Resampling

For each equidistant point on the reference line, the line orthogonal to the reference line through this point is being calculated. For each of these lines, the farthest intersection with the recorded line is determined (note that there may be more than one intersection, as the recorded track might briefly move backwards, e.g. when jittering around). Then, for each point on the reference line, there is a resampled point, which can be used to interpolate the track with equidistant points.

For high accuracy, the points considered on the reference line should be relatively close. Maybe, a suitable distance would be 1 meter.

Spherical geometry?

As both the distances from the reference line as well as the distances between consecutive points of the gps track in general are very small, using spherical calculation should not be necessary. However, the reference line is very long, so that spherical calculation may be necessary.

To calculate the smallest distance of the reference point to the interpolated line, the (spherical) line could be approximated by a regular line. Then, a vertical line to the reference line can be constructed and points of intersection with the edges of the interpolated line can be determined. Note that it is possible to have intersection points with multiple edges, for instance when the track goes back and forth on or around the reference line. In general, the farthest intersection point should be selected as value of the deviation from the base point on the reference line.

For performance reasons, just edges where one point is above and one point is below the vertical (shortest connection) line should be considered. Just in this case, an intersection is possible.

@burrscurr burrscurr added the accuracy Conceptual changes in how deviation from a straight line is being calculated label Jan 4, 2021
@burrscurr burrscurr changed the title Interpolate the gpx track Interpolate/Resample the gpx track Jan 13, 2021
@burrscurr burrscurr self-assigned this Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accuracy Conceptual changes in how deviation from a straight line is being calculated
Projects
None yet
Development

No branches or pull requests

1 participant