Filtering tracks

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Filtering tracks

Graham Wall
I have a large GPX file full of track-logs. I would like to be able to
filter the points in the tracks based on a radius from a given point.
I know this can be done on waypoints, but it doesn't seem to work on
trackpoints. I have been using the following command:

gpsbabel -i gpx -f merged.gpx -x
radius,distance=1K,lat=51.78,lon=-2.56 -o gpx -F filtered.gpx

Is there a way to filter tracks this way, or if not, a way of
converting from track points to waypoints?

The reason I ask is that I would like to upload my data to
openstreetmap.org, but only for certain cities at a time. As far as I
know OSM doesn't care about the way tracks are joined, just the
position of the points.

Graham


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Gpsbabel-misc mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Filtering tracks

Robert Lipe
Graham Wall wrote:

> I have a large GPX file full of track-logs. I would like to be able to
> filter the points in the tracks based on a radius from a given point.
> I know this can be done on waypoints, but it doesn't seem to work on
> trackpoints. I have been using the following command:

It doesn't work on tracks because none of us have figured out an
appropriately brilliant way to apply a radius filter to a track.

When you start considering that a track may be broken in to multiple
tracks by the radius operation, things get ugly quickly.

> gpsbabel -i gpx -f merged.gpx -x
> radius,distance=1K,lat=51.78,lon=-2.56 -o gpx -F filtered.gpx
>
> Is there a way to filter tracks this way, or if not, a way of
> converting from track points to waypoints?

Since you don't care about sequencing or starting/ending points, you
can transfer them to one of the slightly track-aware formats to do the
operation.   Something groady like:

gpsbabel -i gpx -f merged.gpx -o arc -F - | gpsbabel -i arc -f - -x  radius,distance=1K,lat=51.78,lon=-2.56 -o gpx -F filtered.gpx

might give you what I think you're wanting.  Maybe.

> The reason I ask is that I would like to upload my data to
> openstreetmap.org, but only for certain cities at a time. As far as I
> know OSM doesn't care about the way tracks are joined, just the
> position of the points.

That's a strong disclaimer and pretty much the only reason the sleaze
above will work.  :-)

Note that at this point you haven't really filtered a track; you've
decayed the track to a set of points and lost the sequencing.

I've considered a filter that would convert tracks/routes/waypoints
for all the good and evil that would entail...

RJL


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Gpsbabel-misc mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc