Archive for January, 2011

h1

Data, glorious data!

5 January, 2011

Took my new Garmin eTrex H GPS out for its first spin today on a short walking track behind Hawker:

Trip stats:

Distance: 1.72 km
Speed: 5.6 km/h
Time: 00:18:13

The main purpose of this test run was to figure out the difference between Track Active Log and Saved Logs. The Active Log contained 90 trackpoints (89 once I removed the one it plotted when I turned it back on at home to download the data), yet the compressed saved log had only 16 trackpoints, although the plot of the saved track was good enough and only deviated from the full log by up to 8 metres and that only in a few places. It’s an irrelevant discrepancy as even the raw data points deviate from the actual coordinates by up to half that (at 4 metre accuracy) which means most of the time the simplification of the track by compression actually corrects tracking error. Swings and roundabouts.

It is true that the eTrex strips out date stamps when compressing a saved log so I guess you can only use the Active Log to geotag photos with ExpertGPS’s batch geotagging feature which matches up photo date stamps with your track’s and injects the GPS coordinates for the corresponding time (important to make sure your camera clock matches your GPS’).

Here’s a plot of my track, all 89 trackpoints taken at 20 metre intervals:

Hawker ACT track in Google Earth.

Sample trackpoint data.

Interactive map of track start:

Even though I probably should have been doing other things considering I’m moving overseas in two days I’ve spent much of the past week playing around with NZ LINZ topographic maps, GeoTIFF calibration, TWF formats, KML and plotting out routes I’d like to tramp when I get to New Zealand. Even wrote a Greasemonkey script with the help of James Peek to convert KML LineString strings to a suitable CSV format for GPSVisualizer’s GPS to GPX converter so paths drawn in Google Earth can be imported as waypoints or routes into GPS mapping software.

h1

How should I do this formatting?

3 January, 2011

GPS Visualizer has this great tool for converting a GPS file to GPX but I have an unorthodox need for it: to convert a comma-separated list of coordinates from a LineString element out of Google Earth.

Google Earth copies elements as KML so you can copy an element such as a path from Google Earth and paste it into a text editor. Locating the LineString element in the XML is relatively easy but it would be nice if there was an easy way to convert the single string into the proper CSV format needed to run it through the converter (shame Google Earth doesn’t write GPX natively).

This is what a LineString looks like (no line breaks):

172.2384849468256,-41.46954787285365,0 172.2432306652765,-41.46826502144933,0 172.2482385664333,-41.47388161005981,0

This is what I need to plug into the conversion tool (with line breaks):

name,desc,longitude,latitude
WP01,Waypoint,172.2384849468256,-41.46954787285365
WP02,Waypoint,172.2432306652765,-41.46826502144933
WP03,Waypoint,172.2482385664333,-41.47388161005981

I currently do this manually by:

  1. Copy LineString string of coordinates out of pasted KML and into a new text editor instance
  2. Search and replace ,0  with \n
  3. Copy and paste into Google Docs spreadsheet (which has default waypoint names and column headers)
  4. Copy whole spreadsheet back into text editor
  5. Search and replace \t with null

It’s a bit time consuming and putting me off from plotting routes in Google Earth, and is prone to error so some macro or something that can do this simple step automatically would be great.

Ideas?