ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Tom Cunningham on February 19, 2016, 11:41:11 PM

Title: Script to update altitude based on longitude, latitude
Post by: Tom Cunningham on February 19, 2016, 11:41:11 PM
Is there an exiftool script that will update the altitude info for a photo based on the existing longitude and latitude?  I'm assuming this would involve a lookup into USGS or NASA elevation databases.
Title: Re: Script to update altitude based on longitude, latitude
Post by: StarGeek on February 20, 2016, 01:33:03 AM
If you're on Windows, Geosetter (http://www.geosetter.de/en/) will do this and uses ExifTool to set the data.  Image showing setting screen below.

I'm not sure if someone has made a script to do this or not.


(http://imgur.com/9VLJAOL.jpg)
Title: Re: Script to update altitude based on longitude, latitude
Post by: yarda on February 23, 2016, 06:22:24 PM
This is an interesting topic.

Some time ago, I was playing with https://developers.google.com/maps/documentation/elevation/intro?csw=1

example:

https://maps.googleapis.com/maps/api/elevation/xml?locations=50.5070607777777809133112896,14.5291835000000002509068509

... its result can be downloaded by wget for example

<?xml version="1.0" encoding="UTF-8"?>
<ElevationResponse>
<status>OK</status>
<result>
  <location>
   <lat>50.5070608</lat>
   <lng>14.5291835</lng>
  </location>
  <elevation>434.4410706</elevation>
  <resolution>152.7032318</resolution>
</result>
</ElevationResponse>

Soo, having an XML... :)

Title: Re: Script to update altitude based on longitude, latitude
Post by: StarGeek on February 23, 2016, 08:10:23 PM
Interesting, though it returns a completely different number than what Geosetter had
<?xml version="1.0" encoding="UTF-8"?>
<ElevationResponse>
<status>OK</status>
<result>
  <location>
   <lat>36.1098397</lat>
   <lng>-115.1532680</lng>
  </location>
  <elevation>625.2572632</elevation>
  <resolution>9.5439520</resolution>
</result>
</ElevationResponse>


I wonder which is correct...

Ah, Google is probably returning meters, though there still is a small difference.  Google returns 635.237, which is about 2,051.37 feet.  About 35' difference.

Still, good source if someone wanted to script something up. 
Title: Re: Script to update altitude based on longitude, latitude
Post by: mikelee33 on August 03, 2017, 05:29:53 PM
Since this post has been read nearly 500 times, I think it still draws enough attention to suggest Geotag from SourceForge (http://geotag.sourceforge.net).  Batch processing for just such information.  Simple to use, free, and multi-platform (Java-based).  It even uses ExifTool to write info to files!

PH Edit: Added link