Locus Map - forum

Support => Troubles & Questions => Topic started by: kbfifi on May 21, 2012, 15:23:49

Title: GPX export to garmin GPS
Post by: kbfifi on May 21, 2012, 15:23:49
Hi Menion,

Thanks for a great program I'm using for almost a year now. I really like the improved support for geocaching last months. Unfortunately exporting the imported caches (from geocaching4Locus) doesn't work for me. I tried copying directly to my Garmin Dakota 20. Then it only shows the first cache only. Importing it in Garmin basecamp result in an error. I attached the exported gpx. It was exported with 2.3.4 using "compatible with mapsource" option. Hope you can help me.

Regards,
Kurt
Title: Re: GPX export to garmin GPS
Post by: kbfifi on May 27, 2012, 09:01:10
Nobody has these problems as well?
Title: Re: GPX export to garmin GPS
Post by: gynta on May 27, 2012, 12:02:41
btw
open in mapsource also failed.
Title: Re: GPX export to garmin GPS
Post by: stebu on May 27, 2012, 20:12:12
I think the error is in the GPX (schema) version (1.1-->1.0 and 1/1 --> 1/0)
I replaced the header of kbfifi's file with:

{?xml version="1.0" encoding="utf-8" standalone="yes"?>
{gpx version="1.0" creator="Locus Android"
 xmlns="http://www.topografix.com/GPX/1/0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:locus="http://www.locusmap.eu"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/ (http://www.topografix.com/)GPX/1/0/gpx.xsd">

(change '{' to the correct char)

And then Garmin Basecamp accepted it.
Title: Re: GPX export to garmin GPS
Post by: kbfifi on May 27, 2012, 23:13:45
Thanks Stebu! You're right that made basecamp accept it. I checked with some other caches as well. Would it be possible to export with GPX 1.0 as well? Would be nice

However something else is still wrong. If I copy the gpx  to my Garmin gps the caches are not visible. This is my ultimate goal so I can store caches to my Garmin while I'm on trip.
Title: Re: GPX export to garmin GPS
Post by: stebu on May 28, 2012, 00:19:11
Quote from: "kbfifi"
Thanks Stebu! You're right that made basecamp accept it. I checked with some other caches as well. Would it be possible to export with GPX 1.0 as well? Would be nice

However something else is still wrong. If I copy the gpx  to my Garmin gps the caches are not visible. This is my ultimate goal so I can store caches to my Garmin while I'm on trip.
I found it, it's the {![CDATA[...]]> field. I removed all of them:
   {urlname>{![CDATA[Rund um den Almenaer Berg III]]>{/urlname>    ==>
   {urlname>Rund um den Almenaer Berg III{/urlname>

But then you have to take care that there are no illegal characters in the data! So I had to remove two ampersands (&) characters, then my Dakota accepted the caches.

That's a mess!  :cry: It would be much cleaner if the CDATA was accepted.
Title: Re: GPX export to garmin GPS
Post by: kbfifi on May 28, 2012, 09:56:29
Thanks again stebu! What does CDATA add functionally? I guess I have another feature request: create Garmin compatible GPX!

This way you get caches via your mobile phone, put in the gps mem card and write gpx file to it! All that on site! 8-)
Title: Re: GPX export to garmin GPS
Post by: stebu on May 28, 2012, 10:38:32
Quote from: "kbfifi"
Thanks again stebu! What does CDATA add functionally? I guess I have another feature request: create Garmin compatible GPX!

This way you get caches via your mobile phone, put in the gps mem card and write gpx file to it! All that on site! 8-)
XML CDATA element.
CDATA - (Unparsed) Character Data
The term CDATA is used about text data that should not be parsed by the XML parser.
Characters like "<" and "&" are illegal in XML elements.
"<" will generate an error because the parser interprets it as the start of a new element.
"&" will generate an error because the parser interprets it as the start of an character entity.
Some text, like JavaScript code, contains a lot of "<" or "&" characters. To avoid errors script code can be defined as CDATA.
Everything inside a CDATA section is ignored by the parser.
A CDATA section starts with "<![CDATA[" and ends with "]]>"

Without CDATA Locus should check every text field and somehow convert illegal characters into safe ones. I'm not sure if it is possible with "&amp;" and "&lt;"? And then this added '&' shall not be re-converted.

Maybe "<" ">" and "&" could be converted into { } and +, and call this conversion GPSr compatible. This would at least ruin any HTML inside the listing.

You should send Garmin a request to support CDATA in the GPSrs!
Title: Re: GPX export to garmin GPS
Post by: Menion on May 28, 2012, 11:26:30
hi guys,
  I'm not absolutely clever from your discussion but if I can improve something in export features that will not break current system, let me know.
Title: Re: GPX export to garmin GPS
Post by: kbfifi on May 28, 2012, 11:37:56
Thanks for the very useful info. I agree this would rather be a Garmin issue. I think the flexible/fast support of Locus is one of your important strengths.  I don't think Garmin is necessarily wanting to support this. So for Locus to support such a (unique?) feature would make sense I think. There must other devices lacking the CDATA support too.
Title: Re: GPX export to garmin GPS
Post by: kbfifi on May 28, 2012, 11:40:43
Hi menion you were just ahead of me ;)  Please consider my proposal.
Title: Re: GPX export to garmin GPS
Post by: Menion on May 28, 2012, 11:48:06
and what's the point? remove all special characters that have to be in CDATA tag and allow export without CDATA?
Title: Re: GPX export to garmin GPS
Post by: stebu on May 28, 2012, 11:53:56
Quote from: "menion"
hi guys,
  I'm not absolutely clever from your discussion but if I can improve something in export features that will not break current system, let me know.

At first, you should change the GPX version from 1/1 to 1/0, otherwise "Compatible with Basecamp" is not true!

Then, if you could add a selection "Compatible with (Garmin) GPSr", and with this selection the GPX file contains no CDATA elements. Instead, all the illegal characters have to be modified in the text fields. This would make kbfifi happy and I might also try to transfer a GPX file from my phone to the SD card of the Dakota 20.
Title: Re: GPX export to garmin GPS
Post by: kbfifi on May 28, 2012, 11:56:33
Exactly!
Title: Re: GPX export to garmin GPS
Post by: Menion on May 29, 2012, 10:29:03
you're not correct stebu. There is "Compatible with MapSource"! and with MapSource, exported data works! hmm hard work with this Garmin software ...
Title: Re: GPX export to garmin GPS
Post by: stebu on May 29, 2012, 14:33:21
Quote from: "menion"
you're not correct stebu. There is "Compatible with MapSource"! and with MapSource, exported data works! hmm hard work with this Garmin software ...
kbfifi's file was not compatible with his/hers, Gynta's or my Mapsource. Have you tried that file?
Title: Re: GPX export to garmin GPS
Post by: kbfifi on July 29, 2012, 15:05:38
Hi Menion,

We're a few releases further and noticed you improved Locus on this issue. Thanks for that! When I exported with a recent version I saw  not all GPX 1/1 references were replaced. Also CDATA looks unchanged. Any chance you will fix this in the future?

Regards,
kbfifi
Title: Re: GPX export to garmin GPS
Post by: Menion on August 02, 2012, 14:59:30
hmm you're correct, I left there "xsi:schemaLocation" with 1.1 version, sorry fixed. Anyway I tested CDATA values and they seems to works correctly in mapSource and also baseCamp. Are you sure these programs have problems with CDATA objects?
Title: Re: GPX export to garmin GPS
Post by: kbfifi on August 02, 2012, 20:08:39
I tested the exported gpx file with my Garmin Dakota 20. Then it will only show the first Geocache. See Stebu's post above about characters not to use with CDATA. Let me know if I need to test something for you.
Title: Re: GPX export to garmin GPS
Post by: Menion on August 02, 2012, 22:56:43
it's weird. I'm trying to find on internet any description what Garmin GPX support and what not, and there is nowhere any information about problems with CDATA. Cannot be import problem caused by any other issue in GPX file?
Title: Re: GPX export to garmin GPS
Post by: kbfifi on August 02, 2012, 23:23:48
Can be. I noticed that the first cache was fullly accepted including user logs (with CDATA). I tried with only 2 caches in 1 gpx and still only the first got accepted. I also noticed that if other waypoints were included (e.g. for parking) they were also visible on my Garmin. Maybe an XML validation tool shows inconsistencies?
Title: Re: GPX export to garmin GPS
Post by: kbfifi on August 12, 2012, 13:15:20
Yesss I found the problem!  :D  Much simpler then expected. Fortunately it's NOT the CDATA. It's an id that must be unique and is always filled in with "0" at the moment:
All are:
<groundspeak:cache id="0" available="True" archived="False"  ...

and should be unique:
<groundspeak:cache id="0" available="True" archived="False"  ...
<groundspeak:cache id="1" available="True" archived="False"  ...
<groundspeak:cache id="2" available="True" archived="False"  ...

I would be very greatfull if you could fix this in a new version.

Thanks,
kbfifi
Title: Re: GPX export to garmin GPS
Post by: Menion on August 12, 2012, 16:44:44
Hi,
  good observation ... may you tell me from where are you taking your imported caches? Because this value should be in Locus database and also correctly exported. So it's not a problem of Locus, but problem that this value is missing. Maybe should help, that in case "id" is not known (so it's zero), "id="0"" parameter will be completely missing? May you please try, if without this "id" will import works? Thanks
Title: Re: GPX export to garmin GPS
Post by: kbfifi on August 12, 2012, 17:16:01
Hi Menion,

I just tried without the id attribute. It doesn't work. Only the the waypoints are visible and all cache info is lost then. The source is Geocaching4Locus. I import caches into a point list and export from there to GPX compatible with Garmin option. If this is Geocaching4Locus problem please tell me how to proceed.

Thanks,
Kbfifi
Title: Re: GPX export to garmin GPS
Post by: Menion on August 13, 2012, 08:36:52
notified author of add-on, should be fixed in next version of add-on. There is anyway minnor issue in Locus, which is not easily fixable. we'll see if this will have impact on this export
Title: Re: GPX export to garmin GPS
Post by: kbfifi on August 25, 2012, 12:41:11
I'm very happy with the last update of the Geocaching4Locus addon and Locus!! Thanks for solving this. It works flawlessly now!
Title: Re: GPX export to garmin GPS
Post by: Menion on August 25, 2012, 14:08:44
hmm good to hear, thanks for confirmation!