Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mark a GPS photo position on Google Earth

Status
Not open for further replies.

Trial4life

Programmer
Feb 2, 2014
2
0
0
IT
Hi,
I'm searching for a way to add to the context menu of .jpg files an option that launches Google Earth and marks the location of the photo on it, by reading the EXIF data stored inside the image file.

The script should be something like this:
− Read latitude and longitude stored in the EXIF data of the image clicked with the right click context menu
× If the image hasn't any GPS data, generates an error message box
+ If the image has GPS data, write a file (similar to the one posted below) with [LAT],[LONG] and [FILE NAME] of the clicked image file.
+ Save the file in "temp" Windows folder (so that it will be deleted automatically later) as a .kml file, named as the image file name
+ Open the .kml created file

When the kml file is opened, Google Earth will start automatically and will center the view on the GPS coordinates.

Here's the sample .kml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="[URL unfurl="true"]http://www.opengis.net/kml/2.2"[/URL] xmlns:gx="[URL unfurl="true"]http://www.google.com/kml/ext/2.2"[/URL] xmlns:kml="[URL unfurl="true"]http://www.opengis.net/kml/2.2"[/URL] xmlns:atom="[URL unfurl="true"]http://www.w3.org/2005/Atom">[/URL]
   <Placemark>	
      <name>  [FILE NAME]  </name>	
      <open> 1 </open>	
      <Point>		
         <coordinates>  [LAT],[LONG],0  </coordinates>	
      </Point>
   </Placemark>
</kml>

The problem is that I don't know much of VBS, so I don't know how to create a script like this. Anyway, is it possible? Do you have any suggestions?

Thanks in advice...
 
Hmmm... you would probably need Python, not VBS. Have a look at Phil Harvey's ExifTool. The documentation shows an example of how to extract GPS info (exiftool -ee -p '$gpslatitude, $gpslongitude, $gpstimestamp' a.m2ts) so it should be possible to re-direct the info to a file for parsing.

I note GeoSetter will let you export to Google Earth.

Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top