stefanocudini/gpx-simplify-optimizer

Multisegment tracks management

Closed this issue · 3 comments

It seems that tracks containing several fragments are not managed correctly. Here you can find an example of this incorrect management. No simplification was chosen here, it is a simple resaving of a file.

You can see that only two points are read from the multisegment file. Moreover, you can find out that latitude in the output file has actually value of some longtitude of the original file, i.e. both latitude and longtitude are got from only longtitude of the original file.

It looks like unexpected JSON-based shift in depth of an input data because of several segments of a single track, i.e. each track segment is interpreted like a track point (that's why we are getting two-points track when we have two segments), then each point's longtitude is interpreted as a coordinate of a current point and so on.

Thank you for your report @buzden .
I will look into it at the end of january.

Hi,
First of all, I'm sorry I'm a little late ;-)
I think I fixed your bug. Your diagnosis was good.

I'm still working on fixing unit testing, but can you try it and confirm it's ok for you on this fork : http://www.wilkins.fr/gpx/

Thank you, multisegment tracks are loaded nicely now.

But, I can't say there is a full support. For instance, when you play with the source and simplified checkboxes, you can realize that only the last segment is operated by them.

Moveover, you can notice that after checking off and then checking on the source checkbox, the source line of the last segment is shown on the top of the simplified line (that's why, the simplified line almost cannot be seen).