Menu

Geocode using IPTC Location lookup

2007-09-12
2013-04-30
  • Gavin Treadgold

    Gavin Treadgold - 2007-09-12

    Hi.

    I am interested in a means of using IPTC Location metadata to assign co-ordinates to photos. I have been using Lightroom to assign IPTC Location, City, State, and Country.

    What I would like to be able to do is parse a directory (and subdirectories) of files, read the IPTC Location, look up co-ordinates stored in an image, and apply the GPS co-ordinates to the appropriate images from a lookup file that contains IPTC Location fields and co-ordinates.

    For example, an image might be tagged...

    IPTC Location - 123 Main Street
    IPTC City - Christchurch
    IPTC State/Province - Canterbury
    IPTC Country - New Zealand

    And the lookup file contains (for example)

    New Zealand,Canterbury,Christchurch,123 Main Street,-43.1234,170.1234

    Is this something that gpsPhoto might be able to do? (I assume it doesn't do this now)

    I think this would be a fantastic means of geocoding those images that we _don't_ have tracklogs for ;)

    Cheers Gavin

     
    • Uwe Girlich

      Uwe Girlich - 2007-09-19

      You could extract the tags with exiftool from the image.

      Then ask Geonames, GoogleMaps, Wikipedia, OpenStreetMap, or some other geo locator for the coordinates and then use
      gpsPhoto.pl --geotag-source=option --geotag latitude,longitude,altitude --image foobar.jpg
      to embed the just found coordinates into the image. If you intend to ask with the accuracy of house numbers, you should ask GoogleMaps.
      It should be possible to add the automatic geo locator into gpsPhoto. It would be a new option like
      --geotag-source=GoogleMaps

      I'm not sure about the legality because we'd bypass all Google Ads and GoogleMaps JavaScript API but use simple URLs like
      http://maps.google.com/maps?f=q&geocode=&q=New+Zealand,+Canterbury,+Christchurch,+123+Main+North+Rd
      I'm not yet sure how to get the real coordinates out of the reply to this or a similar URL but I'm very confident it could work but again, without the GoogleMaps API in JavaScript, the usage is highly disputable.

      BTW, it looks like there is no Main Street but only a Main North Road and a Main South Road in Christchurch.

       
    • Uwe Girlich

      Uwe Girlich - 2007-09-26

      I just found
      http://www.google.com/apis/maps/documentation/services.html#Geocoding_Direct
      which describes how to geocode anything using a valid Google Maps API key. I could easily add a command line parameter for your own key and put the geocoding into gpsPhoto. Obviously, I can't embed a valid key into gpsPhoto.pl. What do you think? Would it be worth the effort?

       

Log in to post a comment.