Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MareLuce

macrumors 65816
Original poster
Sep 26, 2010
1,156
494
I thought this would definitely be possible. It appears not.

Is it possible to to search Apple photos albums by US zip code?
 
Last edited:
It doesn’t appear to be possible. My only hits were when the zip code appeared on a box or paper where it was being read. Just using the map doesn’t meet your needs? Just curious.
 
  • Like
Reactions: MareLuce
It doesn’t appear to be possible. My only hits were when the zip code appeared on a box or paper where it was being read. Just using the map doesn’t meet your needs? Just curious.
I appreciate your trying.


No - Using the map definitely does not meet my needs. It would be so much faster to search by ZIP Code.
 
  • Like
Reactions: fatTribble
Only if the photo file format supports metadata and the metadata contains zip code information.
Since Apple photos include the location to a much more specific area than ZIP Code, can’t it infer ZIP Code at the time of search?
 
Since Apple photos include the location to a much more specific area than ZIP Code, can’t it infer ZIP Code at the time of search?
Are you referring to translating every unique geo-coordinate to a USPS zip code? Sounds like a feature request.
 
I did a search for keywords: convert coordinates to us zip code

A fair number of websites came up in the results, including this one on GitHub:

There are probably others that provide the same service, maybe even offering a web service.

I'm pretty sure the lat/lon coordinates of a photo are readable using the Spotlight metadata interface. Metadata is readable with the Terminal command 'mdls'. You could do a few tests on photos to find out.

Once lat/lon has been extracted for a given file, it can be converted to a ZIP code, and that can then be attached to the file, either in conventional metadata, such as the com.apple.metadata:_kMDItemUserTags xattr, or in a custom xattr. The 'xattr' command can read or write xattrs.

The com.apple.metadata:_kMDItemUserTags is visible in Finder's Get Info pane, in the textbox at the top, where comments can be entered.

I'm not sure how to get Spotlight to read a custom xattr, but maybe there's an existing one related to street address that can be repurposed, since ZIP codes are primarily designed for mail delivery. Or maybe there's some photo-related setting or attribute that can be used to hold a 5-digit number.

If the data is present in the Spotlight metadata, then it should be searchable with Finder searches. It may also be searchable with other apps, such as Photos.


This seems like the basis for a useful 3rd-party Mac app, or even an iPhone app, so it might be worth searching the relevant app store.
 
  • Like
Reactions: MareLuce
what seems to work is searching for the place - if you have geotagged data with lat.&long. Apple Photos will assign a location label from Maps you can search for. The assigned location label is visible in the »Info«-overlay on the left, in this example screenshot the blue " Seglinge".


IMG_9183.jpeg


This seems to work quite well. Within larger cities it assigns the name of the city quarter in the form »CITY NAME - QUARTER«. Either or the whole are found when searching in Apple Photos.

nota bene: when moving between a lot of islands in an archipelago as in the above screenshot it seems that the municipality is assigned, which can be quite large (but that area uses also only a single postal code, so there is nothing to gain from that). Personally I prefer the municipality/city/quarter solution over zip codes, as usual YMMV 🙂
 
  • Like
Reactions: MareLuce
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.