Modify a GPX Track - how to?

340 views
Skip to first unread message

hjar...@gmail.com

unread,
Sep 19, 2020, 5:45:20 PM9/19/20
to OsmAnd
Hi, I have a recorded GPX Track where the last few points are rubbish since the battery dropped low. Is it possible to remove these last waypoints from the track.?
Thanks for a hint 
Helmut 

danilo baggini

unread,
Sep 19, 2020, 10:50:38 PM9/19/20
to Osmand Chat
You can edit the track with a normal text editor and manually do the corrections

--
You received this message because you are subscribed to the Google Groups "OsmAnd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmand/49ec6b7b-392f-4080-9607-b8c2c312d95an%40googlegroups.com.

Tom Crocker

unread,
Sep 20, 2020, 1:59:41 AM9/20/20
to OsmAnd
You can do it graphically using JOSM on a computer. Open the gpx, convert it to data and ignore the warnings, delete the bad points (some imagery will help here), export the gpx.

A Thompson

unread,
Sep 20, 2020, 8:00:45 PM9/20/20
to OsmAnd
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.

Tap on your track in My_Places>Tracks. At the bottom-left of the next screen (you may have to scroll down) tap on the three dots and choose "Edit." This loads your track into the measure distance tool. 

You can add points, but also delete: Tap on the blue track symbol in the bottom left corner to bring up a list of points, and tap on the X next to a point to delete it.

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?

Akkana Peck

unread,
Sep 20, 2020, 8:54:02 PM9/20/20
to OsmAnd
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

Helmut Jarausch

unread,
Sep 21, 2020, 4:15:47 PM9/21/20
to osm...@googlegroups.com
Could you please elaborate a bit. I couldn't find an option to delete a waypoint/segment.
Thanks 
Helmut 

--
You received this message because you are subscribed to the Google Groups "OsmAnd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.

A Thompson

unread,
Sep 21, 2020, 8:21:36 PM9/21/20
to OsmAnd
Here it is in pictures!

Select your GPX:
1.jpg

Click on the three dots in the bottom left of the next screen:
2.jpg 3.jpg

Choose "Edit":
4.jpg

You are now in the "Measure Distance" tool. Tap on the blue symbol to bring up a list of points:
5.jpg

Tap a cross to delete a point:
6.jpg

...or on the name of a point to bring up more options:
6_2.jpg7.jpg

...but for a recorded track there can easily be so many points that it takes too long to scroll through them to get to the end!

As has been noted, it's easy to edit GPX on a PC (I use Viking - free, open-source, Linux, Windows) but that adds some time and effort if you just wanted to make a quick fix.

I hope that helps! Best wishes.



On Monday, September 21, 2020 at 9:15:47 PM UTC+1, Helmut Jarausch wrote:
Could you please elaborate a bit. I couldn't find an option to delete a waypoint/segment.
Thanks 
Helmut 

A Thompson <thomp...@gmail.com> schrieb am Mo., 21. Sep. 2020, 02:00:
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.

Tap on your track in My_Places>Tracks. At the bottom-left of the next screen (you may have to scroll down) tap on the three dots and choose "Edit." This loads your track into the measure distance tool. 

You can add points, but also delete: Tap on the blue track symbol in the bottom left corner to bring up a list of points, and tap on the X next to a point to delete it.

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?


On Saturday, September 19, 2020 at 10:45:20 PM UTC+1, hjar...@gmail.com wrote:
Hi, I have a recorded GPX Track where the last few points are rubbish since the battery dropped low. Is it possible to remove these last waypoints from the track.?
Thanks for a hint 
Helmut 

--
You received this message because you are subscribed to the Google Groups "OsmAnd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osm...@googlegroups.com.

Tom Crocker

unread,
Sep 22, 2020, 12:25:08 PM9/22/20
to OsmAnd
Thanks very much. Good to know about those options. Hadn't found either before!

To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmand/016418bd-23e4-40ce-80bd-c43d4d9adb8eo%40googlegroups.com.

Helmut Jarausch

unread,
Sep 22, 2020, 2:53:22 PM9/22/20
to osm...@googlegroups.com
Many thanks for that excellent explanation.
Again one of OSMAnds hidden gems. 
Helmut 

To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmand/016418bd-23e4-40ce-80bd-c43d4d9adb8eo%40googlegroups.com.

A Thompson

unread,
Sep 23, 2020, 10:32:11 PM9/23/20
to OsmAnd
Thanks for the thanks! 

I was just experimenting... while in the "Measure Distance" tool, if you pinch-zoom onto any part of your track in the map part of the display, eventually you see the individual waypoints. If you long-press on one, then you can move it around without having to access the list of points. 

This doesn't address my use-case of wanting to delete about a kilometre from the beginning and end of a track, but at least it allows for some adjustment even to the end of a track without having to scroll to the end of the list of points if it is very long.

Helmut Jarausch

unread,
Sep 24, 2020, 4:25:12 AM9/24/20
to osm...@googlegroups.com
I have a tiny feature request. It would be nice if scrolling the waypoint list would wrap around, esp. when scrolling down at the first waypoint one would have immediate access to the last one.
Helmut 

To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmand/fa70cc4d-1b91-4bf5-91e1-d8c7b4db0c30o%40googlegroups.com.

Xavier

unread,
Sep 24, 2020, 10:45:17 AM9/24/20
to osm...@googlegroups.com
On Thu, Sep 24, 2020 at 10:24:50AM +0200, Helmut Jarausch wrote:
>I have a tiny feature request. It would be nice if scrolling the waypoint
>list would wrap around, esp. when scrolling down at the first waypoint one
>would have immediate access to the last one.
>Helmut

Feature requests should be submitted to the OsmAnd issues tracker on
Github here:

https://github.com/osmandapp/OsmAnd/issues

This group is users helping users, while a developer does drop by
occasionally, they do not regularally monitor this group for feature
requests or bug reports.

Werner

unread,
Sep 24, 2020, 11:52:56 AM9/24/20
to OsmAnd
A very easy program for doing such jobs is RouteConverter, a freeware on PC.

Werner

Helmut Jarausch

unread,
Sep 24, 2020, 12:44:03 PM9/24/20
to osm...@googlegroups.com
Thanks for the hint.
Unfortunately when I am on holiday I have only my tablet and my phone with me. 


--
You received this message because you are subscribed to the Google Groups "OsmAnd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.

A Thompson

unread,
Sep 25, 2020, 9:31:05 PM9/25/20
to OsmAnd
Wow, they've improved everything in the 3.8 Android update! Now you can just open "Plan a route" (used to be "Measure distance") and select your GPX. And lots of other cool stuff.

Helmut - I noticed your request on github for the wrap-around of the points list, but it you hit "Options" there is now "Reverse Route" which makes it easy to access the end of the track (you can always reverse a second time when you have finished editing).

Thanks, developers!
Reply all
Reply to author
Forward
0 new messages