Forum: General Topics

Forums / General Topics / Weird GPX Import Problem.

 

Subject:Weird GPX Import Problem. 

ChrisM

13:18
Tuesday
20-May-2008

Location:
Bedfordshire, UK

Phone Model:
Sony Ericsson W770i, Blackberry Playbook(?)

I have a GPX file created by another application (Navigami is it matters).
According to the header in the file, it is GPX version 1.1

When I import this file into say google earth, it seems to work fine, the route looks about right.

However, if I import it into TMJ it goes totally mad. I finish up with a route that seems to go due south, and finish up somewhere in the middle of Africa. (not bad for a brisk afternoon's walk!!)

Anyone got an idea what's going wrong...?

Regards,
Chris.
 

Stephen

14:51
Tuesday
20-May-2008

Location:
Surrey, UK

Phone Model:
BB 9800 Torch
BlackBerry 8900
SE W910i
Nokia 5800

Hi Chris,

To be honest there are a few bugs in the GPX import function - it currently only imports a subset of the various GPX 'tags' so files created in other apps might have varying success. If you'd like to e-mail me the file off-list (send it to 'comments at trackmyjourney dot co dot uk') I'll have a look and see if I can fix it...

Cheers,
Stephen
 

Stephen

19:00
Tuesday
20-May-2008

Location:
Surrey, UK

Phone Model:
BB 9800 Torch
BlackBerry 8900
SE W910i
Nokia 5800

Hi Chris,

Thanks for sending the example files, it certainly does seem to be a weird bug! It seems to be a problem with the XML parser that I've used which is getting confused by the <trkpt> marker being split over a number of lines. (Not sure why I've not spotted this before, as its perfectly within the XML guidelines for the tags to be separated like this!).

For example, in your sample file the following code gets imported incorrectly:

<trkpt lat="51.###" lon="-0.6###">
<ele>134.0</ele>
<time>2008-05-12T10:56:55+00:00</time>
</trkpt>
<trkpt lat="51.###" lon="-0.7###">
<ele>132.0</ele>
<time>2008-05-12T10:57:30+00:00</time>
</trkpt>


But by doing a quick search/replace on the file to get each <trkpt>...</trkpt> on its own line, the following then imports correctly:

<trkpt lat="51.###" lon="-0.6###"><ele>134.0</ele><time>2008-05-12T10:56:55+00:00</time></trkpt>
<trkpt lat="51.###" lon="-0.7###"><ele>132.0</ele><time>2008-05-12T10:57:30+00:00</time></trkpt>


I'll look into why this is happening, in the meantime the search/replace fix can be used as a temporary workaround. (I'll e-mail you back your two corrected sample files).

Regards,
Stephen
 

ChrisM

8:25
Wednesday
21-May-2008

Location:
Bedfordshire, UK

Phone Model:
Sony Ericsson W770i, Blackberry Playbook(?)

Hi Stephen,

Thanks for such a quick response AND solution to my problem, and well done for spotting a fairly obscure bug so fast!

Just to make sure I iunderstand, I should bascially remove all line breaks except the ones after each </trkpt> tag, or to put it another way, the file should consist of just long lines in the form:
<trkpt>.................</trkpt>
<trkpt>.................</trkpt>
etc.

Keep up the good work with TMJ!!

Regards,

Chris.
 

Stephen

9:38
Wednesday
21-May-2008

Location:
Surrey, UK

Phone Model:
BB 9800 Torch
BlackBerry 8900
SE W910i
Nokia 5800

Yep, I think that should do it. Hopefully I'll have a fix for the website soonish anyhow...

Cheers,
Stephen
 
 

ChrisM

11:59
Tuesday
22-Jul-2008

Location:
Bedfordshire, UK

Phone Model:
Sony Ericsson W770i, Blackberry Playbook(?)

Hi Stephen,

Just noticed that importing a GPX file from another source still causes a problem. Its the same problem as before, with the same solution (remove extra line breaks)

It's no big deal, now that I know how to fix it, but just thought I'd remind you, in case you didn't have anything much to do... ;-)

Chris.
 

(You must be logged in to post a reply to this thread)