Thursday, January 20, 2011

Taking Data with a Consumer-Level GPS

Last year I wrote a Python script that could take a GPX file loaded with specially described tracks and waypoints and generate a series of shapefiles with appropriate geometries.

For example, you could name a track "contact" and it would close the track to create a ring and thus a polygon.  Or describe two points such as "f1,rl" (where 1 is a unique ID) to get a fault line attributed as right lateral.  Finally, it could also take waypoints with the description "sd,270,30" to generate strike and dip points.

I haven't messed with that script in a long time and probably won't start because it's often more work using a consumer level GPS rather than plotting directly onto a basemap.

But I think that using a GPS to record strike and dip data is a good idea.  Strikes and dips are often taken at contact boundaries, and with a GPS fix, you could make adjustments to your mapped contacts.  It also can save a lot of time as you don't have to digitize your S/Ds.  In addition, you'll have them in a tabular format (DBF) ready to process in any other software.

There is one caveat of course:  your GPS unit has built-in uncertainty due to government restrictions.  If your GPS provides an uncertainty value, make sure it isn't resolvable at your mapscale!  Or is at least within the uncertainty of your own mapping abilities (e.g., plotting strike and dip based on topo lines and real world topography).

That said...

You can download your waypoint data with all kinds of software.  Garmin Basecamp for Mac, gpsbabel, etc.  QGIS can directly import or download the GPX data as a layer from your GPS.  You then simply export the layer, load the resultant shapefile, and give it a projection (it should already have a datum such as WGS 84).  The shapefile has all the attribute data provided by the GPX file such as x,y coordinates, elevation, comment/description, and time and date.

On my Garmin, I put the following into my waypoint comment/description field: 330,10.

That's it.  I didn't put any other identifiers since I only took strike and dips  using the GPS.  I used the waypoint numbers as my station number in my field book and put them on my map.  I recorded the strike and dips into my field book as well as the UTM coordinates and the unit name that I took the reading on.  I also put the strike and dips on my map.

Within my GPX file, the strike and dip ends up in a field called "comment" and "description".  I used QGIS to convert the GPX waypoints into a point shapefile.  Then I used ArcGIS 10 to take care of the rest.

In ArcGIS 10, you can write a simple python function within field calculator to extract the strike or dip:

Pre-logic code:

def getStrike(val):
 sd = val.split(",")
 if sd[0].isalpha() == True: # in case you accidentally put a alphabetic character in your comment field
  return # return nothing. null.
  return int(sd[0]) # return first element in the list: strike.  Change data type to integer, as we get it as a string and that'll fail in a short int field.

Field calculator code:
getStrike( !comment!)

You could easily modify the above so that you can tell the function if you want a strike or dip and then return the appropriate value.  This splits "330,10" into a Python list of "330" and "10".  It then returns the first element of that list with sd[0].  Easy processing of GPS comments/descriptions into useful attribute data!

I should note that Arc 10 has a strike and dip symbol with the strike trending due north.  You no longer have to create a special expression to change your strike azimuth into a dip direction for symbol rotation.

1 comment:

  1. This command script for the asset tracking device is flexible enough to make firmware changes via command log, thus making it compatible to other cross-over devices. One can configure this with a PC or laptop.