Which GPS is best for API access?
May 12, 2008 11:26 AM   Subscribe

I want to write some Location-based software (eventually on the mobile platform) and be able to test it on my laptop without faking GPS coordinates. What's a good, cheap GPS unit with a public API and/or some documentation/third party libraries for interacting with the device and retrieve information programmatically?
posted by callingshotgun to Computers & Internet (9 answers total) 2 users marked this as a favorite
GPSGate works for this. Not free.
posted by meehawl at 12:39 PM on May 12, 2008

Response by poster: That's a helpful piece of software, but I'm really looking for a GPS device that I can code against.
posted by callingshotgun at 12:53 PM on May 12, 2008

Looks like all kinds of people out there are hacking etrex GPS units. Etrex Legends are going for about $99 (or less these days)
posted by thenormshow at 1:09 PM on May 12, 2008

There are USB and bluetooth GPS devices that can speak to your laptop. They all generally behave like a serial port that you can continuously read standard NMEA strings from. At work I've enjoyed using the Holux GPSlim240 (tiny and bluetooth with good positional accuracy), but I'm sure there are plenty, shop around. Devices with SiRF III chips will give you the best accuracy.

So to program for it, you just need to open a COM port and parse the GPS strings to grab a lat/lon. What language are you writing in? You could cobble something together quickly in .NET with (I think) its built-in serial port or the OpenNETCF serial doodad and, say, this interpreter (C#).
posted by Xelf at 1:15 PM on May 12, 2008 [1 favorite]

PS. All of the above will work both on your notebook and on Windows Mobile 5+ phones; I've paired bluetooth GPS with 'em just fine.
posted by Xelf at 1:18 PM on May 12, 2008

Response by poster: Xelf- Thanks! That's exactly what I was looking for.

I hadn't actually chosen a language yet- Ultimately this is for a Google Android project (so the actual project will be in java), but since there are no actual android phones out yet, I wanted a way to feed coordinates to the emulator instead of loading pre-fab routes, so I could see how well the whole thing worked on the fly. Since it would be an external program grabbing the coordinates and messeging them to the emulator, I was either going to use C#, Java or Python (the three languages I have the greatest familiarity with) and probably set up an Android "mock location provider" that took in coords via jabber or telnetting into the emulator. My test suite is going to be a total daisy-chain:D

Thanks for the advice in SiRF III and the Holux GPSlim240. Quality stuff, and easily under $100 on ebay!
posted by callingshotgun at 3:30 PM on May 12, 2008

Check out SparkFun Electronics -- they have several GPS evaluation boards and lots of modules. They recently came out with a nice little USB option: http://www.sparkfun.com/commerce/product_info.php?products_id=8703
posted by thehickmans at 4:36 PM on May 12, 2008

This is a really poor way to test, and moreover suggests that you're not designing your program to be modular enough.

Faking coordinates is exactly how you want to test, because then you're only testing your program with known fake data. (And with a larger range of data than you could conveniently get by moving ariund in real life.)

Then you write a test to test that real the GPS source consistently gives correct data (or doesn't, if it was just turned on, or it's under-powered, or in a tunnel, or whatever).

Once your code is tested and the GPS source is tested, only then do you write an integration test that runs both.

Note that this also allows you to swap out versions of your program, or GPS receivers, orthogonally, without having to retest parts that don't change. This reduces the complexity of the total project to additive over total components, rather than multiplicative over total components.
posted by orthogonality at 6:16 PM on May 12, 2008

Response by poster: @orthogonality-

Not within the context of the software:

Regarding it being "modular", The end product will exist on an Google Android phone, which has built-in GPS and way to interact with it via the SDK. The GPS unit is just something that I can connect to my laptop, and feed coordinates into the Android emulator, which will use those coords to grab location-based data off the web. The Android SDK has some built in mock-location-provider classes, I'm just going to extend one of those and swap out the built-in GPS as a source in the end product

If the software was just checking shortest-route-to-destination or something that delivered information you could extrapolate from examining a paper map, the prefab route would be the way to go. However, I'm looking to be able to provide more dynamic information- Hotel/Gas rates in immediate vicinity, jazz like that. I want to be able to drive by a gas station and look on my laptop to see if the rates match up:D Testing how the GPS handles different scenarios (tunnels, low batteries, etc) and how they effect accuracy is going to be part of the process, of course, but by pinpointing the given coords on a map, it'll be fairly straightforward to determine if the unit delivers coordinates that match up to my physical location:D
posted by callingshotgun at 11:51 AM on May 13, 2008

« Older Where can I have a PDF printed as a poster?   |   Access + Avery = crap. HELP! Newer »
This thread is closed to new comments.