Jump to content

Simple(?) Gpsbabel Question


Recommended Posts

I have a simple spreadhseet that contains only following the waypoint information in columns:

 

Waypoint Name, Longitude, Latitude, Comment

 

No other information is in this file, though I could easily add columns or re-arrange the existing ones. I could also export it to a simple tab or comma delimited file also.

 

What would be the easiest way to translate this to a Magellan waypoint file? It looks like GPSBabel supports about a zillion formats, but I can't figure out which one to use - or how to coerce my existing spreadsheet into a format GPSBabel will accept.

Edited by lee_rimar
Link to comment

(Why don't these questions get asked on the GPSBabel mailing lists instead of here?)

 

I picked through the zillion formats and none of them are precisely what you describe. Fortunately, it's trivial to create your own formats. Here's how to add a format called "rimar". Create a file called "rimar" that looks like this:

FIELD_DELIMITER         COMMA
RECORD_DELIMITER        NEWLINE
BADCHARS                ,"

#
# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
#
IFIELD  SHORTNAME, "", "%s"             # Name
IFIELD  LON_DECIMAL, "", "%f"           # Longitude
IFIELD  LAT_DECIMAL, "", "%f"           # Latitude
IFIELD  DESCRIPTION, "", "%s"           # Comment

 

Now you can convert it to whatever you like; this example is mapsend:

gpsbabel -i xcsv,style=rimar -f test -o mapsend -F test.wpt

 

The 'test' file I used contained

home,-87.123,36.456,home sweet home

 

A comprehensive doc to the style sheets was included with your GPSBabel build but can be found on the web at http://cvs.sourceforge.net/viewcvs.py/gpsb...yle?view=markup

 

Enjoy.

Edited by robertlipe
Link to comment

Robert:

 

Thanks for the hints. A couple of comments:

 

1) Where would I put that customized file if I'm using MacGPSBabel? That's probably a query for the bloke who wrote the Mac GUI for it, or maybe the mailing list.

 

2) I think these questions don't get asked on the mailing lists because some people don't even realize there is a mailing list. Other people don't like mailing lists for a variety of reasons.

 

Lee.

Link to comment

1) Where would I put that customized file if I'm using MacGPSBabel?

Anywhere you like. If it's not in the current directory, you'll just have to specify a full path to it. I'd be really suprised if you can do this from the GUI.

2) I think these questions don't get asked on the mailing lists because some people don't even realize there is a mailing list.  Other people don't like mailing lists for a variety of reasons.

I think I'm going to rename the entry in the blue bar from "mailing lists" to "getting help" and include tips on asking questions...But that's beyond the scope of this exercise.

 

Have fun.

Link to comment

I'd be really suprised if you can do this from the GUI.

Robert is correct...

 

I deliberately excluded the xcsv option from MacGPSBabel. The reason - that sort of thing is particularly difficult to include in a GUI.

 

However, all is not lost. MacGPSBabel can also be run in 'verbose' mode. Start MacGPSBabel and then press command-option-v on your Macs keyboard (press all three keys at the same time).

 

This will bring up a window into which you can enter the command that Robert detailed above. You have to enter full file-paths e.g. if you had a file on your desktop called 'myWaypoints.gpx' the full path would be '~/Desktop/myWaypoints.gpx'

 

As an alternative, you can use the terminal to access the build of gpsbabel that is embedded in MacGPSBabel...

 

Open the terminal (it is in the Utilities folder in your Applications folder). Type 'cd' (without the quotes) and then press the spacebar. Then go to a finder window and drag the MacGPSBabel application icon onto the terminal window. Back in the terminal window, press 'Return'. Then type 'cd Contents/Resources' and press return.

 

Using Roberts example you could now type:

 

./gpsbabel -i xcsv,style=~/Desktop/rimar -f ~/Desktop/test -o mapsend -F ~/Desktop/test.wpt

 

(assuming that the files 'rimar' and 'test' are on your Desktop).

 

Jeremy

Link to comment

Jeremy:

 

Thank you! The Verbose mode is especially good to know about. I must have missed that when I read the documentation for MacGPSBabel.

 

Regarding your remark about "that sort of thing is particularly difficult to include in a GUI" - may I offer a suggestion? On the popup menu for the list of file formats, could the first itembe "Custom XCSV..." and have that choice bring up a file selector?

 

Thanks again for your help!

 

Lee.

Link to comment
The Verbose mode is especially good to know about.  I must have missed that when I read the documentation for MacGPSBabel.

 

That'll be because it isn't in the documentation. It's mostly intended for debugging purposes.

 

Regarding your remark about "that sort of thing is particularly difficult to include in a GUI" - may I offer a suggestion?  On the popup menu for the list of file formats, could the first item be "Custom XCSV..." and have that choice bring up a file selector?

 

Yes it could, and something like that might get into the next generation of MacGPSBabel.

 

Jeremy

Edited by JeremyA
Link to comment

Cool, thanks!

 

As much as I like MacGPSBabel, I find myself still relying on the command line version of gpsbabel - under Windows 98 in Virtual PC! I haven't gotten around to installing the various parts I need to build the command line version for Mac OS X.

 

Is there any reason why sourceforge doesn't distribute a compiled binary for plain command line gpsbabel under OS X, as they do for Windows systems? I know I can open the MacGPSPackage file and use the executable that's in there, but that involves other complications...

Link to comment
Is there any reason why sourceforge doesn't distribute a compiled binary for plain command line gpsbabel under OS X.

They do, its just that it is inside MacGPSBabel (Mac OS X applications are actually folders full of files).

 

In the terminal do:

 

cd <path to MacGPSBabel>/MacGPSBabel.app/Contents/Resources

 

So if MacGPSBabel was on your desktop you would type:

 

cd ~/Desktop/MacGPSBabel.app/Contents/Resources

 

then do 'ls' and you will see the binary in this directory.

 

If you want to see the compiled gpsbabel binary in the finder, just right-click (or control-click for a single-button mouse) on the MacGPSBabel icon and select 'show package contents'. Then double-click on the 'Contents' folder and then on the 'Resources' folder.

 

You can copy the binary to somewhere that is in your path (e.g. /usr/local/bin) and then have command-line access from the terminal in exactly the same way as you would have if you had built it yourself.

 

JeremyA

Link to comment

At the risk of saying UNIX stuff in a Mac crowd (which isn't the dare it was a few years ago) you should be able to either add $HOME/Desktop/MacGPSBabel.app/Contents/Resources to your $PATH or just spray a symlink to it from a place like /usr/local/bin if that's in your path. Something like 'ln -s $HOME/Desktop/MacGPSBabel.app/Contents/Resources/gpsbabel /usr/local/bin/gpsbabel' should do the trick.

 

When JeremyA started doing the MacGPSBabel gig, I quit spinning the standalone version since he could actually test his releases and I was making them blindly. (You can still see the one for 1.2.1 on the site, though) If there is interest in keeping the -osx build up to date, I could be bribed into doing so...

Link to comment

and now, from left field...

 

I checked in because I use spreadsheets to create waypoint lists too. I use ExpertGPS though. I create field names to match those in Expert, save the file as .csv, and Import. From Expert, I upload to my MeriPlat.

 

However, this is all done on the PC laptop I "borrow" from work. I also have an iMac at home, so the general discussion has been very informative to me.

Link to comment

Jeremy:

 

I tried each of the things you mentioned, before I even posted my questions. As I was having unsatisfying results, I assumed I was on the wrong track. It took several tries to get it working at all (one mistake here and stuff just doesn't work) -- and still it's cumbersome. And will be until I set up paths and scripts and such.

 

I hope I'm not annoying you by posing these gripes. Maybe I'm just thinking like a Mac user. I know this a "work in progress" -- but still, shouldn't the Mac version be at least as easy to use as the i386 version? I dislike using Virtual PC for all of it's overhead, but the gpsbabel binary worked there right away, without so many of these steps that are necessary with the Mac version.

 

Lee

Edited by lee_rimar
Link to comment

Running gpsbabel from the command-line is not a feature of MacGPSBabel. MacGPSBabel is a GUI plain and simple.

 

MacGPSBabel and gpsbabel are, in fact, two different programs. What MacGPSBabel does is assemble a shell script which is then sent to gpsbabel. Gpsbabel then does all of the hard work in converting one file to another. To do this MacGPSBabel needs to know where gpsbabel is. As I decided that it was desirable for MacGPSBabel to work 'out-of-the-box', the simplest way to do this was to embed gpsbabel within the MacGPSBabel application.

 

Therefore moving gpsbabel out of MacGPSBabel will break it - unless you go into the Applescript and tell MacGPSBabel where you put the gpsbabel binary. However, copying the gpsbabel binary to another place can be done as simple as copying any other file, and will not break MacGPSBabel.

 

The underlying assumption is that anyone who wants the more advanced features of gpsbabel, and is able to understand how to run gpsbabel from the command-line, would also be able to do one of the options that has been suggested in the previous replies, i.e. set up a path, set up a symbolic link, or just copy the binary from one folder to another.

 

As Robert has said, perhaps also having a binary download of gpsbabel available on the sourceforge site would be a solution. But as this file would be exactly the same file as the one that is already found in MacGPSBabel, I don't know how this would help you.

 

JeremyA

Edited by JeremyA
Link to comment
As Robert has said, perhaps also having a binary download of gpsbabel available on the sourceforge site would be a solution. But as this file would be exactly the same file as the one that is already found in MacGPSBabel, I don't know how this would help you.

Jeremy:

 

I agree with Robert. I'm not knocking the effort you've put into the GUI; I'm just saying it would be better to ALSO have the command line version available for download on sourceforge.

 

How would that have helped me? I could have jumped right into the process of figuring out how to run it in the terminal window without the extra steps of finding the thing and getting it there.

 

The GUI is good, but it's not for everybody; and I really don't mind running a command line. But I see the MacGPSBabel distribution as a reversal of stereotypes.

 

The i386 binary? Just download it, and it works. That's what people usually say about Mac programs.

 

The Mac version? Comes in a GUI wrapper, that's good. But the GUI doesn't support every feature of the command line. No worries. I can write AppleScripts to drive the menu selections. I can use the undocumented verbose/debug mode. I can copy components out of the application package to install elsewhere. I can even figure this stuff out, after a while and with some help, though a large number of users might not be able to.

 

Missing features, undocumented features, extra steps, and anyone who really wants to use certain features of the program should be able to ("should be able to" == "will be required to") figure all that out?

 

That's what people usually say about i386 programs.

 

Lee

Link to comment
...you should be able to either add $HOME/Desktop/MacGPSBabel.app/Contents/Resources to your $PATH  or just spray a symlink to it from a place like /usr/local/bin if that's in your path.  Something like 'ln -s $HOME/Desktop/MacGPSBabel.app/Contents/Resources/gpsbabel /usr/local/bin/gpsbabel' should do the trick.

I've gotten it working in a simpler way, I think. As suggested, I pulled the gpsbabel component out of the MacGPSBabel package. I put it in its own directory along with my style sheet and files I'm converting, and cd to that directory when I start my temirnal session. Since the bash path doesn't include the current directory by default, I just issue my commands as "./gpsbabel ..."

 

No changes to path needed, no symlinks to set up, and I have all the files related to this exercise all in one place.

 

If there is interest in keeping the -osx build up to date, I could be bribed into doing so...

What will it cost me? As long as we're talking bribes, what would it take to turn magxfer into a full replacement for Magellan's "MAGUP" tool for updating both basemaps and firmware?

Link to comment

I don't really know how that's any simpler, but if it arouses you, go for it.

 

As soon as either of the OS/X servers on compilefarm.sourceforge.net comes back up, I'll toss up a build of the recent beta. (Follow-ups to the gpsbabel-misc mailing list, please.)

 

As for map transfers ala magup, take a look at my 'magxfer' program available on the download server. It transfers primary basemaps, secondary basemaps, and detail maps and runs on UNIXy systems. I have no reason to think it wouldn't work on OS/X but I haven't actually tried it. (I developed this when my primary unit was a 330 and I was flipping maps in and out a lot - it gave me one less reason to have to boot into Windows. Now that I cache with my Plat and have the midwest loaded, I don't use it much...) It doesn't do firmware updates - since those are comparitively rare - and can slag your unit if the process goes wrong - it didn't seem worthwhile.

Link to comment
Missing features

 

Have you tried the Windows GUI for gpsbabel? There are many more missing features there.

 

Because it was written as a command-line program, there are many features of gpsbabel that would be very difficult to implement in a GUI. I suspect that you will never see a GUI that implements 100% of the features of the command-line version of gpsbabel.

 

undocumented features

 

What undocumented features? I programmed all of the features of MacGPSBabel and as far as I am aware I documented them all.

 

A debug mode is not a feature it is a debug mode. It is intended for developers, and if you d/l the sourcecode (freely available at sourceforge) you will find a file called README.MacGPSBabel that includes instructions to developers as to using the debug mode. I am not aware of any software houses that publish details of how to debug their applications. For me, the idea of having a debug mode came from Apple's own Safari browser - please show me where they document the method for enabling the debug mode in that app.

 

extra steps

 

Granted, if you want to use gpsbabel from the command-line you are going to have to work out how to use the terminal. However, I believe the situation for Mac users now is much improved over what it was when I first found gpsbabel a little over six months ago. At that time, if you wanted to use gpsbabel on a Mac you first had to download, compile and install a set of libraries called expat, then you had to download, compile and install gpsbabel itself (of course, that is assuming that you had first installed Apples developer tools and you know how to compile C programs).

 

My intent in building a GUI was to make this multi-step process into a single step (download MacGPSBabel). If, in doing so I have actually made life more difficult then perhaps I have wasted my effort.

 

JeremyA

Edited by JeremyA
Link to comment
Because it was written as a command-line program, there are many features of gpsbabel that would be very difficult to implement in a GUI. I suspect that you will never see a GUI that implements 100% of the features of the command-line version of gpsbabel.

Same goes for other programs as well, and some other features are also more possible to implement with a GUI than with a command line. Comparing the Windows GUI and command-line versions of CMConvert...

 

GUI-only features

- (Nearly) free-form coordinate input for distance filter

- Sorting/viewing record list by name/waypoint/difficulty/terrain

- PDB file auto-install (only because the install method is predictable with Windows)

 

CLI-only features

- Distance filter from waypoint name

- Multi-term word search filters (though, this can be faked in the GUI version)

- Induce convulsions via option overload :lol:

 

Coincidentally, that program was also originally a command-line program, then the core of it was ported to Windows and a GUI slapped on it.

Edited by Maeglin
Link to comment

Jeremy:

 

I apologize for the tone of my last note to you in this forum. I wrote it in the wee hours of the morning when other issues were depriving me of sleep. That's my explanation but I admit it's a lousy excuse. Will you accept my apology in the purest form as: "You're right - I was in a bad mood and being a jerk about it" and let me off the hook?

 

I still think having the OS X command-line executable available on sourceforge along side the GUI version is a good idea - I should have just expressed that opinion and left it at that.

 

Lee.

Edited by lee_rimar
Link to comment

Robert:

 

... take a look at my 'magxfer' program available on the download server.  It transfers primary basemaps, secondary basemaps, and detail maps and runs on UNIXy systems.

I have been looking at it, I think it's great. I'll let you know if I run into any problems with map transfers, but the program compiled okay and seems to run just fine on my Mac.

 

I can't thank you enough for this stuff! Between gpsbabel and magxfer, you've given me (and other Magellan+Mac users) almost a complete toolkit.

 

The only thing missing is a way to do firmware updates; that's what I was really hinting at in my last post to you. Have you considered adding this feature to magxfer? I think the transfer protocol is even simpler than for maps.

 

Lee.

Link to comment

The only thing missing is a way to do firmware updates; that's what I was really hinting at in my last post to you. Have you considered adding this feature to magxfer? I think the transfer protocol is even simpler than for maps.

 

Lee.

I *think* firmware update are a variation of xmodem, but haven't approached Magellan engineering for the specs and haven't reverse engineered the protocol on the wire for the reasons I already gave.

Link to comment
I *think* firmware update are a variation of xmodem...

I guess I was misinformed. I thought it was just a few startup commands followed by a simple ASCII send. Don't recall where I read that, but it made sense to me because the firmware files are just text in Motorola S-record format.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...