Pointless Waymarks Software

Software from the Desert Southwest

Photo Direction, Declination, C# IGRF Geomagnetic Model - 12/17/2024

Created by Charles on 12/17/2024. Updated on 12/23/2024.

2024 December CMS Photo Direction Display
CMS Photo Direction Display.

For several years I've used the Pointless Waymarks CMS to keep a private journal of my outdoor activities. I care about my the data from my time outside and it gives me a private, durable, place to keep GPX data and phone snapshots.

It occurred to me recently that the Pointless Waymarks Project software wasn't taking advantage of an interesting piece of metadata from these photos: Image Direction.

2024 December Photo Metadata Including Img Direction
2024 December Photo Metadata Including Img Direction.

The Pointless Waymarks Project code uses Drew Noakes' metadata-extractor-dotne and extracting the raw Image Direction information is easy enough - but the data is often stored as a Magnetic bearing...

Declination

Putting aside complicated mapping and GIS concerns one core challenge for even simple software is that true bearings are more easily applied in simpler mapping scenarios and simpler to understand on most paper hiking maps. So, to me, it makes more sense to store and show the true bearing for a photograph even if the metadata is a magnetic bearing.

The difference between true north and magnetic north is declination. Declination is an adjustment that you can apply to convert between magnetic and true bearings.

But because Magnetic North is slowly, constantly, changing and varies across the surface of the earth there is not a simple way to calculate declination. As you descend into the rabbit hole of translating between true and magnetic bearings you will like come across two different models:

These models are well outside of my field of expertise so I leave any detailed critique of the models and determination of what to use to the reader. What I did find that helped me decide on a model was this information from the National Centers for Environmental Information's Geomagnetism Frequently Asked Questions:

What is the difference between IGRF and WMM models?

The World Magnetic Model (WMM) and the International Geomagnetic Reference Field (IGRF) are estimated from the most recent data and are of comparable quality. The differences between IGRF and WMM are within expected model inaccuracy. The WMM is a predictive-only model and is valid for the current epoch (2020.0 to 2025.0). The IGRF is retrospectively updated and the latest update, IGRF-12 is valid for the years 1900.0 - 2020.0. While IGRF is produced by the voluntary research of the scientific community under the banner of the International Association of Geomagnetism and Aeronomy (IAGA), the WMM is produced by NCEI and the British Geological Survey (BGS) for the US and UK defense agencies with guaranteed quality, user support, and updates. For the U.S. Department of Defense, the U.K. Ministry of Defence, the North Atlantic Treaty Organization (NATO), the International Hydrographic Organization (IHO) and the Federal Aviation Administration (FAA) the standard is WMM. For other users, the choice between WMM and IGRF is arbitrary.

The IGRF model's historic coverage seems like a valuable feature for the Pointless Waymarks Project code so I decided to translate pyIGRF: Python 3.7 code for generating spot values from the International Geomagnetic Reference Field Model into C#. My decision was partly about learning, fun and a love of coding - not a business decision about ROI - and if you are reading this it is worth reviewing the available C# code/packages that I found and the API links below:

There is an IGRF API available from the British Geological Survey:

I based my C# code on pyIGRF because it was linked on this page: IAGA V-MOD Geomagnetic Field Modeling: International Geomagnetic Reference Field IGRF-13 (Note: do NOT use the version of the code linked on that page - it has an important bug that is fixed in linked GitHub repo). I did the first conversion of the Python code with GitHub Copilot, cleaned up and corrected the ai version, did another round of corrections by debugging thru both versions and then wrote a few tests based on data from IGRF Calculator. In the process I learned about a number of other IGRF Python projects - see Alternatives and Too many "IGRF"s.

2024 December Photo Content Map with Photo Bearings Option2024 December Photo Editor Button to Show the View in Peak Finder Web with Photo Direction2024 December File Metadata Report including Map and Photo Direction2024 December Photo Direction shown on Page for a Photo when Location is Shown

Results:

PS - In the process of working on this code and looking carefully at some of my photos it didn't take long to find some photos where I could tell that the recorded Photo Direction was not accurate - it was a good reminder that all casually, incidentally, obtained location data will have inaccuracies!


Tags:
Posts Before/After: