Skip to content
This repository was archived by the owner on Jun 13, 2022. It is now read-only.

Fix distance problem when data are not sorted by date #5

Closed
wants to merge 2 commits into from
Closed

Fix distance problem when data are not sorted by date #5

wants to merge 2 commits into from

Conversation

corossig
Copy link

First, thank you very much for this project.
I encountered a problem of distance calculation with data comming from my watch Huawei Pro Band 3, distance was too big for being a normal run (36 millions of meters 😄 ).
Problem comes from GPS data in anarchic order.

The first commit just add a sort on GPS data for fixing this problem.

The second commit is more a cosmetic one, I added some variables in process_gps for clearness. Special GPS lost points (90, -80) are now always ignore, so distance computation isn't wrong anymore when one of these points is part of data

@aricooperdavis
Copy link
Owner

Thanks for looking into it and fixing it, that looks good! Would you be able to post the HiTrack file that caused problems?

I haven't had a proper chance to look into your code yet (and won't until Thursday) but is there any reason you have decided to do that filtering of lost GPS points by default rather than keep it as an optional flag at the command line?

@corossig
Copy link
Author

corossig commented Apr 1, 2019

HiTrack_01_06.gz

For the filtering, there is no major reason, it's just that I don't understand how a lost GPS point can be useful in distance computation. For me, without any options, we must obtain the best result, maybe filtering can be set on by default and an option can still be available to disable it.

@aricooperdavis
Copy link
Owner

aricooperdavis commented Apr 1, 2019

That makes a lot of sense, thank you for your contribution! I've accepted your first commit with no changes, but I'd like to keep all of the filtering within the filter_data() function if possible, so rather than accept your second commit I've made filtering of "bad" GPS points the default, which can be disabled with the -f flag! Does that seem like a good alternative? 😄

@corossig
Copy link
Author

corossig commented Apr 2, 2019

Yes, it's a pretty good one. Thanks

@yeahsmaggy
Copy link

I have a HiTrack file that I took from a backup of my Honor Watch Magic, I converted it with your tool and used gpsvisualizer.com

Looks like there are some gaps come up when I import it. Might be just the way this website displays it though.

Archive.zip
Screenshot 2019-04-06 at 09 40 16

@yeahsmaggy
Copy link

I used http://www.gpsvisualizer.com/convert_input?convert_format=gpx to convert the tcx successfully to GPX and there is an advanced option on this page to "connect segments". I then imported the GPX into my maps on google maps and was able to view with a continuous line.

@thejoker1971
Copy link

Hi sir, im having issue running the latest version 2.3... im still using the old version with -v -b arguments... it is working with me but not the newest version 2.3... here are my batch file and error result... and how to use XML validation... i have internet and i already downloaded the XSD file... but still nothing... then how to use PIP INSTALL XMLSCHEMAS... thanks...


batch file

@echo off
echo.
"C:\Users*******\AppData\Local\Programs\Python\Py thon37\python.exe" Huawei-TCX-Converter.py --file %1 --sport Cycle
echo.
pause


error output

Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
Traceback (most recent call last):
File "Huawei-TCX-Converter.py", line 926, in
class TcxActivity:
File "Huawei-TCX-Converter.py", line 944, in TcxActivity
filename_prefix: str = None):
NameError: name 'xmlschema' is not defined

@CTHRU
Copy link
Collaborator

CTHRU commented Sep 23, 2019

@thejoker1971

I created a new bug #36 for your last report, see also comments over there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants