Posts Tagged ‘gpx’

bbtrackerwpt - create GPX files of named waypoints from bbtracker

Saturday, June 28th, 2008

I like bbtracker -it’s a very simple GPS track logger for the Blackberry. It has (at least, at the current version) one problem - you can’t create waypoints in the way that most GPS applications would expect. You can, however, name trackpoints - so I wrote a little perl script to extract all the named trackpoints from an exported GPX files, and save them as waypoints.

Download bbtrackerwpt - converts named trackpoints from bbtracker GPX into waypoints. You’ll need XML::Simple for this to work.

I imagine this script has a limited audience, and quite likely a limited lifetime. The author of bbtracker has said they’d provide waypoint support in the next version. You know me and patience, though …

If I remembered more XSLT, I’d have done this the proper way. As is, I create XML using Perl print statements. I’m probably okay, as the name field is the only piece of free-form text, and I do some rudimentary escaping of characters that XML doesn’t like. The output seems to validate, which is more than the GPX that bbtracker produces does. The length of your GPS track may vary ;-)

to convert a geographic shape file to a UTM projected one

Friday, August 10th, 2007

OGR seems even more cryptic than proj:

ogr2ogr -t_srs "+proj=utm +zone=17 +datum=NAD83" -s_srs WGS84 outfile-utm.shp infile-geo.shp

Note the weird output-first convention. Check your UTM zone and datum. This approach seem to work for GPS tracks saved as GPX and converted using gpx2shp.

proj: your cryptic geographic friend

Tuesday, May 8th, 2007

I do a lot of work with UTM survey locations, and quite often I want to have them stored in my GPS. I used to rely on a powerful but oh-so-clunky Windows application called Corpscon, but I really didn’t want to be limited to Windows machines, and Corpscon really only works for North America.

And then I discovered proj. While it has a pretty hideous command-line syntax, the output matches Corpscon to the sixth decimal place. Say you had a waypoint stored (for Southern Ontario, UTM Zone 17, NAD83) like this:

4843744 443025 Goderich

that is, UTM northing,easting, followed by label.

To convert this to geographic coordinates, you’d invoke invproj (which goes from UTM to geographic) like this:

invproj -E -r -f "%.6f" +proj=utm +zone=17 +datum=NAD83

and it would spit out:

4843744 443025 -81.707611 43.744546 Goderich

Columns 3 and 4 are the geographic coordinates - 43° 44′ 40.37″ N, 81° 42′ 27.40″ W in more familiar notation - which is in fact a location between Brock St and Newgate St in Goderich, Ontario.

With a Unix box, proj and gpsbabel, I’m set for all my coordinate conversions.