track filter for gpsbabel

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

track filter for gpsbabel

Olaf Klein
Dear all,

i've created a new filter for gpsbabel. The idea to concatenate tracks comes
from PathAway. And also i've seen the problem on my last tour, because
Garmin-Quest can store up to 10000 track points and after four days i had 48
logs on device. With the new filter you can pack all tracks in one big track,
and if you wish, split in tracks for each day. More details are in README.

O.K.

014-trackfilter.patch (28K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: track filter for gpsbabel

Robert Lipe
Olaf Klein wrote:

> i've created a new filter for gpsbabel. The idea to concatenate tracks comes
> from PathAway. And also i've seen the problem on my last tour, because

I like the idea of this.   The way Garmins create new tracks every
time they lose a lock, I see value in being able to smoosh them back
together.

And just so I'm an equal opportunity grumbler, the way Magellans don't
have a concept of separate tracks at all but rather just give you
a single track of everywhere the receiver has ever been is kind of
annoying, too.



+       PACK
+
+           With this default option all tracks from input will be packed
+           into one track. If tracks overlaps in time, the filter stops
working.

"Stops working" how?  Doesn't consider any more track points as
candidates for merge or undoes any merges done until this was seen?

+static int
+trackfilter_qsort_cb(const void *a, const void *b)
+{
+       const trkflt_t *ra = a;
+       const trkflt_t *rb = b;
+
+       if (ra->first_time < rb->first_time) return -1;
+       else if (ra->first_time > rb->first_time) return +1;
+       else return 0;
+}

Isn't this "return ra->first_time - rb->first_time;"


I'll apply this as soon as thing restabilize after the vitosmt work.

Thanx,
RJL

--
Support GPSBabel by helping to improve it or fund those that that have
done so.  Visit:

        http://sourceforge.net/donate/index.php?group_id=58972


-------------------------------------------------------
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-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Reply | Threaded
Open this post in threaded view
|

Re: track filter for gpsbabel

Robert Lipe
In reply to this post by Olaf Klein
Olaf Klein wrote:

> i've created a new filter for gpsbabel. The idea to concatenate tracks comes

I've now applied this.  I did make some minor tweaks to the text in
README.

Thanx!
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-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Reply | Threaded
Open this post in threaded view
|

Re: track filter for gpsbabel

Robert Lipe
In reply to this post by Robert Lipe
> Olaf Klein wrote:
>
> > i've created a new filter for gpsbabel. The idea to concatenate tracks comes

Olaf, there's a problem with this code.  If you build with electric
fence, the test suite will show it.

(gdb) run
Starting program: /home/robertl/src/gpsbabel.sp/gpsbabel -t -i gpx -f reference/track/trackfilter.gpx -x track,pack,split,title="LOG-%Y%m%d" -o gpx -F
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0x601000

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <[hidden email]>

Program received signal SIGSEGV, Segmentation fault.
0x0018f932 in __tz_convert () from /lib/libc.so.6
(gdb) up
#1  0x0018dbe5 in localtime () from /lib/libc.so.6
(gdb)
#2  0x080895be in trackfilter_split () at trackfilter.c:284
284                 t1 = *localtime(&buff[i]->creation_time);
(gdb) l
279
280             curr = NULL;
281
282             for (i=0, j=1; j<count; i++, j++)
283             {
284                 t1 = *localtime(&buff[i]->creation_time);
285                 t2 = *localtime(&buff[j]->creation_time);
286                 if ((t1.tm_year != t2.tm_year) ||
287                     (t1.tm_mon != t2.tm_mon) || (t1.tm_mday != t2.tm_mday))
288                 {


'i' gets optimized away, but we can deduct it's j-1.

(gdb) p j
$2 = 54
(gdb) p *buff[52]
$3 = {Q = {next = 0xb7d51f68, prev = 0xb7d45f68},
  latitude = 30.050183000000001, longitude = -91.594099999999997,
  altitude = 0, depth = 0, proximity = 0, shortname = 0xb7d4bff8 "RPT053",
  description = 0x0, notes = 0x0, url = 0x0, url_link_text = 0x0, wpt_flags = {
    icon_descr_is_dynamic = 0, shortname_is_synthetic = 1}, icon_descr = 0x0,
  creation_time = 1022352818, centiseconds = 0, route_priority = 0, gc_data = {
    type = gt_unknown, container = gc_unknown, id = 0, diff = 0, terr = 0,
    exported = 0, last_found = 0, placer = 0x0, hint = 0x0, desc_short = {
      is_html = 0, utfstring = 0x0}, desc_long = {is_html = 0,
      utfstring = 0x0}}, gpx_extras = 0x0, an1_extras = 0x0, extra_data = 0x0}
(gdb) p *buff[53]
$4 = {Q = {next = 0x0, prev = 0x0}, latitude = 0, longitude = 0, altitude = 0,
  depth = 0, proximity = 0, shortname = 0x0, description = 0x0, notes = 0x0,
  url = 0x0, url_link_text = 0x0, wpt_flags = {icon_descr_is_dynamic = 0,
    shortname_is_synthetic = 0}, icon_descr = 0x0, creation_time = 0,
  centiseconds = 0, route_priority = 0, gc_data = {type = gt_unknown,
    container = gc_unknown, id = 0, diff = 0, terr = 0, exported = 0,
    last_found = 0, placer = 0x0, hint = 0x0, desc_short = {is_html = 0,
      utfstring = 0x0}, desc_long = {is_html = 0, utfstring = 0x0}},
  gpx_extras = 0x0, an1_extras = 0x0, extra_data = 0x0}
(gdb) p *buff[54]
$5 = {Q = {next = 0xb7d55f68, prev = 0xb7d49f68},
  latitude = 30.048449999999999, longitude = -91.594250000000002,
  altitude = 0, depth = 0, proximity = 0, shortname = 0xb7d53ff8 "RPT055",
  description = 0x0, notes = 0x0, url = 0x0, url_link_text = 0x0, wpt_flags = {
    icon_descr_is_dynamic = 0, shortname_is_synthetic = 1}, icon_descr = 0x0,
  creation_time = 1022439392, centiseconds = 0, route_priority = 0, gc_data = {
    type = gt_unknown, container = gc_unknown, id = 0, diff = 0, terr = 0,
    exported = 0, last_found = 0, placer = 0x0, hint = 0x0, desc_short = {
      is_html = 0, utfstring = 0x0}, desc_long = {is_html = 0,
      utfstring = 0x0}}, gpx_extras = 0x0, an1_extras = 0x0, extra_data = 0x0}


I don't know what happened to buff[53], but it not only doesn't have
a timestamp, it doesn't have much of anything else, either.


Can you please look into this?

Thanx,
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-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Reply | Threaded
Open this post in threaded view
|

Re: track filter for gpsbabel

Olaf Klein
In reply to this post by Olaf Klein
Uuups,
I see the problem.  The patch is against cvs. Additionally a've
added your in the callback function.

- Linux k8 2.6.11.4-OK8 #2 Thu Jun 16 02:12:45 CEST 2005 x86_64 GNU/Linux
- gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)

O.K.

014a-trackfilter.patch (711 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: track filter for gpsbabel

Robert Lipe
Olaf Klein wrote:

> I see the problem.  The patch is against cvs. Additionally a've
> added your in the callback function.

That's the ticket.   Thanx.

> - Linux k8 2.6.11.4-OK8 #2 Thu Jun 16 02:12:45 CEST 2005 x86_64 GNU/Linux
> - gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)

You should have access to both valgrind and electric fence...
(Just uncomment the -lefence in Makefile and relink.)

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-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Reply | Threaded
Open this post in threaded view
|

Re: vitosmt patch - timezone parameter

Olaf Klein
Robert wrote:

> I like this idea, but we"re tripped up in the details somewhere.  I had
> to adjust tzoffset to -7 in testo to make it work which makes me suspect
> either I"ve missed a patch or something doesn"t work the way you think
> it works.  Can you please chase this a little more?

I have to set tzoffset +7 in testo. With fixed refrence data we need fixed
timezone parameter additionally to the offset.

O.K.


-------------------------------------------------------
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-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Reply | Threaded
Open this post in threaded view
|

pathaway updates

Olaf Klein
In reply to this post by Robert Lipe
Hello Robert,

here comes some pathaway updates. I've added code for better detection of the
german release of pathaway. In pathaway data the coordinates comes always
before time information, so i can check for a 'Nxxx xx.xxxxx,Oyy yy.yyyyy'
coding. If data comes in 'W'-area, a valid year must me the indicator for
date formatted in 'DDMMYYYY'. I don't now any internal pathaway flag that
tells us in which form the date is formatted. Also i've added short name
handling.

In the README i've dropped a duplicate pathaway section (near the top).
And finally you can vaporize 'reference/track/pathaway.mps' which is never
longer needed for testo.

(P.S. electric fence works)

O.K.

016-pathaway-02.patch (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pathaway updates

Robert Lipe
Olaf Klein wrote:

> here comes some pathaway updates. I've added code for better detection of the
Looks good.   Applied.    Thanx.

> (P.S. electric fence works)

It really is a handy tool for catching bounds violations and heap abuse
such as writes past the end of malloced buffers, use after frees, double
frees, and such.

It's nice to just pop into a debugger for bugs like this:

        #include <stdlib.h>
        #include <string.h>
        main()
        {
           #define X "blah"
           char *foo=malloc(strlen(X));
           strcpy(foo, X);
        }


--
Support GPSBabel by helping to improve it or fund those that that have
done so.  Visit:

        http://sourceforge.net/donate/index.php?group_id=58972


-------------------------------------------------------
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-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code