G'day,
I am trying to learn how to use the ggmap package in R, but am getting stuck at the very beginning. All I am trying to do is use the qmap() function to download maps, but I am getting some very strange results. I have tried:
library(ggmap)
aus<- qmap('australia')
aus<- qmap('australia', zoom = 5)
and number of other locations and things. Sometimes a map is downloaded, but more often than not I get the following error message:
Error in download.file(url, destfile = destfile, quiet = !messaging, mode = "wb"):
cannot open URL 'http://maps.googleapis.com/maps/api/staticmap?center=adelaide&zoom=6&size=%20640x640&scale=%202&maptype=terrain&sensor=false'
In addition: Warning message:
In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") :
cannot open: HTTP status was '403 Forbidden'
It will work correctly one time then 5 secs later when I try it again with the exact some code it wont work.
From repeatedly using this function it seems like there is a time delay between its successful use. I have timed how long I have to wait between between successful uses, and it seems that 1 min is this thresh-hold. Also, every time I try to use the function, whether it is successful or not, it resets this 1 minute waiting time.
Do places like google restrict how often you can download stuff? This is a little frustrating if I want to quickly check if a map is the appropriate size, etc. Has anyone had the same experience, know what I might be doing wrong, or know a way around this issue?
Thanks in advance for your time and help!
Cheers, Adam