Retain location metadata on photos sourced from Photos
If you often take your photos out of Photos1Dear Apple, please stop naming products after their associated nouns!, you should be aware of a big "gotcha" just waiting to bite you: Unless you're careful with how you get your photos out of Photos, you'll lose those photos' location information—and for iPhone photos shot in HEIC, the photos will be converted to JPG.
There are three ways to get a photo out of Photos: Drag to your desktop, use File → Export → Export (n) Photos, or use File → Export → Export Unmodified Originals for (n) Photos. Only one of these methods will retain the photos' location information…
In particular, if you use either of the other two methods, these metadata values will be lost:
kMDItemAltitude kMDItemGPSDestBearing kMDItemImageDirection kMDItemLatitude kMDItemLongitude kMDItemSpeed
You can test this yourself very easily: Just use each of the three methods to export the same photo. Rename it each time (drag.jpg, export.jpg, unmodified.heic…or whatever). Then, in Terminal, type mdls, press the Space Bar, and drag and drop one of the photos, then press Return in Terminal. The output is everything macOS knows about the photos. Only the unmodified export will have location information (and still be in HEIC format, if that's what it was originally in).
The downside of this, of course, is that you cannot export an edited photo and save both the edits and the location information. Or if you can, I haven't discovered how.