• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Home
  • About
  • My Blogs
    • Photoblog
    • Knots
    • WP.com tips
kristarella.com

kristarella.com

Happiness Engineer at Automattic, lover of knitting, crochet, sci-fi and more

  • Presentations
  • Plugins
    • Exifography
  • Contact
You are here: Home / My life & thoughts / Using photo location data

Using photo location data

13 October 2018 by kristarella Leave a Comment

I have just updated Exifography to version 1.3.1. The changes in the plugin are relatively small, but one thing it does enable is to fetch geo data from images in a variety of formats.

In the future this should make it easier to build add-on plugins, such as a map-based directory of photos. For now if you have a particular use for the raw location data from a photo you can extract it with PHP like this:

if (class_exists('exifography')) {
$exif = new exifography();
return $exif->display_geo($imgID,$output);
}

The function display_geo($imgID,$output); takes two parameters: the first is the image ID, and the second is the format of the data that will be returned. If you use a specific image ID it will get the location data for that image (as long as it’s saved in the database). If you want to get the featured image ID, or first image attached to the post automatically you can set the image ID parameter to null, as long as you use the function within the loop the plugin will handle the rest. The output formats available are as follows:

  • dec – comma separated latitude and longitude in decimal format (e.g., -28.135953,153.484894)
  • coords – coordinates in minutes and degrees (e.g., 28° 8′ 9.43″ S 153° 29′ 5.62″ E)
  • url – URL to Google maps (e.g., //maps.google.com/maps?q=-28.135953,153.484894&ll=-28.135953,153.484894&z=11)
  • map – image URL for a Google map, requires API key to display (e.g., //maps.googleapis.com/maps/api/staticmap?zoom=2&size=200×200&maptype=roadmap &markers=color:blue%7Clabel:S%7C-28.135953,153.484894&sensor=false)

The first one is probably going to be the most useful for integrating with any other tools, but since I already use the others within the plugin, I have made them accessible too.

If you have requests, questions, suggestions, feel free to add them below, or raise an issue in Github.

 

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on Pocket (Opens in new window) Pocket

Like this:

Like Loading...

Related

Filed Under: My life & thoughts

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

A triptych of baubles. These are very satisfying t A triptych of baubles. These are very satisfying to paint ❤️💚💙

#watercolor #watercolour #christmas
I have really enjoyed this Christmassy painting! S I have really enjoyed this Christmassy painting! So glad my friend asked me to make some cards for our church helpers, because it set me on a roll!
#watercolor #watercolour #christmas #christmascards #watercolorcards
Had a great Saturday at the GKR Karate State Title Had a great Saturday at the GKR Karate State Titles! I was a sub for @jamesxuereb.me in the Blue Flame Dragons thanks to his sprained ankle; we won first round and came fourth overall!
I did a bunch of judging and officiating, which was really good.
I didn’t place in my individual events, but had a very fun final round of kumite (sparring).

#gkrkarate #karate
More stamping tonight. Even better than last night More stamping tonight. Even better than last night’s!
Did some stamping this evening. Love it! I wish I’d done some pages in other ink colours before I dismantled the stamps 😂
Had an appointment in the city, so I got to visit Had an appointment in the city, so I got to visit the @legocertifiedstores_anz Wicked display!
#wicked #lego #afol #sydney
A little book I made from Bunnings paint sample ca A little book I made from Bunnings paint sample cards. It’s going to be for mini paintings and collages. Sometimes it’s nice to start with a colour rather than a blank white page!
A little while ago I did some swatching of Daniel A little while ago I did some swatching of Daniel Smith and Schminke Horodam watercolours. So soothing! I love some of the granulating colours!
#watercolours
Follow on Instagram

Footer

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Top Posts & Pages

  • Home
    Home
  • Sistaco Nail Powder Review
    Sistaco Nail Powder Review
  • Bible reading printouts
    Bible reading printouts

Follow Me On…

  • Instagram
  • X
  • GitHub
  • LinkedIn
  • YouTube

Categories

Copyright © 2025 · Kristen Symonds · kristarella.com

%d