Geolocation not returning the "correct" location data

Started by ibex, April 16, 2024, 03:52:35 AM

Previous topic - Next topic

ibex

I'm a brand new user of Exiftool using ver 12.82 and installed it using the Oliver Betz installer.

Using this command is returning nearby, but not the actually correct location names.
 exiftool -s -geo* -api geolocation img_0001.jpg
on a file containing this GPS data
GPSLatitudeRef                  : South
GPSLatitude                     : 37 deg 45' 50.04"
GPSLongitudeRef                 : East
GPSLongitude                    : 145 deg 2' 31.94"
GPSAltitudeRef                  : Above Sea Level
GPSAltitude                     : 58.39662651 m


returns these location values:
GeolocationCity                 : Balwyn North
GeolocationRegion               : Victoria
GeolocationSubregion            : Boroondara
GeolocationCountryCode          : AU
GeolocationCountry              : Australia
GeolocationTimeZone             : Australia/Melbourne
GeolocationFeatureCode          : PPL
GeolocationPopulation           : 20000
GeolocationPosition             : -37.7909, 145.0937
GeolocationDistance             : 5.43 km
GeolocationBearing              : 118


From living in the area I know that the actual actual GeolocationSubregion should be Banyule and the GeolocationCity is Ivanhoe.
Is there something I'm doing wrong or is there anything I can do to get the real location? 
Maybe it's something to do with city size?  Boroondara has a larger population (167000) than Banyule (126000) and North Balwyn (21880) is larger than Ivanhoe (13800). 

StarGeek

Quote from: ibex on April 16, 2024, 03:52:35 AMIs there something I'm doing wrong or is there anything I can do to get the real location? 
Maybe it's something to do with city size?

You're not doing anything wrong and yes, it does have to do with city size.  This is an offline database and it doesn't have every city to reduce its size.

You might try one of the Alternate databases or add customized results to your exiftool config file.

There's also the optional parameters that you use to alter the results.  For example, add -api GeolocMaxDist=10 to reduce the search range to 10 kilometers.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ibex

Quote from: StarGeek on April 16, 2024, 10:30:12 AM
Quote from: ibex on April 16, 2024, 03:52:35 AMIs there something I'm doing wrong or is there anything I can do to get the real location? 
Maybe it's something to do with city size?

You're not doing anything wrong and yes, it does have to do with city size.  This is an offline database and it doesn't have every city to reduce its size.

You might try one of the Alternate databases or add customized results to your exiftool config file.

There's also the optional parameters that you use to alter the results.  For example, add -api GeolocMaxDist=10 to reduce the search range to 10 kilometers.

Thankyou for your reply.  I tried using GeolocMaxdist in steps down from 10,9 etc down to 6, which returned North Balwyn every time and at 5 the answer was "No suitable location..."

I read the section on the alternate databases and download the Geolocation500-1.02.zip file and copied Geolocation.dat and Geolang into the same directory as the Geolocation.pm module.

I used exiftool -api geolocation=ivanhoe -a and that returned 3 Ivanhoes, previously there were none.  Sadly none of them are my Ivanhoe, or the other Australian one.   My Ivanhoe definitely has more than 500 people in it, and there are other major Australian localities also missing.

Are there any other files to work with or is this the best there is?

Phil Harvey

#3
ExifTool contains all cities in the database down to a population of 2000, so population isn't the issue.  The source Geonames database is quite comprehensive, although we're still in the learning phase of how to make best use of it.

Here are all the Ivanhoe's in Australia in the source geonames database.

I think the Ivanhoe you want is listed as a "section of a populated place" (feature code PPLX), but unfortunately I haven't included these in the ExifTool database.  It looks like I should add these back in.  I'll do this in the next release.

Until then, here is a database that contains cities with population >= 500, including PPLX type.

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

ibex

Thankyou for the link to that site.  I wasn't aware of it.

Of those results #1,3,4,& 5 are the Ivanhoe I'm interested in. 

It's interesting that they are classified differently as sections of populated places and administrative divisions and I don't understand why there's two Ivanhoe's (#3 and #5).  Looking at the hierarchy it seems that #3 & #4 are both missing their adm2 entry for Banyule, but that's not your issue

I don't understand the difference between an Administrative Division and a Section of a Populated Place so I have some reading to do.

With just a quick look the major inconsistency I see in that database is that in Boroondara, Balwyn North is a Populated Place but all the other equivalent locations are Sections of Populated Places, and in Banyule it's the same with just one of them being a Populated Place.  That doesn't make any sense to me but again it's not your problem.

I guess I should be talking to GeoNames about how they put their hierarchy together.

ibex

Quote from: Phil Harvey on April 17, 2024, 07:33:03 AM...

Until then, here is a database that contains cities with population >= 500, including PPLX type.

- Phil

Thanks for that database file.  That's a huge improvement.

I've loaded it and now I'm getting the expected result.  I've also run several other Australian photos through and it is bringing up the correct location for all of them now.

I guess it all comes down to the definition of a location and how it's defined in the geonames database.


Phil Harvey

If you figure out the geonames divisions and you think they could be improved, you can create a geonames account and contribute to their database yourself.  If you do this, your changes will eventually trickle down to ExifTool.

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

ibex

Quote from: Phil Harvey on April 18, 2024, 07:41:51 AMIf you figure out the geonames divisions and you think they could be improved, you can create a geonames account and contribute to their database yourself.  If you do this, your changes will eventually trickle down to ExifTool.

- Phil

Thanks, I've been looking at their site and I've posted a question there about how to use/define the codes.