dkahle / ggmap

A package for plotting maps in R with ggplot2
769 stars 231 forks source link

get_map ignores the source argument #51

Closed grialex closed 9 years ago

grialex commented 9 years ago

I am trying to grab a map like this:

get_map(location = c(6.815375, 51.217942), zoom = 11, source = "osm")

Following error occures:

Error in download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") : can't open URL 'http://maps.googleapis.com/maps/api/staticmap?center=51.217942,6.815375&zoom=11&size=%20640x640&maptype=terrain&sensor=false'

And an additional warning:

W In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") : cannot open: HTTP status was '403 Forbidden'

Why does ggmap query google, although source is set to "osm" ? And why is the status 403 forbidden?

kambanane commented 6 years ago

Here is what I get.

I have a manager who is getting angry that I can't get her today what worked just two weeks ago.

eth_basemap <- ggmap::get_map(location="Chicago", zoom=11) Source : https://maps.googleapis.com/maps/api/staticmap?center=Chicago&zoom=11&size=640x640&scale=2&maptype=terrain&language=en-EN Error in get_googlemap(center = location, zoom = zoom, maptype = maptype, : Forbidden (HTTP 403).

I ran this:

devtools::install_github("dkahle/ggmap", ref = "tidyup")

Restarted R. Nothing. The error simply looks a little different now.

dkahle commented 6 years ago

You probably need to enable billing. Details can be found above. Oh, looks like you need to register an API key as well. Links here: https://developers.google.com/maps/documentation/maps-static/get-api-key https://developers.google.com/maps/documentation/maps-static/usage-and-billing

alis486 commented 6 years ago

This has seemed to work. However I am now having an error knitting to a word document

Error in get-googlemap(centre = location, zoom = zoom, maptype = maptype, : Forbidden (Http 403). get_googlemap -> stop_for_status

dvorw commented 6 years ago

Hello, another useful summary - I had not enabled the API key; now done.

Summary: I have registered and enabled billing, linked the Map API to the project, enabled the API key in Google Cloud Platform, and followed all instructions in R with ggmap and register_google (copying the key from the platform to avoid errors).

I am running the R script on my desktop PC. I even logged into my Google account associated with the (its a G-Suite account) to be certain (because I have other gmail accounts too)

and I still get the 403 Forbidden Error when running from R.

What else could it possibly be? Wondering if anyone else who has completed all the steps also still has problems?

Dvoralai

On 11 Oct 2018, at 10.44, david kahle notifications@github.com wrote:

You probably need to enable billing. Details can be found above. Oh, looks like you need to register an API key as well. Links here: https://developers.google.com/maps/documentation/maps-static/get-api-key https://developers.google.com/maps/documentation/maps-static/usage-and-billing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

kambanane commented 6 years ago

Ugh, this is incredibly frustrating. Like the above poster, I cannot get this to work.

I enabled billing and got a key, have successfully registered the key using register_google()

Tried my code and get this:

eth_basemap <- ggmap::get_map(location="Chicago", zoom=11, source="osm") Source : https://maps.googleapis.com/maps/api/staticmap?center=Chicago&zoom=11&size=640x640&scale=2&maptype=terrain&key=XXXX Source : https://maps.googleapis.com/maps/api/geocode/json?address=Chicago&key=XXXX Error in data.frame(ll.lat = ll[1], ll.lon = ll[2], ur.lat = ur[1], ur.lon = ur[2]) : arguments imply differing number of rows: 0, 1 In addition: Warning message: geocode failed with status REQUEST_DENIED, location = "Chicago"

dkahle commented 6 years ago

Sorry for the frustrations; I'm working to resolve the issues. Do know that source="osm" will not work, see #117.

kambanane commented 6 years ago

Thanks. With or without source="osm" it does not work:

eth_basemap <- ggmap::get_map(location="Chicago", zoom=11) Source : https://maps.googleapis.com/maps/api/staticmap?center=Chicago&zoom=11&size=640x640&scale=2&maptype=terrain&language=en-EN&key=XXXX Source : https://maps.googleapis.com/maps/api/geocode/json?address=Chicago&key=XXXX Error in data.frame(ll.lat = ll[1], ll.lon = ll[2], ur.lat = ur[1], ur.lon = ur[2]) : arguments imply differing number of rows: 0, 1 In addition: Warning message: geocode failed with status REQUEST_DENIED, location = "Chicago"

dkahle commented 6 years ago

Hm. Works for me. Try enabling the Geocoding API in the Google Cloud Platform manager?

kambanane commented 6 years ago

Oh praise Cthulhu. It worked.

Thank you so much.

arne1921KF commented 6 years ago

FTR, you need to provide a credit card to enable billing in Google Cloud Platform. Also, as per the services terms, the free trial period ends either after 12 months or after reaching your credit level of 300$.

From the Supplemental TOS: 1.3 The Free Trial starts when Customer creates a billing account in the Google Cloud Console (“Free Trial Start Date”) and ends on the earlier of (i) the date that Customer’s fees for usage exceeds $300 or (ii) 12 months from the Free Trial Start Date.,

Bottom line: those without a credit card, like me, are apparently now excluded from using Google Maps within R.

kambanane commented 6 years ago

" Bottom line: those without a credit card, like me, are apparently now excluded from using Google Maps within R."

Yes, which excludes most people in developing countries now.

Moreover, some of us are using the Google API for work, now we are scrambling around trying to convince our employers to pay for it, because most of us don't want to use our personal credit cards to do work on behalf of someone else.

This is a poorly reasoned change.

On Fri, Oct 12, 2018 at 3:30 AM arne1921KF notifications@github.com wrote:

FTR, you need to provide a credit card to enable billing in Google Cloud Platform. Also, as per the services terms, the free trial period ends either after 12 months or after reaching your credit level of 300$.

From the Supplemental TOS https://cloud.google.com/terms/free-trial/: 1.3 The Free Trial starts when Customer creates a billing account in the Google Cloud Console (“Free Trial Start Date”) and ends on the earlier of (i) the date that Customer’s fees for usage exceeds $300 or (ii) 12 months from the Free Trial Start Date.,

Bottom line: those without a credit card, like me, are apparently now excluded from using Google Maps within R.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dkahle/ggmap/issues/51#issuecomment-429232195, or mute the thread https://github.com/notifications/unsubscribe-auth/AmlxNgi-PrMdaAX-2d-LWUfYZ6aAurdRks5ukET5gaJpZM4De03P .

dkahle commented 6 years ago

@arne1921KF, @kambanane – I'm sorry for the frustration. To be clear: this was not a change in ggmap, but Google's web API. ggmap simply facilitates the connection between R and various Google services; it has no control over either.

dvorw commented 6 years ago

There’s something I’m not clear on - does access to download maps from OSM or Bing from R using packages such as ggmap and Rgooglemaps also require using Google’s API?

Sent from my iPhone

On 13 Oct 2018, at 12.53, david kahle notifications@github.com wrote:

@arne1921KF, @kambanane – I'm sorry for the frustration. To be clear: this was not a change in ggmap, but Google's web API. ggmap simply facilitates the connection between R and various Google services; it has no control over either.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

arne1921KF commented 6 years ago

@dkahle, no worries, it has been clear from the beginning that this decision isn't yours, and you have no say in this. I just commented for clarification, since I think many users of ggmap will hit the same paywall, eventually.

Pwrsonally, I only found out that a CC is needed after I created a project on the service to register the API. I wanted to spare others the same.

grafau commented 6 years ago

Hi!

So, I have done all of the above: enabled billing, static map api, geocoding api, got key, installed ggmap from 'tidy' branch. I load library:

library(ggmap) Loading required package: ggplot2 Google Maps API Terms of Service: http://developers.google.com/maps/terms. Please cite ggmap if you use it: see citation('ggmap') for details. Warning message: package ‘ggplot2’ was built under R version 3.4.2

Now that is the kicker: whenever I try to register_google, I get following: register_google(key)

Error in register_google(key) : could not find function "register_google"

And of course, when trying to get_map:

I get:

HTTP status was '403 Forbidden'

Any ideas? Many thanks!

Rafal

dkahle commented 6 years ago

@grafau : If register_google() isn't found, sounds like the install from GitHub didn't work. Or, it could be that it did, but you didn't restart R and reload the newer ggmap. I would just run by that again and make sure things are going as you expect. (And maybe update ggplot2?)

dvorw commented 6 years ago

Hello

i still have no success fetching google maps from R. I even enabled several possibly relevant APIs (Geolocation, Maps Embed, Maps Static) in case I did not have the right one available.

In R I get : Error in download.file and Cannot Open URL when connected via WiFi

When I use an Ethernet LAN connection I get the ‘403 Forbidden’ error message

On the Google APIs console the only API shown with requests is Maps Static API 5 Requests 3 Errors

The # requests are not necessarily incrementing with calls from R...

And there are no data available under Details for the API

Dvoralai

Sent from my iPhone

On 15 Oct 2018, at 18.02, david kahle notifications@github.com wrote:

If register_google() isn't found, sounds like the install from GitHub didn't work. Or, it could be that it did, but you didn't restart R and reload the newer ggmap. I would just run by that again and make sure things are going as you expect. (And maybe update ggplot2?)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

simonberrebi commented 6 years ago

Hey all,

This is a really cool tool, thanks to everyone who contributed! However, I'm having the same issue. I added my credit card info and register_google'ed. When I tried to get_map, I got the following error message:

Source : https://maps.googleapis.com/maps/api/staticmap?center=Europe&zoom=4&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx* Error in get_googlemap(center = location, zoom = zoom, maptype = maptype, : Forbidden (HTTP 403).

Then I enabled APIs through Google API's library (Places API, MAP Static API, and Roads API). It still doesn't work but I get a different message with no 403 (see below). Could the issue be that were missing some APIs? If so, which ones should be enabled?

Source : https://maps.googleapis.com/maps/api/staticmap?center=42.14,-88.68&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx* 1280x1280 terrain map image from Google Maps. see ?ggmap to plot it.

petersoapes commented 6 years ago

Hi all Following some of the suggestions on this chain I was able to get ggmap working again on my laptop (yay!). this is what I ran if(!requireNamespace("devtools"))install.packages("devtools") devtools::install_github("dkahle/ggmap", ref = "tidyup") then I linked my billing enabled API key with register_google(), and it worked.

When I've tried to replicate this on my work computer, I can't get ggmaps to load. I get the following error when trying to run the dev::tools_install_github()

Loading required package: ggplot2 Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘stringi’ 1.1.2 is being loaded, but >= 1.1.6 is required Error: package or namespace load failed for ‘ggmap’

dkahle commented 6 years ago

Hi @petersoapes – looks like you need to update stringi:

install.packages("stringi")

Give that a shot and retry.

petersoapes commented 6 years ago

Thanks, that worked. The second time I installed "stringi" and then did the rest of the steps, it worked. I think I may have not been resatrting my R session correctly.

g-mann commented 6 years ago

Super appreciative of all the help posted here (particularly @dkahle and @RomanAbashin)...THANKS!!!

I was having similar problems with a recurring 403 problem when trying to use get_map with source="google". I had installed the dkahle/ggmap from the tidyup branch and got the API key/billing sorted out with google. However, despite having enable both the Geocoding and Maps Static APIs, only the former was working (i.e., I was getting the "Waco, Texas" coordinates, but couldn't get a map). I noticed on the Google dashboard that the Geocoding API was getting some traffic (every time I tried it), but that the Maps Static API wasn't showing anything. I eventually regenerated the API key and it all worked. Just thought this might help someone else.

sarahkaunitz commented 5 years ago

Hi @dkahle You seem very knowledgeable about retrieving and making all these google maps. I am trying to get a map in R and am getting this error.

sfmap <- qmap("San Francisco", zoom = 12, type = "roadmap")

cannot open URL 'http://maps.googleapis.com/maps/api/staticmap?center=San+Francisco&zoom=12&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false': HTTP status was '403 Forbidden'Error in download.file(url, destfile = tmp, quiet = !messaging, mode = "wb") : cannot open URL 'http://maps.googleapis.com/maps/api/staticmap?center=San+Francisco&zoom=12&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false'

Do you think you could help me figure out what I need to do for it to work? Thanks in advance!

dkahle commented 5 years ago

Hi @sarahkaunitz –

After re-installing the dev version of ggmap (see above), and going on Google Cloud's manager and enabling the Maps Static and Geocoding APIs along with billing, try:

sfmap <- get_googlemap("san francisco", zoom = 12, type = "roadmap")
ggmap(sfmap)
sabahzero commented 5 years ago

Hi all, I am trying everything for hours and nothing has worked, halp! I have my Google API code and it shows as registered in R

I first tried devtools::install_github("hadley/ggplot2") devtools::install_github("dkahle/ggmap")

I then tried the suggested example if(!requireNamespace("devtools")) install.packages("devtools") devtools::install_github("dkahle/ggmap", ref = "tidyup") ggmap(get_googlemap()) register_google(key = "keyhere") geocode("waco texas")

Again and again and again the error keeps coming up as "Error in get_googlemap() : Forbidden (HTTP 403)" I've looked up how to get around this without luck.

All I want to do is plot lat and lon points corresponding to my dataset to a map in R If it helps, here's a previous example code that was working in May but isn't anymore (because of the API, I suppose?): https://github.com/sabahzero/MicrobialEcology_AmpliconSeqWorkflow_UlHasanetal/tree/master/v1_May15-2018

Very very many thanks in advance 🙏

ryansfuller commented 5 years ago

Hello everyone. I just wanted to give the problem I had and what I did to solve it for any newcomers to this ever growing feed. For me, I was getting the 'Forbidden (HTTP 403) error that many were having in an old code I used for a manuscript. I followed the solutions found in this comment overflow but more closely to @RomanAbashin's (Sept 30th) (Link here: https://github.com/dkahle/ggmap/issues/51#issuecomment-425719270) nicely detailed summary comment as follows: Note: It's imperative to do these in the proper steps -- I think that is why some are having issues with individual steps despite doing all that has been suggested! For me, it worked the first time.

Google Cloud Console (before doing anything in R): 1) First I registered an API key within the Google Cloud console following the link provided from @RomanAbashin -- I did not restrict the API key as suggested by Google (does anyone have any advice on this moving forward? I'd like to make it as secure as possible -- but still have it usable). I also made sure billing was turned on as suggested in many other posts -- it's free unless you are using it to pull large quantities of maps, but they want a credit card to 'make sure you aren't a robot'. 2) You will need to create a new project 3) Next, search for and enable the 'Geocoding API' and the 'Maps Static API' From your Google Cloud Page Click 'APIs and Services' >> Library >> (To Filter: look in the left hand column under Category and scroll down to 'Maps' -- Click it >> Geocoding API should be in the first row (Enable It). (Repeat for 'Maps Static API', which is in the 3rd row) 4) From the 'Credentials' menu you can Copy your API key to the clipboard.

Onward to R! 1) I reinstalled ggmap using @dkahle code here: (Link: https://github.com/dkahle/ggmap/issues/51#issuecomment-425465021) : devtools::install_github("dkahle/ggmap", ref = "tidyup") 2) I rebooted R 3) Loaded ggmap library (copy-paste API from Google Cloud Console): library(ggmap) register_google(key = 'copy-API-key-from-GoogleConsole') 4) Run my code again. It works!

@sabahzero have you had any luck over the last few days? From your code linked above on your github: # Create zoomed-in map (main figure) Zoom=get_map(location=c(-116.9685,32.22644,-116.9241,32.26755), maptype="roadmap") Sidenote: I didn't change my command for 'get_map()' as suggested in some other posts and it still works for me. I think if you can do all that is required for the API steps and register it, reinstall ggmap with the above command, reboot R, load ggmap, register your API key, and rerun your code you should have success!

Try following my steps listed above or visit @RomanAbashin's comment that I linked to. He has a link to Google's page with info about properly setting up your API with billing and all.

After writing this, I dug through the comments more and I see much of this is also summarized here: (https://github.com/dkahle/ggmap/issues/51#issuecomment-428947722).

Thanks much to @dkahle & @RomanAbashin! Plus many others who have been troubleshooting! You made this one easy for me to fix with manuscript reviews due in a couple of days!

dvorw commented 5 years ago

Dear all

Another good summary, thank you.

One little detail: I happen to be using RStudio as a front end. I was only able to get all working when I reinstalled ggmap using @dkahle code from the R console (Rgui) stand-alone, NOT from within RStudio.

This was the case for installations of R on Linux and on Windows.

Dvoralai

Sent from my iPhone

On 5 Dec 2018, at 13.55, Ryan S. Fuller notifications@github.com wrote:

Hello everyone. I just wanted to give the problem I had and what I did to solve it for any newcomers to this ever growing feed. For me, I was getting the 'Forbidden (HTTP 403) error that many were having in an old code I used for a manuscript. I followed the solutions found in this comment overflow but more closely to @RomanAbashin's (Sept 30th) (Link here: #51 (comment)) nicely detailed summary comment as follows: Note: It's imperative to do these in the proper steps -- I think that is why some are having issues with individual steps despite doing all that has been suggested! For me, it worked the first time.

Google Cloud Console (before doing anything in R):

First I registered an API key within the Google Cloud console following the link provided from @RomanAbashin -- I did not restrict the API key as suggested by Google (does anyone have any advice on this moving forward? I'd like to make it as secure as possible -- but still have it usable). I also made sure billing was turned on as suggested in many other posts -- it's free unless you are using it to pull large quantities of maps, but they want a credit card to 'make sure you aren't a robot'. While in the Google Cloud Console, search for and enable the 'Geocoding API' and the 'Maps Static API' From your Google Cloud Page Click 'APIs and Services' >> Library >> (To Filter: look in the left hand column under Category and scroll down to 'Maps' -- Click it >> Geocoding API should be in the first row (Enable It). (Repeat for 'Maps Static API', which is in the 3rd row) From the 'Credentials' menu you can Copy your API key to the clipboard. Onward to R!

I reinstalled ggmap using @dkahle code here: (Link: #51 (comment)) : devtools::install_github("dkahle/ggmap", ref = "tidyup") I rebooted R Loaded ggmap library (copy-paste API from Google Cloud Console): library(ggmap) register_google(key = 'copy-API-key-from-GoogleConsole') Run my code again. It works! @sabahzero have you had any luck over the last few days? From your code linked above on your github:

Create zoomed-in map (main figure) Zoom=get_map(location=c(-116.9685,32.22644,-116.9241,32.26755), maptype="roadmap")

Sidenote: I didn't change my command for 'get_map()' as suggested in some other posts and it still works for me. I think if you can do all that is required for the API steps and register it, reinstall ggmap with the above command, reboot R, load ggmap, register your API key, and rerun your code you should have success!

Try following my steps listed above or visit @RomanAbashin's comment that I linked to. He has a link to Google's page with info about properly setting up your API with billing and all.

After writing this, I dug through the comments more and I see much of this is also summarized here: (#51 (comment)).

Thanks much to @dkahle & @RomanAbashin! Plus many others who have been troubleshooting! You made this one easy for me to fix with manuscript reviews due in a couple of days!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

lgellis commented 5 years ago

For those who it might help, I updated my ggmap tutorial to include the google cloud platform steps with screenshots to create the service, get an api key and apply it. https://www.littlemissdata.com/blog/maps

@dkahle thank you so much for your awesome package and all the support you've been giving. @full6186 great summary above.

CaperKen commented 5 years ago

The little miss data tutorial, followed the code religiously and it worked very well until I got to 9a.

(Thanks Little Miss. Really very well done.)

At Map 9a, I started getting the "403" error and that has not stopped with many re-attempts. Now, none of the map code works.

I've followed all the suggestions above, including re-installing, rebooting, using my API, etc. Still "403".

Any help would be great.

atenaeslami commented 5 years ago

@RomanAbashin, @dkahle I am a new user to R package. It is really necessary for me to learn making maps using ggmap package, but unfortunately, i spent lots of time on it without any result. I did every solution @dkahle suggested, but API problem arosen! Thus, i used @RomanAbashin recommendationas follow: library(ggmap) Loading required package: ggplot2 Google's Terms of Service: https://cloud.google.com/maps-platform/terms/. Please cite ggmap if you use it! See citation("ggmap") for details. library(tmaptools) ggmap(get_stamenmap(rbind(as.numeric(paste(geocode_OSM("Vienna")$bbox))), zoom = 11)))) Error: unexpected ')' in "ggmap(get_stamenmap(rbind(as.numeric(paste(geocode_OSM("Vienna")$bbox))), zoom = 11)))" ggmap(get_stamenmap(rbind(as.numeric(paste(geocode_OSM("Vienna")$bbox))), zoom = 11)))) Error: unexpected ')' in "ggmap(get_stamenmap(rbind(as.numeric(paste(geocode_OSM("Vienna")$bbox))), zoom = 11)))"

but i have problem again,

I will really appreciate you if you can help me.

dkahle commented 5 years ago

Hi @atenaeslami –

I've been working on ggmap quite a bit recently. Please re-install using: devtools::install_github("dkahle/ggmap") (no tidyup). After that, re-start R and reload ggmap. Then, try something simple, like:

bbox <- c(left = -97.1268, bottom = 31.536245, right = -97.099334, top = 31.559652)
ggmap(get_stamenmap(bbox, zoom = 13))

That should work regardless of Google stuff. Does it? If not, please report your input and output.

To test whether your Google setup is working properly, I suggest two things. First, use google_key() to check if you have an API key. If you get NA, it won't work, and you'll need to use register_google() to register your key; see the main GitHub page for details. Once you've registered it, try something like geocode("the white house"). It should be clear if it's working properly or not from that point. If not, let me know with input/output. Thanks!

atenaeslami commented 5 years ago

@dkahle YES, i finally get the map. thank you very much.

devtools::install_github("dkahle/ggmap") Downloading GitHub repo dkahle/ggmap@master WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 3.5 from http://cran.r-project.org/bin/windows/Rtools/.

checking for file 'C:\Users\negin\AppData\Local\Temp\RtmpAxw6BI\remotesce4708ee17\dkahle-ggmap-e55c0b2/DESCRIPTION' ...

checking for file 'C:\Users\negin\AppData\Local\Temp\RtmpAxw6BI\remotesce4708ee17\dkahle-ggmap-e55c0b2/DESCRIPTION' ...

√ checking for file 'C:\Users\negin\AppData\Local\Temp\RtmpAxw6BI\remotesce4708ee17\dkahle-ggmap-e55c0b2/DESCRIPTION' (1.1s)

√ checking DESCRIPTION meta-information

I need the Iran and Turkey maps near together. How i must order it?

Would you please tell me how?

Kind Regards

jncai commented 5 years ago

When I use library(devtools) install_github("dkahle/ggmap")

it appears that Downloading GitHub repo dkahle/ggmap@master Error in utils::download.file(url, path, method = download_method(), quiet = quiet, : cannot open URL 'https://api.github.com/repos/dkahle/ggmap/tarball/master'

How can I deal with this problem?

Thanks

dkahle commented 5 years ago

Hi @atenaeslami – I'm not familiar with that warning on the install; I'd just suggest some Google searching. Looks like you're getting tiles from Stamen; you probably just need the proper bounding box, no?

@jncai – Thanks for the post/email. That doesn't appear to be a ggmap problem: for some reason, you aren't able to get what you need from GitHub. Ordinarily I associate that error with you not being online, but I'm assuming you covered that base already (obviously you were online at the time of this post). Can you download any file off the internet from within R?

sabahzero commented 5 years ago

Just wanted to update the additions to the read.me and comments here resolved all my troubles, thank you!

atenaeslami commented 5 years ago

Hi @dkahle yes, you are correct, but unfortunately, I did not find the right bounding box. Who can help me? I want to learn a general rule to find the bounding box for any map in the world.

atenaeslami commented 5 years ago

Dear Dkahle I tried a lot to find the longitude and latitude of both Iran and Turkey so many times but i was unsuccessful to do that. would you please help me?

All the best, Atena

On Monday, January 28, 2019, 5:35:52 AM GMT+3:30, david kahle notifications@github.com wrote:

Hi @atenaeslami –

I've been working on ggmap quite a bit recently. Please re-install using: devtools::install_github("dkahle/ggmap") (no tidyup). After that, re-start R and reload ggmap. Then, try something simple, like: bbox <- c(left = -97.1268, bottom = 31.536245, right = -97.099334, top = 31.559652) ggmap(get_stamenmap(bbox, zoom = 13)) That should work regardless of Google stuff. Does it? If not, please report your input and output.

To test whether your Google setup is working properly, I suggest two things. First, use google_key() to check if you have an API key. If you get NA, it won't work, and you'll need to use register_google() to register your key; see the main GitHub page for details. Once you've registered it, try something like geocode("the white house"). It should be clear if it's working properly or not from that point. If not, let me know with input/output. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rrmn commented 5 years ago

@atenaeslami ,

just use a free service like https://www.latlong.net/

atenaeslami commented 5 years ago

Dear Dkahle So many thanks for the prompt answer.Iran: Latitude: 32.427910/ Longitude: 53.688046Turkey: Latitude: 38.963745/ Longitude: 35.243320

Then, how i must replace them in the following command?? and i think it is better to change the zoom to 5, is it good? bbox <- c(left = -97.1268, bottom = 31.536245, right = -97.099334, top = 31.559652) ggmap(get_stamenmap(bbox, zoom = 13))

All the best, Atena

On Wednesday, March 6, 2019, 4:47:54 PM GMT+3:30, Roman Abashin notifications@github.com wrote:

@Atena,

just use a free service like https://www.latlong.net/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lgellis commented 5 years ago

@CaperKen - I think the issue is that while you might have added a credit card, your API key is associated with a project that does not have billing set up. I had the same thing happen and it was fixed when I added billing to the project.

You can test if this is your issue by running the code up to 9a. The next day try to run from 9a on, it should work. You may have to reload the data and the libraries.

From what I can tell they allow one api call daily for accounts without active billing set up. All the code up to 9a is using one base googlemap graph (p). It then has to update in 9a, 9b, 10a, 10b b/c we are modifying the graph displayed to have different visuals.

Please let me know if this works.