rename files adding city

Started by tallbear, April 15, 2017, 09:00:32 PM

Previous topic - Next topic

tallbear

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.



StarGeek

I know it's not quite the answer you're looking for, but on Windows, Geosetter 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, a java program.  No opinion here as I haven't used it.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

tallbear

#2
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


Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

tallbear