Thread: [Gpsbabel-misc] turning smart icons on?
Brought to you by:
robertl
From: Jeff B. <je...@bo...> - 2004-03-03 16:07:23
|
I don't see it documented anywhere, but from the discussion list it appears that there is a smart icon transformation as part of gps babel, I assume like GPX Spinner's. There appears to be an option to turn it off, but how do you turn it on? I'm converting my pocket queries to mapsource and gpx with shortened names, but I don't get the icon translation. I'm running gpsbabel like this: gpsbabel -s -i gpx -f "my.gpx" -o gpx,gsshortnames,suppresswhite,snlen=10 -F "out.gpx"`; and gpsbabel -s -i gpx -f "my.gpx" -o mapsource -F "out.mps"`; I'm running OS X and I tried with the latest beta and version 1.2.1. Any suggestions? Also, is there a way to do waypoint corrections, like GPX Spinner has? I'm thinking I might be able to do that through some sort of merge, but I'm not sure how. Jeff |
From: Robert L. <rob...@us...> - 2004-03-04 07:37:48
|
> I don't see it documented anywhere, but from the discussion list it > appears that there is a smart icon transformation as part of gps babel, Yes. I use it extensively and can frequently spend an entire day hunting with nothing but the information that GPSBabel places in my receiver. > I assume like GPX Spinner's. There appears to be an option to turn it > off, but how do you turn it on? It's not as user-controllable as Spinner's, but it's similar in goal. Well, unlike Spinner, you have the source, so it's arguably MORE malleable in the hands of qualified people, but entry ticket is higher. > gpsbabel -s -i gpx -f "my.gpx" -o > gpx,gsshortnames,suppresswhite,snlen=10 -F "out.gpx"`; > and That won't get you "smart names" becuase the GPX file format pretty much weenies out on icon definitions. > gpsbabel -s -i gpx -f "my.gpx" -o mapsource -F "out.mps"`; This, however, should get you smart icons if the GPX file in question has groundspeak extensions. (It might be better if you append ",mpsverout=4" after "mapsource".) So far, I don't know if we've had any Garmin users really step forward with recommendations and testing on this, The code does try to give special icons for micros, virtuals, and multis. Yes, I know technically some of those are cache types and some are cache containers and there can be a multi-virt or a multi-micro, but A) there's just so much you can do with icon mapping and B) such caches tend to be miscategorized on the web site anyway. If the latest beta doesn't give you "smart" icons i out.mps on OS/X, shout back and we'll look at it. The mapsource code underwent an overhaul around Christmas... > Also, is there a way to do waypoint corrections, like GPX Spinner has? > I'm thinking I might be able to do that through some sort of merge, but > I'm not sure how. Iv'e wrestled the urge to make GPSBabel _too much_ of a geocaching-specific program. [ warning: within the next 60 seconds you are likely to be either inspired or numb. :-) ] The way I personally handle this (i.e. a 19 stage multi that I'm only 5 steps into) is indeed with a merge. I keep a very simple file in my $HOME in a format I can edit by hand (I like gpsutil for this becuase I can cut/paste from cache pages) that looks something like this: $ cat ~/extra.wpt WhtAntFS 3617.000N 08630.000W 0000000m White Ant Final Stop ai BhndSPkg 4006.000N 08535.000W 0000000m Behind The Sun Parking ai and then just do the merge when I shoot the waypoints into my unit in my script that does the uploads: TTY=/dev/ttyS0 for i in $* do CMD="$CMD -i gpx -f \"$i\"" done CMD="$CMD -i gpsutil -f /home/robertl/extra.wpt" ~/src/gpsbabel/gpsbabel -vs -i gpsutil -f ~/default.wpt -o magellan -F ${TTY} sleep 2 eval ~/src/gpsbabel/gpsbabel -vs -s $CMD -x position -o magellan -F ${TTY} |
From: Robert L. <rob...@us...> - 2004-03-04 08:15:08
|
Robert Lipe wrote: > > gpsbabel -s -i gpx -f "my.gpx" -o mapsource -F "out.mps"`; > > This, however, should get you smart icons if the GPX file in question Actually.... Last night, while I was geocaching in the dark, I noticed that my unit didn't show a cache as a multi. I just analyzed this and found a defect in the rewritten GPX parser that I introduced around Christmas or so. Micros would have caught my attention if they were broken (we have _so_ many of them here) but considerably fewer multi's and virtuals are extinct, so it slipped under my radar. This bug would have only triggeered on those two cases: virts and multi's. If you'd prefer source or a binary for testing, please let me know. RJL |
From: Jeff B. <je...@bo...> - 2004-03-05 02:29:43
|
Robert Lipe wrote: >That won't get you "smart names" becuase the GPX file format pretty much >weenies out on icon definitions. > > So what I don't understand is how GPX Spinner does it. If I give it a GPX from a pocket query, it gives me a "spinner.gpx" with all the right icons. No matter though, I'll take gpx or mapsource. >> gpsbabel -s -i gpx -f "my.gpx" -o mapsource -F "out.mps"`; >> >> > >This, however, should get you smart icons if the GPX file in question >has groundspeak extensions. (It might be better if you append >",mpsverout=4" after "mapsource".) So far, I don't know if we've had >any Garmin users really step forward with recommendations and testing on >this, > > With mpsverout=4 and version 1.2.1. it worked, though I only see the "photo" icon for virtuals. Micro, puzzles and multis are not affected. With the latest beta I compiled (Version 1.2.2_beta02222004), I get these errors: *** malloc[18737]: Deallocation of a pointer not malloced: 0x11c41c0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug though it creates the mps file ok. The icons don't show though, even for micros and you said those should be OK according to your followup message, right? I can compile the source if that's easier if you need me to test something. I can also pass along my gpx file if that helps. >Iv'e wrestled the urge to make GPSBabel _too much_ of a >geocaching-specific program. > > But it's the only thing left I need before I can completely automate getting an email with my pocket query to getting it suitable for my GPSr! :-) I'll give you merging instructions a try. Thanks. Jeff |
From: alan <al...@au...> - 2004-03-05 03:08:08
|
Jeff Boulter wrote: >> So what I don't understand is how GPX Spinner does it. If I give it a >> GPX from a pocket query, it gives me a "spinner.gpx" with all the right >> icons. No matter though, I'll take gpx or mapsource. GPX Spinner has the different icons defined in the GPX Spinner.ini file. Here is a snippet: #********************************************************** # # This section defines how GPX Spinner will change the # icon for the various cache types. # # The types are evaluated in the order shown here # (but changing the order here will NOT change the # order of evaluation.) # # Leave a definition blank if you don't want any change # to take place for that type (e.g. Micro_Not_Found = Traditional_Not_Found = Geocache Multi_Not_Found = Stadium Virtual_Not_Found = Scenic Area Locationless_Not_Found = Scenic Area Letterbox_Not_Found = Post Office Event_Not_Found = Picnic Area CITO_Event_Not_Found = Picnic Area Webcam_Not_Found = Live Theater Unknown_Not_Found = Information Traditional_Found = Geocache Found Multi_Found = Geocache Found Virtual_Found = Geocache Found Locationless_Found = Geocache Found Letterbox_Found = Geocache Found Event_Found = Geocache Found CITO_Event_Found = Geocache Found Webcam_Found = Geocache Found Unknown_Found = Geocache Found |
From: Jeff B. <je...@bo...> - 2004-03-05 04:54:05
|
Yeah, I've played around with those before. I may have been misunderstanding Robbert, but I thought he said that you couldn't represent the icons in a GPX file, so that confused me since GPX Spinner seems produce gpx files with icons just fine. Jeff alan wrote: > Jeff Boulter wrote: > >>> So what I don't understand is how GPX Spinner does it. If I give it >>> a GPX from a pocket query, it gives me a "spinner.gpx" with all the >>> right icons. No matter though, I'll take gpx or mapsource. >> > > > GPX Spinner has the different icons defined in the GPX Spinner.ini > file. Here is a snippet: > > #********************************************************** > # > # This section defines how GPX Spinner will change the > # icon for the various cache types. > # > # The types are evaluated in the order shown here > # (but changing the order here will NOT change the > # order of evaluation.) > # > # Leave a definition blank if you don't want any change > # to take place for that type (e.g. Micro_Not_Found = > > Traditional_Not_Found = Geocache > Multi_Not_Found = Stadium > Virtual_Not_Found = Scenic Area > Locationless_Not_Found = Scenic Area > Letterbox_Not_Found = Post Office > Event_Not_Found = Picnic Area > CITO_Event_Not_Found = Picnic Area > Webcam_Not_Found = Live Theater > Unknown_Not_Found = Information > > Traditional_Found = Geocache Found > Multi_Found = Geocache Found > Virtual_Found = Geocache Found > Locationless_Found = Geocache Found > Letterbox_Found = Geocache Found > Event_Found = Geocache Found > CITO_Event_Found = Geocache Found > Webcam_Found = Geocache Found > Unknown_Found = Geocache Found > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gpsbabel-misc mailing list > Gps...@li... > https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc |
From: Robert L. <rob...@us...> - 2004-03-09 20:06:48
|
> GPX Spinner has the different icons defined in the GPX Spinner.ini file. Currently GPSBabel relies on no external files for configuration, but I'm not fundamentally opposed to such a thing. (Esp. if I can find a free windows installer thingy that supports cross builds...) > # to take place for that type (e.g. Micro_Not_Found = > > Traditional_Not_Found = Geocache > Multi_Not_Found = Stadium > Virtual_Not_Found = Scenic Area > Locationless_Not_Found = Scenic Area > Letterbox_Not_Found = Post Office > Event_Not_Found = Picnic Area What if you have multiple receivers, with with different icon capabilities? If you have, say, a Garmin Banana, a 60, and a Platinum, how does the above scheme work? A Garmin "stadium" sort of makes sense because it has the little flag thingies, but a Magellan "stadium" looks like a film canister. I'm not dogging Spinner; I'm trying to understand if it solves all of the problems that need solving. RJL |
From: <al...@au...> - 2004-03-09 20:53:54
|
> What if you have multiple receivers, with with different icon > capabilities? I don't use it in this fashion but more than likely it would be through seperate .ini files. Example: C:\>"GPX Spinner.exe" -i=SpecialOptions.ini SpecialCaches.gpx Alan |
From: Robert L. <rob...@us...> - 2004-03-05 07:15:51
|
> That won't get you "smart names" becuase the GPX file format pretty much > weenies out on icon definitions. > > So what I don't understand is how GPX Spinner does it. If I give it a Technically, GPX itself lets you create an icon of type "booger" if you want and leaves it up to the application to map that to something useful. Presumably Spinner, like GPSBabel, has to know where the GPX is ultimately going to name the things sensibly. If you just convert GPX to GPX, you won't get Mapsend-specific icons. I probably didn't describe that very clearly the first time around. > With mpsverout=4 and version 1.2.1. it worked, though I only see the > "photo" icon for virtuals. We have the unfortunate mpsverout default of "3" which doesn't provide geocaching icons. I've asked a couple of times to see what percentage of the Mapsource population still uses v3 and if it's a sensible default, but have not gotten a single reply. > Micro, puzzles and multis are not affected. This is probably a result of the bug I described the other day. Did you try the patch I sent around? > With the latest beta I compiled (Version 1.2.2_beta02222004), I get > these errors: > *** malloc[18737]: Deallocation of a pointer not malloced: 0x11c41c0; I'd welcome a test case for that. > But it's the only thing left I need before I can completely automate > getting an email with my pocket query to getting it suitable for my > GPSr! :-) FWIW, procmail sees my PQ's arrive, hands them off to GPSBabel and a few related programs, and a few moments later - completely without my involvement - I have a plucker file ready to hotsync and a waypoint file - with icons, diff, and terr in the comments - ready to shoot into the receiver whenver I plug it in and turn it on. I can (and do) declar a spontaneous geocaching run and have my technology ready to go in under 30 seconds. RJL |
From: Jeff B. <je...@bo...> - 2004-03-07 06:12:22
|
Robert Lipe wrote: >FWIW, procmail sees my PQ's arrive, hands them off to GPSBabel and a >few related programs, and a few moments later - completely without my >involvement - I have a plucker file ready to hotsync and a waypoint file >- with icons, diff, and terr in the comments - ready to shoot into the >receiver whenver I plug it in and turn it on. > I sent my test gpx and my attempt at the patch in a separate email. This is exactly what I'm after. I've got procmail + perl + gpsbabel + cmconvert getting everything pretty much there. I'm just trying to get GPX Spinner out of the equation since all it's doing for me now is doing waypoint corrections and smart icons and I can't automate it running on os x. On the geocaching message boards recently, the CacheMate author was talking about building a utility to do the opposite of cmconvert - that is convert a pdb back into a GPX. I suggested that cmconvert be rolled into gpsbabel. He didn't seem to be interested in doing that personally, but said that the source is freely available, so it could be done by someone else. Thanks, Jeff |
From: Alex M. <al...@co...> - 2004-03-07 16:31:17
|
> This is exactly what I'm after. I've got procmail + perl + gpsbabel + > cmconvert getting everything pretty much there. I'm just trying to get > GPX Spinner out of the equation since all it's doing for me now is > doing waypoint corrections and smart icons and I can't automate it > running on os x. What exactly is a waypoint correction? I've got a personal waypoint filter that does most of what I think you need. If you're able to compile your own code, it's pretty simple to inject into the gpsbabel source. Essentially, I use to do odd things like change the GCXXXX numbers into something useful, molest the icons, insert difficulty and terrain into the description and/or name fields (really good for getting details into the single line driving directions in something like Streets-n-Trips). It's pretty much a personal thing, but I don't mind sharing it with anyone interested in customizing it to fit their own needs. Let me know if you think it could help you out. alex |
From: alan <al...@au...> - 2004-03-07 20:39:31
|
Here's the text from the GPX Spinner site on corrected coordinates: Corrected Cache Coordinates You can maintain a list of corrected coordinates for caches. This feature is useful for several scenarios: * You've solved a puzzle cache but haven't yet gone to it. * The cache is a moving cache but the coordinates on the cache page aren't updated when it moves. * Cache finders have reported corrected coordinates but the cache owner hasn't updated them yet. * You are part-way through a multi-cache and want to keep the coordinates of the next stage. To make the corrected coordinates, just make a file named CorrectedCaches.txt in the GPX Spinner application directory. Each line of this file is the cache ID with the corrected coordinates. For example: # Cache IDs to correct # CacheID, Latitude, Longitude GCDF1D, 38.788283, -121.245816 # Think GPS GCB416, N40 39.401, W119 21.988 # High Desert Adventure As with the ignore list, any lines starting with # are nor used, and you can use the # to place comments on each line. You can enter the coordinates as either decimal degrees or in decimal minutes format (like geocaching.com). See the example above. |
From: Robert L. <rob...@us...> - 2004-03-08 16:46:24
|
Jeff Boulter wrote: > This is exactly what I'm after. I've got procmail + perl + gpsbabel + > cmconvert getting everything pretty much there. I'm just trying to get > GPX Spinner out of the equation since all it's doing for me now is doing See the end. > On the geocaching message boards recently, the CacheMate author was > talking about building a utility to do the opposite of cmconvert - that > is convert a pdb back into a GPX. I'm not really sure why one would want to do that, but that's OK. I don't have to understand. > I suggested that cmconvert be rolled into gpsbabel. He didn't seem to > be interested in doing that personally, but said that the source is > freely available, so it could be done by someone else. I'm not sure I'm wild about the idea, either. While geocachers are clearly a large part of the user base and I've made some exceptions that had a good work/payoff ratio, I've resisted the urge to make GPSBabel _really_ understand pocket queries. Yeah, we do fondle a few tags to let us do things like special icon generation or stick a diff/terr in the waypoint comments, but we really don't want to be in the business of understanding HTML inside a cache description, partially encoded hints, and other such things. Heaven knows I don't want to teach GPSBabel how to take a partially ROT13-encoded hint in HTML from groundspeak namespace and convert that to a 4-level navicache hint. Since cmconvert and gpsbabel will both take the same PQ's as input, what would you gain by smooshing them together? Put a little scripting up front and do what you need to do. The command line cmconvert lends itself as well to automation as GPSBabel does. Let cmconvert do the Palm database thin which it's good at. Let GPSBabel do the filtering/merging/conversion stuff it's good at. Depending on your needs, cmconvert and GPSBabel are either siblings (both get the PQ direct from the site) or stacked (GPSBabel merges/filters, outputs to GPX, and THAT is used as the input to cmconvert). Wise Men once wrote in favor combining simple tools that do specialized tasks well instead of creating "kitchen sink" tools[1]... Anyway, the key fragements of my automation includes this in .procmailrc: # # Automagically unpack geocaching locations # :0 h * ^Subject:.*\[GEO] Pocket Query: { :0c | $HOME/src/geo/bin/gpxunpack :0 gpx.folder } Where GPXunpack is the admittedly embarrassing: TMPDIR=/tmp/gpxtmp.$$ TGTDIR=/home/robertl/src/geo/mgpx mkdir ${TMPDIR} cat $* | sed "s/^M$//" > ${TMPDIR}/inputf SENDER=$(formail -xFrom: < ${TMPDIR}/inputf) case $SENDER in " <co...@ge...>"*) ;; *) echo "Invalid sender. Rejected." exit 1;; esac # SUBJECT=$(formail -xSubject: < ${TMPDIR}/inputf | sed 's/^.*\[GEO\] Files for: //') SUBJECT=$(formail -xSubject: < ${TMPDIR}/inputf | sed 's/^.*\[GEO\] Pocket Query: //') FILES=$(munpack -q -f -C ${TMPDIR} ${TMPDIR}/inputf 2>&1 | awk '/\(application\// {print $1}') case $FILES in *.zip) cd ${TMPDIR} FILES=$(unzip -o $FILES | awk '/^ / {print $2}') rm ${TMPDIR}/*.zip ;; esac # perl -pi.bak -e 's///;s///' ${TMPDIR}/$FILES mv ${TMPDIR}/$FILES "${TGTDIR}/$SUBJECT" rm -f ${TMPDIR}/*.desc ${TMPDIR}/*.bak ${TMPDIR}/inputf rmdir ${TMPDIR} case $SUBJECT in # MiddleTN*) # gpsbabel -i gpx -f ${TGTDIR}/MiddleTN-1 -f ${TGTDIR}/MiddleTN-2 -xduplicate,shortname -o gpx -F ${TGTDIR}/MiddleTN # ;; "MiddleTN"*) gpsbabel -i gpx -f "${TGTDIR}/MiddleTN-D10" -f "${TGTDIR}/MiddleTN-D15" -f "${TGTDIR}/MiddleTN-Dxx" -xduplicate,shortname -o gpx -F "${TGTDIR}/MiddleTN" ;; Louisville) gpsbabel -i gpx -f ${TGTDIR}/MiddleTN -f ${TGTDIR}/Louisville -xduplicate,shortname -x arc,file=/home/robertl/src/geo/route/route.txt,distance=20 -o csv,prefer_shortnames -F /dev/fd/1 | awk '{print $3}' > /home/robertl/src/geo/custom/LouisvilleTrip ;; Paducah|"St. Louis") ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/Paducah ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/"St. Louis" gpsbabel -i gpx -f "${TGTDIR}/St. Louis" -xradius,lat=38.6,lon=-90.35,distance=25 -o gpx -F "${TGTDIR}/St. Louis.f" gpsbabel -i gpx -f ${TGTDIR}/Paducah -x arc,file=/home/robertl/src/geo/route/stl-nash.txt,distance=3 -f "${TGTDIR}/St. Louis.f" -xradius,lat=38.5,lon=-90.5,distance=9999 -xduplicate,shortname -o csv,prefer_shortnames -F /dev/fd/1 | awk '{print $3}' > /home/robertl/src/geo/custom/StLouTrip ;; FtWayne-1|Indy|Louisville) ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/FtWayne-1 ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/Indy ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/Louisville gpsbabel -i gpx -f "${TGTDIR}/FtWayne-1" -xradius,lat=41,lon=-85.1,distance=25 -o gpx -F "${TGTDIR}/FtWayne-1.f" gpsbabel -i gpx -f ${TGTDIR}/MiddleTN -f "${TGTDIR}/Indy" -f "${TGTDIR}/Louisville" -f ${TGTDIR}/FtWayne-1 -x arc,file=/home/robertl/src/geo/route/ftw-nash.txt,distance=3 -f${TGTDIR}/FtWayne-1.f -xradius,lat=41,lon=-85.1,distance=9999 -xduplicate,shortname -o csv,prefer_shortnames -F /dev/fd/1 | awk '{print $3}' > /home/robertl/src/geo/custom/FTWTrip ;; esac exit 0 From this script, you can figure out A) that it was written before I added the "-" to filenames in GPSBabel. B) large degrees of automation are possible, but not all done here. (there are other tools that run along behind this that read the 'custom' things. Certainly cmconvert could be called from a similar script. C) How I combine multiple PQ's into giant PQ's using merges, arc filters, and duplicate suppression to get things sorted around areas of interest. D) Ron's masochism for studly giant invocations is stronger mine - I prefer simpler commands that can be debugged individually. E) where I have family. :-) Since someone is sure to ask, 'gpxsplit.pl' is a tiny Perl program that uses XML::Twig to take a mongo PQ and bust it up into little tiny files - one per cache - to be digested by those very downstream tools (such as the ones that read ".../custom/...") where I'm too lazy[2] to put them in a real database. Since my primary key is always really the cache ID, I just break them up here when the PQ arrives and the programs then open the right file. [1] While I don't buy into every point, it's best said at: http://hebb.cis.uoguelph.ca/~dave/27320/new/unixphil.html [2] "Not all things worth doing are worth doing well" Engineering proverb. |
From: Jeff B. <je...@bo...> - 2004-03-11 16:32:20
|
On Mar 8, 2004, at 8:37 AM, Robert Lipe wrote: > > I'm not sure I'm wild about the idea, either. While geocachers are > clearly a large part of the user base and I've made some exceptions > that > had a good work/payoff ratio, I've resisted the urge to make GPSBabel > _really_ understand pocket queries. Yeah, we do fondle a few tags to > let us do things like special icon generation or stick a diff/terr in > the waypoint comments, but we really don't want to be in the business > of > understanding HTML inside a cache description, partially encoded hints, > and other such things. Heaven knows I don't want to teach GPSBabel > how to take a partially ROT13-encoded hint in HTML from groundspeak > namespace and convert that to a 4-level navicache hint. > > Since cmconvert and gpsbabel will both take the same PQ's as input, > what would you gain by smooshing them together? Put a little scripting > up front and do what you need to do. The command line cmconvert > lends itself as well to automation as GPSBabel does. Let cmconvert > do the Palm database thin which it's good at. Let GPSBabel do the > filtering/merging/conversion stuff it's good at. Depending on your > needs, cmconvert and GPSBabel are either siblings (both get the PQ > direct from the site) or stacked (GPSBabel merges/filters, outputs to > GPX, and THAT is used as the input to cmconvert). Wise Men once wrote > in favor combining simple tools that do specialized tasks well instead > of creating "kitchen sink" tools[1]... "I learned it from watching you, Alright!" Seriously, I saw that gpsbabel supports geocachingDB, which seems to be pretty much the same thing, so I thought you might want to support CacheMate as well. But it's really not a problem. I do exactly as you suggest - run GPSBabel and cmconvert from a script triggered by procmail. Now that the icons are working great, I just need to implement that merge script and I'll be golden. Thanks! Jeff |
From: Robert L. <rob...@us...> - 2004-03-11 17:34:14
|
Jeff Boulter wrote: > Seriously, I saw that gpsbabel supports geocachingDB, which seems to be > pretty much the same thing, so I thought you might want to support > CacheMate as well. But it's really not a problem. I do exactly as you The key difference is that gcdb supports WAY less information than cachemate does. lat/lon/gc#/name/terr/diff is about all it knows. It doesn't try to do the cache text, the hint, compute nearby caches, and so on. > Now that the icons are working great, I just need to implement that > merge script and I'll be golden. Thanks! Is "that merge script" something we can help with? GPSBabel voodoo we do; general shell scripting should probably done off list, but clearly I have some ideas on that if you want to take it offline... RJL |
From: Jeff B. <je...@bo...> - 2004-03-11 17:53:43
|
OK, understood on GeocachingDB. I've got your merge scripts from a previous email, so I'll give that a try before I complain any more. :-) Jeff Robert Lipe wrote: >Jeff Boulter wrote: > > > >>Seriously, I saw that gpsbabel supports geocachingDB, which seems to be >>pretty much the same thing, so I thought you might want to support >>CacheMate as well. But it's really not a problem. I do exactly as you >> >> > >The key difference is that gcdb supports WAY less information than >cachemate does. lat/lon/gc#/name/terr/diff is about all it knows. It >doesn't try to do the cache text, the hint, compute nearby caches, and >so on. > > > >>Now that the icons are working great, I just need to implement that >>merge script and I'll be golden. Thanks! >> >> > >Is "that merge script" something we can help with? GPSBabel voodoo we >do; general shell scripting should probably done off list, but clearly I >have some ideas on that if you want to take it offline... > >RJL > > |
From: Jeff B. <je...@bo...> - 2004-03-18 06:28:28
|
I don't think gpsbabel can currently do waypoint corrections in the way that I'm used to them from GPX Spinner. The corrections file is really no more than a waypoint name and a set of coordinates. If I do a merge, I'll blow away all the other data for that waypoint in the gpx, right? Anyway, it seemed pretty straighforward to write a little perl using XML::Twig to read a spinner-style "CorrectedCaches.txt" file, and replace the coordinates in the gpx file before I do anything else. So I wrote that and it seems to work just fine. I'll be happy to share the code if anyone's interested. Jeff Robert Lipe wrote: >Jeff Boulter wrote: > > > >>This is exactly what I'm after. I've got procmail + perl + gpsbabel + >>cmconvert getting everything pretty much there. I'm just trying to get >>GPX Spinner out of the equation since all it's doing for me now is doing >> >> > >See the end. > > > >>On the geocaching message boards recently, the CacheMate author was >>talking about building a utility to do the opposite of cmconvert - that >>is convert a pdb back into a GPX. >> >> > >I'm not really sure why one would want to do that, but that's OK. I >don't have to understand. > > > >>I suggested that cmconvert be rolled into gpsbabel. He didn't seem to >>be interested in doing that personally, but said that the source is >>freely available, so it could be done by someone else. >> >> > >I'm not sure I'm wild about the idea, either. While geocachers are >clearly a large part of the user base and I've made some exceptions that >had a good work/payoff ratio, I've resisted the urge to make GPSBabel >_really_ understand pocket queries. Yeah, we do fondle a few tags to >let us do things like special icon generation or stick a diff/terr in >the waypoint comments, but we really don't want to be in the business of >understanding HTML inside a cache description, partially encoded hints, >and other such things. Heaven knows I don't want to teach GPSBabel >how to take a partially ROT13-encoded hint in HTML from groundspeak >namespace and convert that to a 4-level navicache hint. > >Since cmconvert and gpsbabel will both take the same PQ's as input, >what would you gain by smooshing them together? Put a little scripting >up front and do what you need to do. The command line cmconvert >lends itself as well to automation as GPSBabel does. Let cmconvert >do the Palm database thin which it's good at. Let GPSBabel do the >filtering/merging/conversion stuff it's good at. Depending on your >needs, cmconvert and GPSBabel are either siblings (both get the PQ >direct from the site) or stacked (GPSBabel merges/filters, outputs to >GPX, and THAT is used as the input to cmconvert). Wise Men once wrote >in favor combining simple tools that do specialized tasks well instead >of creating "kitchen sink" tools[1]... > > >Anyway, the key fragements of my automation includes this in .procmailrc: > ># ># Automagically unpack geocaching locations ># >:0 h >* ^Subject:.*\[GEO] Pocket Query: >{ > :0c > | $HOME/src/geo/bin/gpxunpack > > :0 > gpx.folder >} > >Where GPXunpack is the admittedly embarrassing: > >TMPDIR=/tmp/gpxtmp.$$ >TGTDIR=/home/robertl/src/geo/mgpx > >mkdir ${TMPDIR} >cat $* | sed "s/^M$//" > ${TMPDIR}/inputf > >SENDER=$(formail -xFrom: < ${TMPDIR}/inputf) >case $SENDER in > " <co...@ge...>"*) ;; > *) echo "Invalid sender. Rejected." > exit 1;; >esac > ># SUBJECT=$(formail -xSubject: < ${TMPDIR}/inputf | sed 's/^.*\[GEO\] Files for: //') >SUBJECT=$(formail -xSubject: < ${TMPDIR}/inputf | sed 's/^.*\[GEO\] Pocket Query: //') > >FILES=$(munpack -q -f -C ${TMPDIR} ${TMPDIR}/inputf 2>&1 | awk '/\(application\// {print $1}') > > >case $FILES in > *.zip) > cd ${TMPDIR} > FILES=$(unzip -o $FILES | awk '/^ / {print $2}') > rm ${TMPDIR}/*.zip > ;; >esac ># perl -pi.bak -e 's///;s///' ${TMPDIR}/$FILES >mv ${TMPDIR}/$FILES "${TGTDIR}/$SUBJECT" >rm -f ${TMPDIR}/*.desc ${TMPDIR}/*.bak ${TMPDIR}/inputf >rmdir ${TMPDIR} > >case $SUBJECT in ># MiddleTN*) ># gpsbabel -i gpx -f ${TGTDIR}/MiddleTN-1 -f ${TGTDIR}/MiddleTN-2 -xduplicate,shortname -o gpx -F ${TGTDIR}/MiddleTN ># ;; > "MiddleTN"*) > gpsbabel -i gpx -f "${TGTDIR}/MiddleTN-D10" -f "${TGTDIR}/MiddleTN-D15" -f "${TGTDIR}/MiddleTN-Dxx" -xduplicate,shortname -o gpx -F "${TGTDIR}/MiddleTN" > ;; >Louisville) > gpsbabel -i gpx -f ${TGTDIR}/MiddleTN -f ${TGTDIR}/Louisville -xduplicate,shortname -x arc,file=/home/robertl/src/geo/route/route.txt,distance=20 -o csv,prefer_shortnames -F /dev/fd/1 | awk '{print $3}' > /home/robertl/src/geo/custom/LouisvilleTrip > ;; >Paducah|"St. Louis") > ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/Paducah > ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/"St. Louis" > gpsbabel -i gpx -f "${TGTDIR}/St. Louis" -xradius,lat=38.6,lon=-90.35,distance=25 -o gpx -F "${TGTDIR}/St. Louis.f" > gpsbabel -i gpx -f ${TGTDIR}/Paducah -x arc,file=/home/robertl/src/geo/route/stl-nash.txt,distance=3 -f "${TGTDIR}/St. Louis.f" -xradius,lat=38.5,lon=-90.5,distance=9999 -xduplicate,shortname -o csv,prefer_shortnames -F /dev/fd/1 | awk '{print $3}' > /home/robertl/src/geo/custom/StLouTrip > ;; >FtWayne-1|Indy|Louisville) > ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/FtWayne-1 > ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/Indy > ~/src/geo/bin/gpxsplit.pl ${TGTDIR}/Louisville > gpsbabel -i gpx -f "${TGTDIR}/FtWayne-1" -xradius,lat=41,lon=-85.1,distance=25 -o gpx -F "${TGTDIR}/FtWayne-1.f" > gpsbabel -i gpx -f ${TGTDIR}/MiddleTN -f "${TGTDIR}/Indy" -f "${TGTDIR}/Louisville" -f ${TGTDIR}/FtWayne-1 -x arc,file=/home/robertl/src/geo/route/ftw-nash.txt,distance=3 -f${TGTDIR}/FtWayne-1.f -xradius,lat=41,lon=-85.1,distance=9999 -xduplicate,shortname -o csv,prefer_shortnames -F /dev/fd/1 | awk '{print $3}' > /home/robertl/src/geo/custom/FTWTrip > ;; > > >esac > >exit 0 > >>From this script, you can figure out >A) that it was written before I added the "-" to filenames in GPSBabel. >B) large degrees of automation are possible, but not all done here. > (there are other tools that run along behind this that read the 'custom' > things. Certainly cmconvert could be called from a similar script. >C) How I combine multiple PQ's into giant PQ's using merges, arc filters, > and duplicate suppression to get things sorted around areas of interest. >D) Ron's masochism for studly giant invocations is stronger mine - I > prefer simpler commands that can be debugged individually. >E) where I have family. :-) > >Since someone is sure to ask, 'gpxsplit.pl' is a tiny Perl program that >uses XML::Twig to take a mongo PQ and bust it up into little tiny files >- one per cache - to be digested by those very downstream tools (such as >the ones that read ".../custom/...") where I'm too lazy[2] to put them in >a real database. Since my primary key is always really the cache ID, I >just break them up here when the PQ arrives and the programs then open >the right file. > >[1] While I don't buy into every point, it's best said at: > http://hebb.cis.uoguelph.ca/~dave/27320/new/unixphil.html > >[2] "Not all things worth doing are worth doing well" Engineering proverb. > > |
From: Robert L. <rob...@us...> - 2004-03-18 14:45:21
|
Jeff Boulter wrote: > I don't think gpsbabel can currently do waypoint corrections in the way > that I'm used to them from GPX Spinner. The corrections file is really > no more than a waypoint name and a set of coordinates. If I do a merge, > I'll blow away all the other data for that waypoint in the gpx, right? Not if you do the merge correctly. I keep a couple of files that look approximately like this: FigurOut 3610.934N 08638.036W 0000000m Figure Out Coords ai WherePkg 3606.702N 08637.798W 0000000m Where Did They Go Pkg h EarthPkg 4101.446N 08608.538W 0000000m Earthling Vector Venus Parking h CrrbnPkg 4105.155N 08504.638W 0000000m Carribean Cache Parking h Erthlng 4106.457N 08509.520W 0000000m Earthling Vector Venus User Cdsh This is the 'gpsutil' format which was chosen becuase it's the only format that lets me almost cut and paste coords from cache pages[1], control the icons and the comments, and keep everything on one line. You can choose any format you like. The trick is to use smartnames (to avoid name collisions) and then filter duplicates on position. Here's the tool I use to upload to my unit. (robertl) rjloud:/home/robertl/src/gpsbabel $ cat ~/bin/gpsup TTY=/dev/ttyS0 CMD="-i gpsutil -f ~/default.wpt" for i in $* do CMD="$CMD -i gpx -f \"$i\"" done CMD="$CMD -i gpsutil -f /home/robertl/extra.wpt" eval ~/src/gpsbabel/gpsbabel -vs -s $CMD -x position -o magellan -F ${TTY} So I can keep multi's in progress, parking coords, etc. in these files and know that between the smartname and the positions guaranteeing they're unique that I'll never lose one. > wrote that and it seems to work just fine. I'll be happy to share the > code if anyone's interested. I can check it into the 'contrib' directory if you like. Then it'd be available in our source distribution and in the CVS tree. RJL [1] I've seriously considered inventing a 'new' format that would accept coordindates in any of the zillion "street language" forms just so I really COULD cut and paste... |
From: Ron P. <ro...@pa...> - 2004-03-18 15:39:04
|
At 08:39 AM 3/18/2004 -0600, Robert Lipe wrote: >Jeff Boulter wrote: >> I don't think gpsbabel can currently do waypoint corrections in the way >> that I'm used to them from GPX Spinner. The corrections file is really >> no more than a waypoint name and a set of coordinates. If I do a merge, >> I'll blow away all the other data for that waypoint in the gpx, right? >The trick is to use smartnames (to avoid name collisions) and then >filter duplicates on position. Here's the tool I use to upload >to my unit. I think you're misunderstanding. Jeff wants to change the coordinates for a waypoint without changing anything else. Consider, for example, my Shortwave cache. The given coords are in the middle of a pond, of no use to anyone. The actual coords are written on a card that you'll find in another cache somewhere. The idea is that, if you found a card, you could create, say, a Street Atlas file like this hypothetical shortwave.txt that contains even more bogus coords than the cache page: BEGIN SYMBOL 41.55555, -85.88888, GCA409 END And then, using a hypothetical "correct" option to the duplicate filter, do something like this: gpsbabel \ -i gpx -f fortwayne.gpx \ -i xmap -f shortwave.txt \ -x duplicate,shortname,correct \ -o gpx -F fortwayne_fixed.gpx fortwayne_fixed.gpx would have exactly the same number of waypoints as fortwayne.gpx, but would have the new coords for GCA409 (with all of the old descriptions, logs, etc.) I think this is actually an easy option to implement, if anyone's seriously interested in having it. |
From: Robert L. <rob...@us...> - 2004-03-18 16:08:27
|
> I think you're misunderstanding. Jeff wants to change the coordinates for > a waypoint without changing anything else. Consider, for example, my > Shortwave cache. The given coords are in the middle of a pond, of no OK, we are indeed talking past each other. I viewed it as an addition problem (I want to know where shortwave really IS and I can resist the urge to walk into a pond to look for it :-) instead of a substitution one. By changing the icon or the name, I've never had any problem distinguishing the starting point of a multi from the one in progress or the parking space from the actual cache, but I do see why a substitution might be useful. > gpsbabel \ > -i gpx -f fortwayne.gpx \ > -i xmap -f shortwave.txt \ > -x duplicate,shortname,correct \ > -o gpx -F fortwayne_fixed.gpx Since by the time duplicate sees them, they're all glommed together, does it just take a "last in the list" approach? If so, then is it as easy as making the loop in duplicate_process run backwards and then still letting it keep the first it finds? Hmmm, no that wouldn't be ideal becuase the xmap file contains less data than the gpx file - you probably want to get icon and comments from the GPX. > I think this is actually an easy option to implement, if anyone's > seriously interested in having it. I won't talk you into it, but I wouldn't turn it away, either. :-) RJL |
From: Jeff B. <je...@bo...> - 2004-03-18 16:09:03
Attachments:
correctCoordinates.pl
|
Well, here's my code. Feel free to add it to the repository. Maybe that will make things clear. Thanks. Jeff |
From: Ron P. <ro...@pa...> - 2004-03-18 16:40:30
|
At 10:08 AM 3/18/2004 -0600, Robert Lipe wrote: >> gpsbabel \ >> -i gpx -f fortwayne.gpx \ >> -i xmap -f shortwave.txt \ >> -x duplicate,shortname,correct \ >> -o gpx -F fortwayne_fixed.gpx > >Since by the time duplicate sees them, they're all glommed together, >does it just take a "last in the list" approach? More or less. It takes the *coords* from the last in the list, but everything else comes from the first in the list. We already have a pointer to the first item, because I added it for the "all" option, so it's just a matter of updating that waypoint's coords with the coords of the "duplicate" waypoint. >Hmmm, no that wouldn't be ideal becuase the xmap file contains less data >than the gpx file - you probably want to get icon and comments from the >GPX. Right. >> I think this is actually an easy option to implement, if anyone's >> seriously interested in having it. > >I won't talk you into it, but I wouldn't turn it away, either. :-) Okay. I just committed it. The syntax above now works. |
From: Jeff B. <je...@bo...> - 2004-03-19 03:27:44
|
Thanks. If I read this correctly, this is exactly what I was looking for. I'll just need to find the simplest format possible for keeping track of the corrected coordinates. GPX Spinner currently looks like GCXXXX, 37.00000,-121.0000 # notes to myself which is easy to edit manually. I can probably figure out how to use XCSV to do the same thing I guess. I guess I just wasted a bunch of time writing that perl code. No matter, it's dog slow anyway. Thanks, Jeff Ron Parker wrote: > At 10:08 AM 3/18/2004 -0600, Robert Lipe wrote: > >> gpsbabel \ > >> -i gpx -f fortwayne.gpx \ > >> -i xmap -f shortwave.txt \ > >> -x duplicate,shortname,correct \ > >> -o gpx -F fortwayne_fixed.gpx > > > >Since by the time duplicate sees them, they're all glommed together, > >does it just take a "last in the list" approach? > > More or less. It takes the *coords* from the last in the list, but > everything else comes from the first in the list. We already have > a pointer to the first item, because I added it for the "all" option, > so it's just a matter of updating that waypoint's coords with the > coords of the "duplicate" waypoint. > > >Hmmm, no that wouldn't be ideal becuase the xmap file contains less data > >than the gpx file - you probably want to get icon and comments from the > >GPX. > > Right. > > >> I think this is actually an easy option to implement, if anyone's > >> seriously interested in having it. > > > >I won't talk you into it, but I wouldn't turn it away, either. :-) > > Okay. I just committed it. The syntax above now works. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gpsbabel-misc mailing list > Gps...@li... > https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc |
From: Robert L. <rob...@us...> - 2004-03-19 05:24:25
|
Jeff Boulter wrote: > Thanks. If I read this correctly, this is exactly what I was looking > for. I'll just need to find the simplest format possible for keeping > track of the corrected coordinates. GPX Spinner currently looks like > > GCXXXX, 37.00000,-121.0000 # notes to myself Flip it around and you have our the strain of CSV we call "csv". (You could define one that mimiced it more precisely or find something like GPSDrive which is the same basic idea...) > I guess I just wasted a bunch of time writing that perl code. No matter, > it's dog slow anyway. XML Parsing in Perl isn't speedy, especially with the default LANG settings. RJL |
From: Jeff B. <je...@bo...> - 2004-03-26 00:31:20
|
I'm not sure if this is a bug or by design, but it appears that waypoints that are in the corrections file but not in the original gpx are added to final output. My preference would be that it replaced only waypoints that exist in the first file. Jeff Ron Parker wrote: > At 10:08 AM 3/18/2004 -0600, Robert Lipe wrote: > >> gpsbabel \ > >> -i gpx -f fortwayne.gpx \ > >> -i xmap -f shortwave.txt \ > >> -x duplicate,shortname,correct \ > >> -o gpx -F fortwayne_fixed.gpx > > > >Since by the time duplicate sees them, they're all glommed together, > >does it just take a "last in the list" approach? > > More or less. It takes the *coords* from the last in the list, but > everything else comes from the first in the list. We already have > a pointer to the first item, because I added it for the "all" option, > so it's just a matter of updating that waypoint's coords with the > coords of the "duplicate" waypoint. > > >Hmmm, no that wouldn't be ideal becuase the xmap file contains less data > >than the gpx file - you probably want to get icon and comments from the > >GPX. > > Right. > > >> I think this is actually an easy option to implement, if anyone's > >> seriously interested in having it. > > > >I won't talk you into it, but I wouldn't turn it away, either. :-) > > Okay. I just committed it. The syntax above now works. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Gpsbabel-misc mailing list > Gps...@li... > https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc |