Categories
Arduino CircuitPython Microcontroller Photography Project Raspberry Pi Pico RTOS

Geotagging Photos

I found a good Instructable, GeoTagging With a Standalone GPS Unit & GeoSetter : 6 Steps – Instructables, to walk through geotagging photos with a standalone GPS device and the GeoSetter application. As a result of reading through the 14 year old Instructable, I landed on a somewhat standard CSV format that GPSBabel understands. As a result, the C++ code was updated in the GitHub repository, richteel/gps_tracker: GPS Tracker and data logger (github.com) to use the ‘Universal csv with field structure in the first line’ format. The first line of the CSV file contains the following headers: utc_d,utc_t,lat,lon,alt,head,speed.

  • utc_d: UTC date
  • utc_t: UTC time
  • lat: Latitude
  • lon: Longitude
  • alt: Elevation in meters
  • head: Heading in degrees
  • speed: Speed in meters per second

See: GPSBabel 1.9.0:Universal csv with field structure in first line (unicsv)

GPSBabel Screenshot
GPSBabel screen showing the ‘Universal csv with field structure in the first line’ format selected

GPS Logger

The GPS Logger that I’m discussing, was one I designed and built. The GPS Logger is Open Source, with the case, PCB, schematic, and code are included in the GitHub repository. The code, which is currently being used is the C++ code in the folder, Arduino/gps_tracker. (The CircuitPython code may be updated shortly as well, but for now, it is best to use the C++ code.) GPSBabel is used to translate the CSV file from the GPS Logger into a GPX file, that GeoSetter may be used to geotag photos.

Software Used

First a note on the time setting on the camera. Previously, I would set the date and time to the local date time, however I frequently would forget to update when using the camera, which was problematic when switching between daylight saving time and standard time. I decided this time to simply set to UTC. I’m not certain if this will be a good solution, but we shall see.

The first step is to translate the GPS Logger CSV file into a GPX file, using GPSBabel.

The next steps are done using GeoSetter. My camera produces JPG files, so I have only set the values for JPEG.

GeoSetter File Settings – JPEG
GeoSetter Data Preferences Settings
GeoSetter Map Settings
GeoSetter Misc Settings

Once the settings have been edited, then it is possible to load the GPX file with GPS data and geotag files in a folder. Start by selecting all the photos in the photos panel to the left.

GeoSetter Application with all photos in the photos panel selected

To geotag the selected photos, go to the menu and select, Edit > Synchronize with GPS Data Files…

GeoSetter Menu – Edit > Synchronize with GPS Data Files…

A dialog will open, with options for synchonizing the photos and GPS information. I have selected the “Synchronize with a Directory containing Data Files:” option. Not sure why, but I needed to uncheck the “Request Time Zone by using Webservice” option for the geotagging to work.

GeoSetter – Synchronize with GPS Data Files dialog window

A dialog showing the number of matched files is displayed. If no matches are found, then you will be prompted to try again or cancel. In this example, all 20 images were matched with GPS data, so the “Yes” option is selected.

GeoSetter – Synchronize with GPS Data Files confirmation dialog

An additional confirmation dialog will be displayed asking if you wish to save the assigned track(s) to the current directory. Select the desired option.

The photos will be geotagged and the positions will now be displayed on the map.

GeoSetter showing a map with the locations of the photos

The photos are not saved at this point. You will need to select Edit > Save Changes, from the menu to write the EXIF information to the photos.

Once the photos have been saved, you may view the photos in Windows Photo Viewer to show that the location information is saved with the photos.

Windows default photo viewer showing that the location infromation is saved in the EXIF information of the photo

Alternatively, you may look at the file properties to see the EXIF information.

File Properties – Details, showing GPS data
Categories
Arduino CircuitPython Microcontroller Project Raspberry Pi Pico RTOS

Revisiting the GPS Logger

I’m on vacation/holiday this month, but before I left, I paid the GPS Logger project a visit and rewrote the code in C++, using the Arduino IDE and FreeRTOS to make it a bit more responsive to user input. The result is a nearly polished project that I’m very happy with, but I plan to reorganize the GitHub, project files, at richteel/gps_tracker: GPS Tracker and data logger (github.com), and provide a few different patterns for implementing such a project. While I like using FreeRTOS, it is not for everyone, particularly those just getting started with microcontroller projects. I also wish to revisit CircuitPython and see about implementing the FreeRTOS version of Python. I believe the CircuitPython implementation is still an alpha version so I may not be able to do anything with it yet, but may give it a go.

Here are some photos of the GPS Logger in action.

TeelSys GPS v0.5 C++
Date Time (UTC)
01/06/2024 07:54:29
Local (EST)
01//06/2024 02:54:29
Screen 1 of 6 – Main Time
Lat: 17.9689 N Long: 102.6152 E Alt: 600.72 ft Speed: 1.52 mph Head: 0.0 deg
Screen 2 of 6 – Location Information
Satellites: 5 GPS Fix: Yes Fix Quality: GPS 3D Quality: 3D GPS Enabled: Yes
Screen 3 of 6 – GPS Information
Battery: 3.94 V Battery: 69.94 % Status: Discharging
Screen 4 of 6 – Battery
Card: Present Type: SDHC/SDXC Total: 14.621 Gb Free: 14.620 Gb Files: 11
Screen 5 of 6 – SD Card Information
Memory - Heap Free: 154920 b 65.42% Freq: 133.00 MHz
Screen 6 of 6 – Memory

Why is the GPS Logger needed when photos on the phone are Geotagged or the phone is capable of this function?

While this functionality may be available with apps on the phone, it is not always possible to get tracks off of the phone easily to use with an application such as GeoSetter for photos taken with a dedicated camera, such as the Sony DSC-WX500. I want to be able to use the data gathered from the logger and geotag photos from cameras, which do not have a GPS. I also want to create maps, showing the tracks that we took, while on vacation. For both of these reasons, a dedicated GPS Logger is a good option. The file format of the current version is a CSV file, which may or may not work with the GeoSetter application, but I should be able to convert the data into a format that will be usable.