Adventures with SD cards in the field

We got some variable results with SD cards in some recent fieldwork – cameras not taking photos as regularly as possible, transfer rates not as advertised – and some research turned up even more disturbing news about SD cards and what to watch out for.

SD cards are cheap because they are fundamentally made of cheap, error-prone memory, and rely on a microprocessor in each card that manages the data and thus what your computer sees. This has huge security consequences. Watch the youtube video in the link.

There are hacked SD cards that are labelled at high capacities, will report a higher capacity when plugged into your computer, but actually have a fraction of that capacity available.

This post will be updated with tools and code for testing SD cards; am experimenting with a few different tools.

Geotagging a folder of images with ExifTool

Sheep and goats from 1200 feet AGL

Cattle, sheep and goats from 1200 feet AGL. Nikon D3100, 35mm lens.

We’re about to start a livestock and wildlife census in the Serengeti ecosystem, and using a point photo count method (APS). This is the first time we’ll have used APS for anything other than wildebeest, and we’re working on managing a different (and much larger) set of data.

Post-flight processing includes geotagging the photos collected based on the tracklog. I’ve used Graphicconverter on the Mac but am trialling ExifTool which will work on Windows as well (though it’s command line).

Update 2016-08-27: see this Github Gist where I’m editing and keeping more notes.


To tag a folder of images, open Terminal on Mac/ Linux and enter:

exiftool -geotag tracklog/trk-2016-08-08-PM.gpx digpix/

… slightly differnt for the DOS (command) window in Windows:

exiftool.<strong>exe</strong> -geotag tracklog/trk-2016-08-08-PM.gpx digpix/


  • exiftool (or exiftool.exe) = the command
  • tracklog/trk-2016-08-08-PM.gpx = tracklog;
  • digpix/ = folder of images.

Geotagged aerial image with bomaResults

Geotagging 1,000 images took about 25 seconds just now. Looks pretty good – Graphicconverter shows the Google satellite image with the photo centre point next to the image, right.

You can see the shape of the old boma (overgrown) and the road. Nice!


Customised embedded Google map with KML data

screenshot 2016-02-15 at 17.00.30

  1. Create a track in Google Earth or QGIS and save it as a KML file.
  2. Head to …
  3. Click on ‘create a new map’.
  4. Under the ‘untitled layer’ menu item on the left, click ‘import’ and select your KML file.
  5. Change the style of the imported data to suit.

Spatialite-gui for OS X for Spatialite 3.0.1

Spatialite logo

This is an update to a previous post on spatialite for OS X, with a link to the updated spatialite-gui.

GUI tools

There are two great tools for viewing and administering SQlite / spatialite databases – one is even a basic GIS package.

  • Spatialite-gui – create and manage sqlite databases with spatialite support, do queries.
  • Spatialite-gis – view data in the database (change basic appearance / turn layers off and on).

Note: Homebrew for spatialite_gui isn’t working on my OS 10.8 as of 2013-09-18.

Screenshot: Spatialite-gui v1.5 in action

Screenshot: Spatialite-gui v1.5 in action

GIS for Mac OSX

Once, the only serious way to do much GIS work on your Mac was to use ArcGIS (or MapInfo) in a Windows virtual machine … but not anymore.


QGIS 2.0-dev on Mac OS X 10.8

QGIS 2.0-dev on OS X – fast & stable.

Quantum GIS can now really compete with ArcGIS in terms of functionality and map creation. I miss a few things – proportional symbols for one – and the map layout for printing is not as easy – but the workflow is much easier, especially when editing shapefiles.

  • Installers for the current stable version of QGIS are maintained at William Kyngesburye’s site including development builds from time to time, as well as the supporting frameworks required to run it.
  • Development builds (v 2.0 Alpha) are available from the Dakota Cartography site and updated nightly. These generally work really well – but many of the plugins no longer function.
  • You can run BOTH the stable and development versions side by side on your Mac – this is what I do, so far without a problem. One will be called and the other; the only problem going back and forth between them may be compatibility between project file (.qgs) versions.

Installation of either the stable or dev versions requires installation of the supporting frameworks, then a standard drag-and-drop of the app itself:

  1. Download and install the GDAL Complete framework (double click and install the package) – this gives you some required frameworks (applications) including GDAL, GEOS and SQLite (which are all useful in their own right) giving you command line access to those apps as well;
  2. Download and install the GSL framework (double click and install the package);
  3. Download and install QGIS (open the .dmg and drag the app to the Applications folder).
He also has installers for GRASS and PostGRESQL for the mac. I use the GRASS installer but find the installer (see below) far easier.

GISLook & GISMeta

Use quicklook to browse for a spatial file and press space to see a preview of the geometry.

Browse for a spatial file and press space to see a preview of the geometry.

These are plugins for Quicklook and Spotlight for OSX, letting you preview shapefiles and other types of geographic data directly in the Finder or from QGIS while browsing for files.

This is invaluable.

With GISLook you can preview (press the spacebar while browsing) geometry or image data from shapefiles, .e00 interchange files, coverages, .asc grids, DEMs and others (see the home page for a complete list).

GISMeta while show the size of  a raster grid file in the “get info” window in the Finder.


The easiest way to get this going is with the installer, giving you PostgreSQL 9.2 and PostGIS 2.02. Download, drag-and-drop, done.

I have battled with installing PostgreSQL and PostGIS on the Mac with varying results – homebrew or the packages from Kyngchaos can sometimes get it installed, but then the various frameworks or QGIS plugins (Python) don’t play well together.

  1. Download and use the drag-and-drop PostgreSQL installer from
  2. Install PGAdmin to administer PostgreSQL.



R plays very well with mapping and spatial operations – not good for editing shapefiles, but great for analysis and basic presentation.

You’ll probably want the packages:

  • sp
  • maptools
  • spatstat
  • rgdal

The R Project for Statistical Computing has installers for R on the Mac. For a development environment (including syntax highlighting, version management and export of plots) try RStudio.