Getting started with geolocation

Started by dwlott, May 26, 2024, 05:48:48 PM

Previous topic - Next topic

dwlott

Please help me get geolocation working. I'm using geolocation.html for documentation.
My test file has good GPSLatitude and GPSLongitude. I want to test the first example illustrated in geolocation.html.

Trying an args file:
#args file
-api
geolocation
"-geolocation*"
E:\test.jpg

Exiftool replies with all the tags in the test file, but not the Geolocation City, Region etc as shown in the example.

Strait from the command line.
exiftool -api geolocation "-geolocation*" test.jpg
No reply from exiftool using the this command.

StarGeek

"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

dwlott

Thank you Stargeek for the faq referance.  I adjusted the args file code, but see no output from exiftool when using this args file.

#
 MetaToolExcel command
-api
geolocation
-geolocation*
E:\exiftool\test.jpg

StarGeek

Are you using an up to date exiftool?  Also, don't separate the hashtag from the comment text.

C:\>exiftool -ver
12.85

C:\>type temp.txt
# args file
-api
geolocation
-geolocation*
y:\!temp\Test4.jpg

C:\>exiftool -G1 -a -s -@ temp.txt
[ExifTool]      GeolocationCity                 : Financial District
[ExifTool]      GeolocationRegion               : New York
[ExifTool]      GeolocationSubregion            : New York County
[ExifTool]      GeolocationCountryCode          : US
[ExifTool]      GeolocationCountry              : United States
[ExifTool]      GeolocationTimeZone             : America/New_York
[ExifTool]      GeolocationFeatureCode          : PPLX
[ExifTool]      GeolocationFeatureType          : Section Of Populated Place
[ExifTool]      GeolocationPopulation           : 61000
[ExifTool]      GeolocationPosition             : 40.7080, -74.0087
[ExifTool]      GeolocationDistance             : 3.66 km
[ExifTool]      GeolocationBearing              : 62
"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

dwlott

Quote from: StarGeek on May 26, 2024, 07:54:20 PMAre you using an up to date exiftool?
The update helped and now I see the expected output.

I'm wondering if there is a command to have exiftool go ahead and write the output to the appropriate location tags.  Using the files GPS info to lookup and write the location tags would save much work.



StarGeek

Writing Geolocation Tags while Geotagging
QuoteGeolocation city, state/province and country tags may be written automatically based on the geotagged GPS position by setting the Geolocate tag to "geotag".
"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

Phil Harvey

#6
The -geolocate=geotag feature is used if you are geotagging from a GPS track log.  If the file already contains GPS, probably you should use "-geolocate<gpsposition"

- Phil

Edit: Fixed incorrect tag name
...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 ($).

StarGeek

Quote from: Phil Harvey on May 27, 2024, 01:14:31 PMThe -geolocation=geotag feature is used if you are geotagging from a GPS track log.  If the file already contains GPS, probably you should use "-geolocation<gpsposition"

Ah, good to know **takes notes**
"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

Phil Harvey

Oops.  Typo at my end.  The tag is called Geolocate.  "Geolocation" is the API option.  I've made that mistake a few times.  I'll fix my previous post.

- 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 ($).

dwlott

Quote from: Phil Harvey on May 27, 2024, 01:14:31 PM"-geolocate<gpsposition"
The -geolocate feature is a dream come true for auto generation of location content.
Thank you Phil.

dwlott

Please help with writing to specific groups with Geolocate.
I am referencing this example in the Geolocate html document:
exiftool -xmp:iptc:geolocate="paris,fr" test.jpg
This args file writes the location tags with no errors:
-IPTC:geolocate<gpsposition
E:\mySourceFolder\gps clean\IMG_20161228_120612.jpg
-o
e:\myTargetFolder\%f.%e

Using this command, ExifTool returns the error
Quote" Warning: Sorry, xmp:ipctext:Geolocate doesn't exist or isn't writable".

-XMP:ipctExt:geolocate<gpsposition
E:\mySourceFolder\gps clean\IMG_20161228_120612.jpg
-o
e:\myTargetFolder\%f.%e

StarGeek

I think what you want is
-XMP-iptcExt:geolocate<GPSPosition
"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

dwlott

Quote from: StarGeek on June 07, 2024, 11:38:01 AMI think what you want is
-XMP-iptcExt:geolocate<GPSPosition

I tried:
-XMP-ipctExt:geolocate<gpsposition
E:\mySourceFolder\gps clean\20230915_191829.jpg
-o
e:\myTargetFolder\%f.%e
QuoteExiftool: Warning: Sorry, xmp-ipctext:Geolocate doesn't exist or isn't writable

dwlott

Please help also with using a config file to access the larger Geolocate database.
I want to use a variable in place of the path to ExifTool.
I am using this config file line in the html documentation for reference:
$Image::ExifTool::Geolocation::geoDir = '/PATH/TO/Geolocation500';
I am hoping to replace '/PATH/TO/ with a variable name.  I'm also unsure of the slash \/ to use for windows. 

The Windows 10 path will be the exiftool_files path created by the Betz install:
QuoteE:\exiftool\exiftool_files\Geolocation500

To illustrate, here is an incorrect config file line. 
$Image::ExifTool::Geolocation::geoDir = @PathToExifTool & '\exiftool_files\Geolocation500';



StarGeek

Quote from: dwlott on June 07, 2024, 11:44:05 AM
Quote from: StarGeek on June 07, 2024, 11:38:01 AMI think what you want is
-XMP-iptcExt:geolocate<GPSPosition

I tried:
-XMP-ipctExt:geolocate<gpsposition

It's -XMP-iptcExt, not -XMP-ipctExt
"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