A Thompson writes:
> You can do it in OsmAnd by loading the track into the "Measure Distance"
> tool, which has a dual role as a tool for manually creating and editing GPX
> tracks.
[ ... ]
> A limitation is that if your track has very many points it takes
> ridiculously long to scroll down the list to delete points from the end.
> For privacy, I often want to delete the start and end of a recorded track
> before sharing it, so this is a pain. Does anyone know a solution?
I don't have a solution within OsmAnd, but tracks are pretty easy to
edit on a computer. Load the .gpx file into a text editor (not a
word processor) and you'll see each point looking something like:
<trkpt lat="35.8208486" lon="-106.5913003">
<ele>2466.79</ele>
<time>2020-09-02T18:44:09Z</time>
<hdop>4</hdop>
<extensions>
<speed>0.88</speed>
</extensions>
</trkpt>
If you already know how many points you want to delete, it's easy.
Just be sure you delete from a <trkpt ...> to the corresponding
</trkpt>, and don't delete the </trkseg> after the last </trkpt>.
If you aren't how many to delete, I've found the <speed> to be
useful in determining bad points.
For instance, after a hike, I invariably get in the car and start
driving away before realizing that I didn't stop track logging. But
that's no problem: when I get home and upload the track, I can
grep speed filename.gpx
(grep is a program on Linux that prints all the lines that have
"speed" in them; Mac has grep too, I'm sure Windows has an
equivalent). Grep prints a bunch of lines that look like:
<speed>1.05</speed>
<speed>0.15</speed>
<speed>1.05</speed>
<speed>0.57</speed>
<speed>0.81</speed>
<speed>0.61</speed>
<speed>0.96</speed>
<speed>0.7</speed>
<speed>0.53</speed>
<speed>0.98</speed>
... hundreds of lines like that, and at the end it'll be something like:
<speed>0.94</speed>
<speed>0.88</speed>
<speed>2.07</speed>
<speed>5.02</speed>
<speed>15.42</speed>
<speed>25.67</speed>
<speed>31.14</speed>
<speed>44.52</speed>
See what's happening? The hike is all under about 4 kph, and then
suddenly at the end it goes to much higher speeds, because I got
in the car. So all I have to do is edit the file, search for that
<speed>15.42</speed>, and delete all the trackpoints from there
to the end.
I know this all probably sounds geeky and difficult, but it really
isn't. Try it and you'll see it's not that bad. I have a program
that lets me point and click to split a track, and as A Thompson
points out, you can do it in OsmAnd: but I find it much quicker and
easier to just open the file in a text editor and delete that way,
if all I need to do is delete a few trackpoints at the end.
Be sure to make a backup of your GPX file first, in case you make
a mistake (like if you delete that all-important </trkseg>).
...Akkana