Reverse Geo Warning but API key is valid and reverse Geo completes successfully

Started by Jingo, October 16, 2024, 11:51:16 PM

Previous topic - Next topic

Jingo


Hi Mario - ran into an oddity today. 

I was checking the going through and updating file locations/reverse geocoding as I usually do and after a rather "hearty" session, I ran into an issue where the preview window was just stuck on the "loading.." prompt.  So, I checked my log to see if I could make heads/tails why the preview wasn't working when I noticed this warning for a group reverse geo:

0.16 17:40:04+   16 [2B8C] 10  M> >  0 PTMetabase::GetGPSCoordinates  'V:\develop\IMatch5\src\IMEngine\PTMetabase2.cpp(2829)'
10.16 17:40:04+    0 [2B8C] 10  M>  <  0 PTMetabase::GetGPSCoordinates
10.16 17:40:04+    0 [2B8C] 50  M>  <  0 [16ms] CIMatchWebServices::HandlerGET_Files
10.16 17:40:04+    0 [35D0] 50  M> >  0 CIMatchWebServices::HandlerGET_Files  'V:\develop\IMatch5\src\imws\IMatchWebServices.cpp(9388)'
10.16 17:40:04+    0 [35D0] 10  M> >  0 PTMetabase::GetGPSCoordinates  'V:\develop\IMatch5\src\IMEngine\PTMetabase2.cpp(2829)'
10.16 17:40:04+    0 [35D0] 10  M>  <  0 PTMetabase::GetGPSCoordinates
10.16 17:40:04+    0 [35D0] 50  M>  <  0 CIMatchWebServices::HandlerGET_Files
10.16 17:40:04+  453 [11D0] 10  M> >  0 CDlgGeocodeFile::Lookup  'V:\develop\IMatch5\src\IMatchNG\DlgGeocodeFile.cpp(873)'
10.16 17:40:04+    0 [11D0] 10  M> >  0 PTGeoCoderGoogle::ReverseGeocodeLatLng  'V:\develop\IMatch5\src\ptgeo\PTGeoCoder.cpp(761)'
10.16 17:40:04+    0 [11D0] 10  M> >  0 PTWGet::Get  'V:\develop\IMatch5\src\ptgeo\PTWGet.cpp(170)'
10.16 17:40:04+    0 [11D0] 10  M> >  0 PTWGet::RetrieveFromNet  'V:\develop\IMatch5\src\ptgeo\PTWGet.cpp(601)'
10.16 17:40:04+  203 [11D0] 10  M>  <  0 [203ms] PTWGet::RetrieveFromNet
10.16 17:40:04+    0 [11D0] 10  M>  <  0 [203ms] PTWGet::Get
10.16 17:40:04+    0 [11D0] 10  M> >  0 PTGeoCoderGoogle::ParseJSON  'V:\develop\IMatch5\src\ptgeo\PTGeoCoder.cpp(1038)'
10.16 17:40:04+    0 [11D0] 10  M>  <  0 PTGeoCoderGoogle::ParseJSON
10.16 17:40:04+    0 [11D0] 10  M> >  0 PTWGet::Get  'V:\develop\IMatch5\src\ptgeo\PTWGet.cpp(170)'
10.16 17:40:04+   16 [11D0] 10  M> >  0 PTWGet::RetrieveFromNet  'V:\develop\IMatch5\src\ptgeo\PTWGet.cpp(601)'
10.16 17:40:04+   15 [11D0] 10  M>  <  0 [15ms] PTWGet::RetrieveFromNet
10.16 17:40:04+    0 [11D0] 10  M>  <  0 [31ms] PTWGet::Get
10.16 17:40:04+   16 [11D0] 10  M> >  0 PTGeoCoderGoogle::ParseJSONElevation  'V:\develop\IMatch5\src\ptgeo\PTGeoCoder.cpp(1175)'
10.16 17:40:04+    0 [11D0] 01  W> Error parsing: '{
   "error_message" : "This API key is not authorized to use this service or API.",
   "results" : [],
   "status" : "REQUEST_DENIED"
}'  'V:\develop\IMatch5\src\ptgeo\PTGeoCoder.cpp(1290)'
10.16 17:40:04+    0 [11D0] 10  I> Google::ParseJSONElevation failed.
10.16 17:40:04+    0 [11D0] 10  M>  <  0 PTGeoCoderGoogle::ParseJSONElevation
10.16 17:40:04+    0 [11D0] 10  M>  <  0 [250ms] PTGeoCoderGoogle::ReverseGeocodeLatLng
10.16 17:40:04+    0 [11D0] 02  I> RevGeoCode: File: 'F:\Family_Photos\2023\2023-02\S22_Ultra_20230211_131020.jpg' - source: 0, lat: 41.4828 lon: -71.30827 / destlat: 0.0000 destlon: 0.00000 - Result: 1, records: 12.

All the files that I reversed geotagged were correctly filed.. and I know my API keys for Google and Here are valid because the map is functioning 100% and geonames username is also correct.  I do have a custom MAP application I use with some add'l functionality but this warning also appears when applying coords in the standard application (of course the reverse geo function is standard metadata routine stuff so wouldn't matter anyway).

Things seem to be working fine with the reverse geo process except for the warning... any thoughts on where I can look?  Full log attached as well.

By the way - the preview loading resolved itself after a few minutes so perhaps the software was just busy doing something.. but I guess it did lead me to this.. so, all good!

Thx as always... Andy.

Mario

The


"error_message" : "This API key is not authorized to use this service or API.",
"status" : "REQUEST_DENIED"

is what the server has returned when IMatch made a request.
You've used Google and IMatch has two make two requests to get all the required information. Apparently, the elevation request is not making it and is denied.

I've made a quick check and it works here just fine. Elevation/Altitude data is delivered by Google, no access denied errors.
Maybe create a new API key. Sometimes Google API keys break since Google is changed stuff internally all the time.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Thanks Mario... your insight led me to the problem.  Looks like I was using a restricted API key and didn't have the MAPS ELEVATION API enabled... I've probably had this warning in the log for many moons and never realized it... looking at some of my images, the GPS Altitude is indeed missing from as far back as a year ago. 

I added the API to the existing key and now the Altitude is included in the reverse geo data and no warning in the log.

THANKS!!    ;D

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook