Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

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

Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

Ulrich Epperlein

Hello,

 

I’ve been using GPSBabel for several years, especially for simplifying recorded tracks using the error option

(for instance "-x simplify,error=0.003k")

 

Recently I recognized the following problem: Each time the filter is applied, it removes at least one point. As long as there are points within the error range specified, they are removed as expected. However, if the program cannot find one point located inside the limits, it will remove that one that is next nearest to the limit.

 

This is hard to recognize as long as the track contains lots of points, but it’s becoming important if you are trying to re-simplify a track yet simplified.

 

The types of input and output files do not seem to have any influence. Version 1.5.1 is affected as well as 1.4.4.

I would appreciate if this problem could be solved in any future version.

 

Best regards,
Ulrich

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

Robert Lipe-4
These things tend to be quite data dependent.  Can you provide a reproducible test case, please - one that we can ultimlately add to our regression tests so we don't bozo this again in the future would be best.  One with five points and a full command line to trigger it and highlighting the "bad" data  is better than one with 10 million.


On Wed, Jun 25, 2014 at 2:28 PM, Ulrich Epperlein <[hidden email]> wrote:

Hello,

 

I’ve been using GPSBabel for several years, especially for simplifying recorded tracks using the error option

(for instance "-x simplify,error=0.003k")

 

Recently I recognized the following problem: Each time the filter is applied, it removes at least one point. As long as there are points within the error range specified, they are removed as expected. However, if the program cannot find one point located inside the limits, it will remove that one that is next nearest to the limit.

 

This is hard to recognize as long as the track contains lots of points, but it’s becoming important if you are trying to re-simplify a track yet simplified.

 

The types of input and output files do not seem to have any influence. Version 1.5.1 is affected as well as 1.4.4.

I would appreciate if this problem could be solved in any future version.

 

Best regards,
Ulrich

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc



------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

Ulrich Epperlein

Dear Robert,

 

thank you for your fast response. Please find attached to this mail an example file ‘test_file.gpx’ just created for demonstration purpose. It contains one track based on 5 points.

 

Point 3 and 4 are situated quite perfectly on the virtual line from point 2 to point 5. Their distance to that virtual line should be less than 3 meters (I didn’t really check this, however).

 

As expected, the filter job performed by the following command removes point 3 and point 4:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified.gpx

 

The resulting output file still contains 3 points. Point 2 of them is certainly located much more than 3 meters from the virtual line connecting point 1 with point 3. Nevertheless, it is removed by the following command:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file_simplified.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified2.gpx

 

Best regards,

Ulrich

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Mittwoch, 25. Juni 2014 22:46
An: Ulrich Epperlein
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

 

These things tend to be quite data dependent.  Can you provide a reproducible test case, please - one that we can ultimlately add to our regression tests so we don't bozo this again in the future would be best.  One with five points and a full command line to trigger it and highlighting the "bad" data  is better than one with 10 million.

 

On Wed, Jun 25, 2014 at 2:28 PM, Ulrich Epperlein <[hidden email]> wrote:

Hello,

 

I’ve been using GPSBabel for several years, especially for simplifying recorded tracks using the error option

(for instance "-x simplify,error=0.003k")

 

Recently I recognized the following problem: Each time the filter is applied, it removes at least one point. As long as there are points within the error range specified, they are removed as expected. However, if the program cannot find one point located inside the limits, it will remove that one that is next nearest to the limit.

 

This is hard to recognize as long as the track contains lots of points, but it’s becoming important if you are trying to re-simplify a track yet simplified.

 

The types of input and output files do not seem to have any influence. Version 1.5.1 is affected as well as 1.4.4.

I would appreciate if this problem could be solved in any future version.

 

Best regards,
Ulrich

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

test_file.gpx (688 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

Robert Lipe-4
Are you saying that last command results in only two points in the result for you?  I'm not on Windows (and it'll be some time before I can check) but I see three:

    <trkseg>
      <trkpt lat="49.214753550" lon="10.231210620"/>
      <trkpt lat="49.563101080" lon="10.652470080"/>
      <trkpt lat="49.233920830" lon="11.059394240"/>
    </trkseg>

There is some non-obvious math in smplrout.cc; perhaps we're running afoul of Windows floating point weirdness.


On Sun, Jun 29, 2014 at 11:43 AM, Ulrich Epperlein <[hidden email]> wrote:

Dear Robert,

 

thank you for your fast response. Please find attached to this mail an example file ‘test_file.gpx’ just created for demonstration purpose. It contains one track based on 5 points.

 

Point 3 and 4 are situated quite perfectly on the virtual line from point 2 to point 5. Their distance to that virtual line should be less than 3 meters (I didn’t really check this, however).

 

As expected, the filter job performed by the following command removes point 3 and point 4:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified.gpx

 

The resulting output file still contains 3 points. Point 2 of them is certainly located much more than 3 meters from the virtual line connecting point 1 with point 3. Nevertheless, it is removed by the following command:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file_simplified.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified2.gpx

 

Best regards,

Ulrich

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Mittwoch, 25. Juni 2014 22:46
An: Ulrich Epperlein
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

 

These things tend to be quite data dependent.  Can you provide a reproducible test case, please - one that we can ultimlately add to our regression tests so we don't bozo this again in the future would be best.  One with five points and a full command line to trigger it and highlighting the "bad" data  is better than one with 10 million.

 

On Wed, Jun 25, 2014 at 2:28 PM, Ulrich Epperlein <[hidden email]> wrote:

Hello,

 

I’ve been using GPSBabel for several years, especially for simplifying recorded tracks using the error option

(for instance "-x simplify,error=0.003k")

 

Recently I recognized the following problem: Each time the filter is applied, it removes at least one point. As long as there are points within the error range specified, they are removed as expected. However, if the program cannot find one point located inside the limits, it will remove that one that is next nearest to the limit.

 

This is hard to recognize as long as the track contains lots of points, but it’s becoming important if you are trying to re-simplify a track yet simplified.

 

The types of input and output files do not seem to have any influence. Version 1.5.1 is affected as well as 1.4.4.

I would appreciate if this problem could be solved in any future version.

 

Best regards,
Ulrich

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

 



------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

Ulrich Epperlein

That’s right. What I get in the second step on Windows is just this:

 

    <trkseg>

      <trkpt lat="49.214753550" lon="10.231210620"/>

      <trkpt lat="49.233920830" lon="11.059394240"/>

    </trkseg>

 

Ulrich

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Sonntag, 29. Juni 2014 19:32
An: Ulrich Epperlein
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

 

Are you saying that last command results in only two points in the result for you?  I'm not on Windows (and it'll be some time before I can check) but I see three:

    <trkseg>

      <trkpt lat="49.214753550" lon="10.231210620"/>

      <trkpt lat="49.563101080" lon="10.652470080"/>

      <trkpt lat="49.233920830" lon="11.059394240"/>

    </trkseg>

There is some non-obvious math in smplrout.cc; perhaps we're running afoul of Windows floating point weirdness.

 

On Sun, Jun 29, 2014 at 11:43 AM, Ulrich Epperlein <[hidden email]> wrote:

Dear Robert,

 

thank you for your fast response. Please find attached to this mail an example file ‘test_file.gpx’ just created for demonstration purpose. It contains one track based on 5 points.

 

Point 3 and 4 are situated quite perfectly on the virtual line from point 2 to point 5. Their distance to that virtual line should be less than 3 meters (I didn’t really check this, however).

 

As expected, the filter job performed by the following command removes point 3 and point 4:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified.gpx

 

The resulting output file still contains 3 points. Point 2 of them is certainly located much more than 3 meters from the virtual line connecting point 1 with point 3. Nevertheless, it is removed by the following command:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file_simplified.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified2.gpx

 

Best regards,

Ulrich

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Mittwoch, 25. Juni 2014 22:46
An: Ulrich Epperlein
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

 

These things tend to be quite data dependent.  Can you provide a reproducible test case, please - one that we can ultimlately add to our regression tests so we don't bozo this again in the future would be best.  One with five points and a full command line to trigger it and highlighting the "bad" data  is better than one with 10 million.

 

On Wed, Jun 25, 2014 at 2:28 PM, Ulrich Epperlein <[hidden email]> wrote:

Hello,

 

I’ve been using GPSBabel for several years, especially for simplifying recorded tracks using the error option

(for instance "-x simplify,error=0.003k")

 

Recently I recognized the following problem: Each time the filter is applied, it removes at least one point. As long as there are points within the error range specified, they are removed as expected. However, if the program cannot find one point located inside the limits, it will remove that one that is next nearest to the limit.

 

This is hard to recognize as long as the track contains lots of points, but it’s becoming important if you are trying to re-simplify a track yet simplified.

 

The types of input and output files do not seem to have any influence. Version 1.5.1 is affected as well as 1.4.4.

I would appreciate if this problem could be solved in any future version.

 

Best regards,
Ulrich

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

 

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

tsteven4-2
I get the same results as Ulrich on centos 6 and windows 7.  I don't think this is a windows specific issue.
The problem is that totalerror is initially set to zero, so we always throw out at least one point.

A possible fix is below.  I am not confident it is correct for the length option.

~/work/gc/trunk% svn diff smplrout.cc
Index: smplrout.cc
===================================================================
--- smplrout.cc    (revision 4873)
+++ smplrout.cc    (working copy)
@@ -319,6 +319,7 @@
   for (i = 0; i < xte_count; i++) {
     xte_recs[i].intermed->xte_rec = xte_recs+i;
   }
+  totalerror=xte_recs[xte_count-1].distance;
   /* while we still have too many records... */
   while ((xte_count) && ((countopt && count < xte_count) || (erroropt && totalerror < error))) {
     i = xte_count - 1;


This is a famous problem.  We seem to have a number of home grown solutions.  Perhaps we should implement some of the standard algorithums, e.g. Ramer-Douglas–Peucker.   http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm

On 6/29/2014 11:58 AM, Ulrich Epperlein wrote:

That’s right. What I get in the second step on Windows is just this:

 

    <trkseg>

      <trkpt lat="49.214753550" lon="10.231210620"/>

      <trkpt lat="49.233920830" lon="11.059394240"/>

    </trkseg>

 

Ulrich

 

Von: [hidden email] [[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Sonntag, 29. Juni 2014 19:32
An: Ulrich Epperlein
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

 

Are you saying that last command results in only two points in the result for you?  I'm not on Windows (and it'll be some time before I can check) but I see three:

    <trkseg>

      <trkpt lat="49.214753550" lon="10.231210620"/>

      <trkpt lat="49.563101080" lon="10.652470080"/>

      <trkpt lat="49.233920830" lon="11.059394240"/>

    </trkseg>

There is some non-obvious math in smplrout.cc; perhaps we're running afoul of Windows floating point weirdness.

 

On Sun, Jun 29, 2014 at 11:43 AM, Ulrich Epperlein <[hidden email]> wrote:

Dear Robert,

 

thank you for your fast response. Please find attached to this mail an example file ‘test_file.gpx’ just created for demonstration purpose. It contains one track based on 5 points.

 

Point 3 and 4 are situated quite perfectly on the virtual line from point 2 to point 5. Their distance to that virtual line should be less than 3 meters (I didn’t really check this, however).

 

As expected, the filter job performed by the following command removes point 3 and point 4:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified.gpx

 

The resulting output file still contains 3 points. Point 2 of them is certainly located much more than 3 meters from the virtual line connecting point 1 with point 3. Nevertheless, it is removed by the following command:

"C:\Program Files (x86)\GPSBabel\gpsbabel" -t -i gpx -f test_file_simplified.gpx -x simplify,error=0.003k -o gpx -F test_file_simplified2.gpx

 

Best regards,

Ulrich

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Mittwoch, 25. Juni 2014 22:46
An: Ulrich Epperlein
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Simplify Filter: GPSBabel removes one trackpoint even if it is located outside the error range specified

 

These things tend to be quite data dependent.  Can you provide a reproducible test case, please - one that we can ultimlately add to our regression tests so we don't bozo this again in the future would be best.  One with five points and a full command line to trigger it and highlighting the "bad" data  is better than one with 10 million.

 

On Wed, Jun 25, 2014 at 2:28 PM, Ulrich Epperlein <[hidden email]> wrote:

Hello,

 

I’ve been using GPSBabel for several years, especially for simplifying recorded tracks using the error option

(for instance "-x simplify,error=0.003k")

 

Recently I recognized the following problem: Each time the filter is applied, it removes at least one point. As long as there are points within the error range specified, they are removed as expected. However, if the program cannot find one point located inside the limits, it will remove that one that is next nearest to the limit.

 

This is hard to recognize as long as the track contains lots of points, but it’s becoming important if you are trying to re-simplify a track yet simplified.

 

The types of input and output files do not seem to have any influence. Version 1.5.1 is affected as well as 1.4.4.

I would appreciate if this problem could be solved in any future version.

 

Best regards,
Ulrich

 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

 

 



------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc