Latitude and Longitude
Latitude and Longitude
I have a digital camera with GPS that makes the latitude and longitude properties of the picture file. I want to be able to list the latitude and longitude in the folder directory and then be able to export the directory to either a CSV or Excel file. Can anyone tell if this is possible and if so how to do each step. Thank you from Cape_Ann
Re: Latitude and Longitude
Possible, but very slow...
The main problem: Somehow the properties "System.GPS.Latitude" & "System.GPS.Longitude" don't provide any values on my limited images with gps coordinates (which would make the whole process a hundred times faster)...
- Download Exiftool (http://www.sno.phy.queensu.ca/~phil/exi ... l-9.97.zip)
- Extract that .zip archive
- Rename exiftool(-k).exe to exiftool.exe
- Remember the path to it
XY side:
View - Colums - New Column
Right click the "New" column -> Configure Custom Columns...
Click on a free entry (e.g. the first with the name "(Undefined)"), click "Edit..."
Caption: GPS
Type: Script
Script content box:
Code:
Format: Text
Trigger: Browse
Item type: Files
You should use the filter as well. E.g.: jpg;tiff
Ofc you can enter additional extensions (separated by ;) as well (for all those formats that support exif params!)
Click "OK".
Regarding the script content box:
Replace the path to your exiftool.exe file with the one on your system
The entry should look like this now: GPS, Script (jpg;tiff)
Click "OK"
Now right click the "New" column again -> Select Custom Column...
Choose the newly created entry ("GPS"), click "OK".
Now whenever you want to export all rows, hit F12, choose the "Report" tab, then the "Current List" tab.
[x] Column headers
Subitem separator: Other = ,
Click on "To File..."
Done
The main problem: Somehow the properties "System.GPS.Latitude" & "System.GPS.Longitude" don't provide any values on my limited images with gps coordinates (which would make the whole process a hundred times faster)...
- Download Exiftool (http://www.sno.phy.queensu.ca/~phil/exi ... l-9.97.zip)
- Extract that .zip archive
- Rename exiftool(-k).exe to exiftool.exe
- Remember the path to it
XY side:
View - Colums - New Column
Right click the "New" column -> Configure Custom Columns...
Click on a free entry (e.g. the first with the name "(Undefined)"), click "Edit..."
Caption: GPS
Type: Script
Script content box:
Code:
Code: Select all
$exifTool = "D:\Tools\@Command Line Tools\exiftool\exiftool.exe";
$positions = runret("""$exifTool"" -gpslatitude -gpslongitude ""<cc_item>""");
$latitude = trim(gettoken(regexmatches($positions, "latitude.*\r?\n"), 2, ":"));
$longitude = trim(gettoken(regexmatches($positions, "longitude.*\r?\n"), 2, ":"));
if ($latitude && $longitude) { return replace($latitude . " | " . $longitude, "<crlf>"); }
Format: Text
Trigger: Browse
Item type: Files
You should use the filter as well. E.g.: jpg;tiff
Ofc you can enter additional extensions (separated by ;) as well (for all those formats that support exif params!)
Click "OK".
Regarding the script content box:
Replace the path to your exiftool.exe file with the one on your system
The entry should look like this now: GPS, Script (jpg;tiff)
Click "OK"
Now right click the "New" column again -> Select Custom Column...
Choose the newly created entry ("GPS"), click "OK".
Now whenever you want to export all rows, hit F12, choose the "Report" tab, then the "Current List" tab.
[x] Column headers
Subitem separator: Other = ,
Click on "To File..."
Done
One of my scripts helped you out? Please donate via Paypal
Re: Latitude and Longitude
Whether
Thank you,
I not confidant that I am up to the task that you have suggested
I did look at downloading Exiftool then learned that is should make sure that I had PERL installed.
Then my constant fear is that I will do more harm than good when I have learned just enough to be dangerous.
I have Windows 7 Professional and have noted that it depends which program I view the file properties with as to whether the latitude and longitude can be copied to the clipboard.
I have been able to manually do what I hoped to with the right program.
It was in search of a means to complete this task that have downloaded XYplorer.
Thank you again.
Thank you,
I not confidant that I am up to the task that you have suggested
I did look at downloading Exiftool then learned that is should make sure that I had PERL installed.
Then my constant fear is that I will do more harm than good when I have learned just enough to be dangerous.
I have Windows 7 Professional and have noted that it depends which program I view the file properties with as to whether the latitude and longitude can be copied to the clipboard.
I have been able to manually do what I hoped to with the right program.
It was in search of a means to complete this task that have downloaded XYplorer.
Thank you again.
Re: Latitude and Longitude
From the website:
There is no need for perl on a windows machine at all to be able to use the command line version of exiftool and the link I've posted downloads exactly this version...ExifTool is also available as a stand-alone Windows executable
One of my scripts helped you out? Please donate via Paypal
Re: Latitude and Longitude
I have found a program that do what I want.
It is BR's EXIFextracter
If you search you will find it.
It is BR's EXIFextracter
If you search you will find it.
-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Latitude and Longitude
Next beta (v15.30.0002) will have something that might help: a new undocumented (because still experimental) value for get() that will return the RAW EXIF data identified by the TagID.
For GPS related TagIDs see e.g.:
http://www.sno.phy.queensu.ca/~phil/exi ... s/GPS.html
Remember: And XY wants it in decimal, not hex.
And the return is RAW. These, for example, will both return the Exposure Time in a format that could look like "10/1250" meaning "1/125 Sec":
Code: Select all
get("exif", TagID, [file="<curitem>"])
http://www.sno.phy.queensu.ca/~phil/exi ... s/GPS.html
And the return is RAW. These, for example, will both return the Exposure Time in a format that could look like "10/1250" meaning "1/125 Sec":
Code: Select all
echo get("exif", 33434); //dec
Code: Select all
echo get("exif", 0x829A); //hex
FAQ | XY News RSS | XY Twitter
Re: Latitude and Longitude
Nice but there is a problem...
In ~70% of the cases it returns (which is valid):
52/1 13/1 85053/2500
But in ~30% it returns this instead:
8388609/1 1/100410288 24/0
Which leads to a /0 division xD
If you can't reproduce with a local image I send you the one I use...
Code: Select all
$file = "D:\Users\Highend\Bilder\_GPS EXIF.jpg";
$lat = get("exif", 0x0002, $file);
$latSec = format(eval(gettoken($lat, 3)), "0.00");
52/1 13/1 85053/2500
But in ~30% it returns this instead:
8388609/1 1/100410288 24/0
Which leads to a /0 division xD
If you can't reproduce with a local image I send you the one I use...
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Latitude and Longitude
The function just returns the raw data. It's your problem what to do with them.
FAQ | XY News RSS | XY Twitter
Re: Latitude and Longitude
It does but the return value is not always the same. That's the problem. And ofc the exif data hasn't changed once.The function just returns the raw data.
SureIt's your problem what to do with them.
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Latitude and Longitude
OH, you mean it returns different results on the same call??? Yes, send me the image, this sounds interesting...
FAQ | XY News RSS | XY Twitter
Re: Latitude and Longitude
Mail mit Screenshot, gezippter Grafik, script und Beschreibung ist raus.
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Latitude and Longitude
Thanks and Sorry. Works perfectly here. Hm.
FAQ | XY News RSS | XY Twitter
Re: Latitude and Longitude
I can reproduce it with a fresh beta (latest) as well. It doesn't happen so often (about 1/15-20) but it happens...
One of my scripts helped you out? Please donate via Paypal
Re: Latitude and Longitude
I can confirm, that what highend reported happens really frequently. There is no need a special picture, just locate a jpg which contains GPS info then run the command
echo get("exif", 0x0002);
repeatedly and you will see. Unfortunately it happens much more than 30% which makes the GPS handling in XY impossible. Isn't it possible that the problem is with an internal variable which somehow overflows?-
- Site Admin
- Posts: 60595
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Latitude and Longitude
But this is still true: viewtopic.php?p=125412#p125412
FAQ | XY News RSS | XY Twitter