ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: tallbear on April 15, 2017, 09:00:32 PM

Title: rename files adding city
Post by: tallbear on April 15, 2017, 09:00:32 PM
suspecting that city is not part of any of the exif metadata of an iPhone (iPhone 6 IOS 10.0.2) photo but knowing that longitude and latitude are, does anyone have a simple way to use exiftool and other linux or OSX command line tools to based on longitude and latitude determine and add the city name where the photo was shot to the file name?

Thanks in advance for a somewhat newby question.


Title: Re: rename files adding city
Post by: StarGeek on April 15, 2017, 10:14:50 PM
I know it's not quite the answer you're looking for, but on Windows, Geosetter (http://www.geosetter.de/en/) is very good for setting location metadata.  It also uses exiftool to write the metadata.  If you can't find an alternative, you might look into setting Wine to run Windows programs.

A quick google also pulls up Geotag (http://geotag.sourceforge.net/), a java program.  No opinion here as I haven't used it.
Title: Re: rename files adding city
Post by: tallbear on April 15, 2017, 11:25:41 PM
yep a simple curl away from getting the city name seems like an obvious feature for exiftool, right?  I guess I will do a quick bash foo and be done with it.

curl https://maps.googleapis.com/maps/api/geocode/json?latlng=32.2747777777778,-110.760077777778 | grep -i "formatted_address"

http://stackoverflow.com/questions/32875276/reverse-geocoding-in-bash-using-gps-position-from-exiftool

Title: Re: rename files adding city
Post by: Phil Harvey on April 16, 2017, 10:17:06 AM
Quote from: tallbear on April 15, 2017, 11:25:41 PM
yep a simple curl away from getting the city name seems like an obvious feature for exiftool, right?

It would, if curl was available on all supported systems.  I guess I could do the network connection part in Perl, but I dread adding a Google dependency to ExifTool because they way they change things at Google it would probably break every few years or so.  (ExifTool GUI has a Google problem like this.)

- Phil
Title: Re: rename files adding city
Post by: tallbear on April 16, 2017, 05:06:41 PM
bing has an api also...