michaeldorman / mapsapi

'sf'-Compatible Interface to Google Maps APIs
Other
50 stars 14 forks source link

Google API rejected #8

Closed ameyenn closed 4 years ago

ameyenn commented 4 years ago

Michael,

Your package looks great and solves a simple issue I don't see in others ie plot a single city.

I get ACCESS DENIED - see code, rStudio. I assume this is a Google issue but wonder if you have and pearls.

library(mapsapi) key="this is a valid key from Google" doc = mp_geocode(

  • addresses = "Tel-Aviv",
  • key = key
  • ) Tel-Aviv................................REQUEST_DENIED

Kindest Regards Dr Andrew Meyenn (Melbourne, Australia)

michaeldorman commented 4 years ago

Hi Andrew,

Thanks, I checked now and for me mp_geocode is working:

Screenshot from 2020-05-12 12-52-19

Perhaps the key is incorrect? You can print the XML response (doc) to check if that's the reason:

Screenshot from 2020-05-12 12-58-45

ameyenn commented 4 years ago

Dear Michael,

Thanks for the suggestion it helped me track the problem.

I thought I had enabled the Google Apps Geocoding API but when I tried it again all was good (see https://time.ly/resources/troubleshooting/google-maps-api-error-geocoding-service-this-api-project-is-not-authorized-to-use-this-api/ https://console.cloud.google.com/apis/dashboar https://console.cloud.google.com/apis/dashboard?d Click on “ENABLE APIS AND SERVICES” Search for ‘Geocoding API’ - it is this step that worked to find the exact Geocoding API! Click on the Enable button

Blessed Google - but when you think about the moving parts between R-packages-your package-google it is in some respect remarkable it all works! I am retired but still manage to keep lecturing in a couple of subjects and enjoy fiddling with R, so I will make good use of your efforts.

Kindest regards Andrew Meyenn

On Tue, May 12, 2020 at 7:59 PM Michael Dorman notifications@github.com wrote:

Hi Andrew,

Thanks, I checked now and for me mp_geocode is working:

[image: Screenshot from 2020-05-12 12-52-19] https://user-images.githubusercontent.com/9386655/81670127-d5e36c00-944f-11ea-8539-e615de2915b7.png

Perhaps the key is incorrect? You can print the XML response (doc) to check if that's the reason:

[image: Screenshot from 2020-05-12 12-58-45] https://user-images.githubusercontent.com/9386655/81670473-5904c200-9450-11ea-9745-9061306cd49d.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/michaeldorman/mapsapi/issues/8#issuecomment-627240676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2VHBJUMERUHW7ODMY5OPDRREMZFANCNFSM4M6TPMZA .

-- Dr Andrew Meyenn

michaeldorman commented 4 years ago

Dear Andrew,

Glad to hear that the problem is solved! You are right, the services you use need to be enabled in the Google Cloud console, I forgot about that additional moving part :-)

Best regards,

Michael