steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

New GPX Template with better Garmin Basecamp support #238

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I have created a new gpx template called gpx-bcmp. If you export gpx files with 
this template garmin base camp version 3.3.1 (mac) recognizes the caches as 
"true" caches and show much more details about them.

maybe someone is interested in this patch.

Original issue reported on code.google.com by law.sky...@gmail.com on 31 Mar 2012 at 8:41

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for your contribution.

At first glance (doing a quick diff against the "gpx" template), this patch 
only reverts the changes made to support attributes (a.k.a. GPX 1.0.1):

--- templates.rb        2012-03-28 10:45:58.000000000 +0200
+++ issue238/templates.rb       2012-04-01 14:02:13.000000000 +0200
@@ -35,7 +35,7 @@
     'mime'    => 'text/ascii',
     'desc'    => 'GPX Geocaching XML',
     'templatePre' => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
-      "<gpx xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.0\" 
creator=\"GeoToad\" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/0 
http://www.topografix.com/GPX/1/0/gpx.xsd 
http://www.groundspeak.com/cache/1/0/1 
http://www.groundspeak.com/cache/1/0/1/cache.xsd\" 
xmlns=\"http://www.topografix.com/GPX/1/0\">\r\n" +
+      "<gpx xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.0\" 
creator=\"GeoToad\" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/0 
http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0/ 
http://www.groundspeak.com/cache/1/0/cache.xsd\" 
xmlns=\"http://www.topografix.com/GPX/1/0\">\r\n" +
       "<name>" + Time.new.gmtime.strftime("%Y%m%dT%H%M%S") + "</name>\r\n" +
       "<desc><%outEntity.title%></desc>\r\n" +
       "<author>GeoToad <%outEntity.version%></author>\r\n" +
@@ -50,7 +50,7 @@
       "  <urlname><%wpEntity.name%></urlname>\r\n" +
       "  <sym><%outEntity.cacheSymbol%></sym>\r\n" +
       "  <type>Geocache|<%wp.fulltype%></type>\r\n" +
-      "  <groundspeak:cache id=\"<%out.cacheID%>\" 
available=\"<%out.IsAvailable%>\" archived=\"<%out.IsArchived%>\" 
xmlns:groundspeak=\"http://www.groundspeak.com/cache/1/0/1\">\r\n" +
+      "  <groundspeak:cache id=\"<%out.cacheID%>\" 
available=\"<%out.IsAvailable%>\" archived=\"<%out.IsArchived%>\" 
xmlns:groundspeak=\"http://www.groundspeak.com/cache/1/0\">\r\n" +
       "  <groundspeak:name><%wpEntity.name%></groundspeak:name>\r\n" +
       "  <groundspeak:placed_by><%wpEntity.creator%></groundspeak:placed_by>\r\n" +
       "  <groundspeak:owner id=\"<%wpEntity.creator_id%>\"><%wpEntity.creator%></groundspeak:owner>\r\n" +

If so, 
- IMHO BaseCamp is at fault (I wouldn't be surprised since Garmin and GS 
stopped their collaboration a while ago, AFAIK)
- this modification could be easily achieved by 'sed'ing "cache/1/0/1" to 
"cache/1/0" in the appropriate context.

Is there something else I'm too blind to see (it's Sunday...)?

Original comment by Steve8x8 on 1 Apr 2012 at 12:13

GoogleCodeExporter commented 9 years ago
After searching the web for a while, I found the following:
https://forums.garmin.com/showthread.php?t=9367 (which is from June 2010, with 
a response "We plan to expand the geocaching support in BaseCamp in future 
versions", so one might have hoped for an improvement)
https://forums.garmin.com/showthread.php?t=18594 (a wishlist dated April 2011, 
which - among other stuff - lists the same thing again)
To me that looks like we've got to wait for Garmin developers to fix BaseCamp. 
Which may take some time.

Of course, you can produce "normal" GPX and "BaseCamp compatible" GPX at 
virtually the same time (multiple output formats, issue 216, but be careful 
with file suffixes).
Still, a simple sed-based replacement would be (my) resolution of choice, 
instead of "fixing" GeoToad.
I'm open for input though!

Original comment by Steve8x8 on 1 Apr 2012 at 12:45

GoogleCodeExporter commented 9 years ago
Until BaseCamp gets fixed, the following (quick and dirty) one-line command 
will convert GeoToad GPX (1.0.1) output into something that can be read by BC:

sed 's~groundspeak.com/cache/1/0/1~groundspeak.com/cache/1/0~g' 
<geotoadoutput.gpx >basecampinput.gpx

sed is available for all platforms supported by GeoToad.

Please keep me updated.

Original comment by Steve8x8 on 25 May 2012 at 1:04

GoogleCodeExporter commented 9 years ago
The suggestion above has been incorporated into the OtherSearches wiki page.
There will be no additional template. Closing.

Original comment by Steve8x8 on 4 Sep 2012 at 11:57