]> Witch of Git - web/blog/blob - posts/2024/exif-on-the-moon.md
Move to an ES module for config
[web/blog] / posts / 2024 / exif-on-the-moon.md
1 ---
2 title: "EXIF geodata, and what if you took a picture on the moon?"
3 author: Cassie Jones
4 date: 2024-10-04
5 tags:
6 - data formats
7 - metadata
8 summary: "Learning about EXIF tags, geodetic systems, and coordinate reference systems so you can geotag your lunar vacation photos."
9 ---
10
11 A conversation about staying private and stripping EXIF tags on blogs lead to shdwcat asking the question "what would happen if you took a picture on the moon?"
12
13 [colin](https://gameboat.org/) gave some answers starting with GPS logistics.
14 You probably can't receive GPS on the moon, and even if you can you're probably outside the consumer gear cutoffs for GPS.
15
16 > [vogon](https://gameboat.org/): but if neither of those things happened I assume it would just display you as being at whatever point on the earth you were over, at an altitude of about 1.267 billion feet
17
18 {#
19 > vogon: that's a good question <br>
20 > vogon: my first guess is that your camera won't be able to receive GPS from the moon <br>
21 > vogon: my second guess is that because your camera is consumer gear and isn't export-controlled, it will blank out the GPS position because your altitude is higher than 50,000 feet or whatever the cutoff is <br>
22 > vogon: also I bet the relative motion of the moon relative to the earth is faster than the 500mph speed cutoff as well or whatever <br>
23 > vogon: but if neither of those things happened I assume it would just display you as being at whatever point on the earth you were over, at an altitude of about 1.267 billion feet
24 #}
25
26 However, I figured we could do better than "a point high above the Earth."
27 If you could state the coordinate system, you should be able to list an actual point on the moon.
28
29 I had no idea how to do that though.
30 So let's take a look:
31
32 ## EXIF
33
34 First, what can we do in EXIF?
35 I've always had a hard time understanding exactly what fields EXIF can store.
36 Many descriptions focus on the structure over the available keys.
37 But this time, I discovered the perfect resource that I've been looking for for years: exiftool.org maintains a clear list of exactly what you can store in EXIF.
38 <https://exiftool.org/TagNames/EXIF.html>
39
40 If we scroll down on that page we find the relevant entry: Tag ID: `0x8825`, name: `GPSInfo`.
41 This entry links to the [GPS Tags](https://exiftool.org/TagNames/GPS.html) where we find another nice table of the GPS-specific tags.
42 Most of these specify the latitude, longitude, altitude, and bearing, or they let you annotate the location descriptively.
43 But there was one undescribed property, `GPSMapDatum` which looked like it might do the trick.
44
45 {#
46 | Tag ID | Tag Name|Writable|Group|Values / Notes
47 | ------ | --------|--------|-----|--------------
48 | 0x8825 | GPSInfo |- |IFD0 | - [GPS Tags]
49 #}
50
51 ## A Map Datum
52
53 What's `GPSMapDatum`?
54 Well yet again the exiftool site helped me out when I went searching.
55 This time I found [an answer on the forum](https://exiftool.org/forum/index.php?topic=6748.0) where someone mentions "WGS-84" as a valid value, so we can go look at that.
56 And when we do, we can see that WGS 84 is the current version of the [World Geodetic System](https://en.wikipedia.org/wiki/World_Geodetic_System).
57
58 A [geodetic datum / geodetic system](https://en.wikipedia.org/wiki/Geodetic_datum) is a reference feature that maps can be made against.
59 Coordinates mean nothing without an origin and axes, and a map datum lets you define that.
60 Historically, countries and then continents had their own map datums, and then eventually the [World Geodetic System](https://en.wikipedia.org/wiki/World_Geodetic_System) was developed which defined a standard approximation for the shape of the earth and reference coordinates.
61 The GPS system uses WGS 84, and people/systems will assume that's what you mean if you don't specify otherwise.
62
63 I looked at these references:
64 - <https://maptools.com/tutorials/map_datum>
65 - <https://epsg.org/home.html>
66 - <https://geodesy.noaa.gov/INFO/facts/datum.shtml>
67
68 {#
69 ## Coordinate Reference Systems
70
71 https://github.com/ESIPFed/science-on-schema.org/pull/104/files#diff-8fbcf163f9037d243853b588c07ed299aa39709fe03352d438b221e05729f293R724
72 https://www.w3.org/2005/Incubator/geo/XGR-geo-ont-20071023/
73 #}
74
75 ## Mapping the Moon
76
77 What about [coordinate systems for the moon](https://en.wikipedia.org/wiki/Selenographic_coordinate_system)?
78 Well, there's no standard for them accepted like WGS 84.
79 NASA developed [a system for the Lunar Reconnaissance Orbiter missions](https://science.nasa.gov/wp-content/uploads/2024/01/luncoordwhitepaper-10-08.pdf) which have been reused outside of that, and is seemingly the most common coordinate system by far.
80
81 > In 2008, the Lunar Reconnaissance Orbiter (LRO) mission and the Lunar Geodesy and Cartography Working Group (LGCWG) recommended use of the Jet Propulsion Laboratory’s (JPL) DE 421 ephemeris, to be rotated into the ME system, as the ME reference frame for mapping. <br>
82 > &mdash; <https://www.lpi.usra.edu/leag/reports/ME-White-Paper_Final.pdf>
83
84 But annoyingly, this coordinate reference system doesn't seem to have a nice concise name, unless you just use "Mean Earth" (<abbr title="Mean Earth">ME</abbr>) to refer to this reference system.
85 And, there's no GPS system to give you coordinates here...
86
87 ### Lunar GPS development
88
89 But people are developing it right now.
90 You can read about agencies [preparing to deploy lunar GPS satellites](https://www.wired.com/story/moon-gps-is-coming-nasa-jaxa-esa-glonass-galileo/).
91 And you can read about [the NGA developing the Lunar Reference System](https://www.nga.mil/news/NGA_Leads_Development_of_Navigational_Reference_Sy.html) as a standard coordinate system for deployments like that.
92 Unfortunately, as with so much of space exploration, it's the military.
93 (Even WGS 84 here on Earth was substantially developed by the US military for GPS purposes.)
94
95 ## The Answer
96
97 Specify a Lunar coordinate system in the `GPSMapDatum` field and you can have proper coordinates on the Moon for your photos.
98 Right now, there is no standardized value appropriate for the moon.
99 Your best bet right now is probably the <abbr title="Lunar Reconnaissance Orbiter">LRO</abbr> <abbr title="Mean Earth">ME</abbr> coordinate system.
100 In the future, it will be something like the Lunar Reference System.
101
102 {% figure src="/img/2024-as11-40-5875large.jpg", alt="Apollo 11, an astronaut next to an American flag on the moon." %}
103 Image of Buzz Aldrin by [NASA](https://www.nasa.gov/image-detail/as11-40-5875large/). Cropped. <br>
104 [Take a look at the EXIF data :)](https://exifinfo.org/detail/K-WvTMvSSrrCVz7kER_H-w)
105 {% endfigure %}
106