Hello everyone!
I have an error message using the function GetMap.bbox(). I have specified my API_key, but still I can't download the map.
code:
terrmap <- GetMap.bbox(lonR = c(min(df3$lon)-1, max(df3$lon)+1), latR = c(min(df3$lat)-1, max(df3$lat)+1),maptype= "terrain", destfile = "terrain.png", MINIMUMSIZE = F, NEWMAP = T, API_console_key = Sys.getenv("AIzaSyBXkxxxxxxxx"))
I get back this:
[1] "API key provided"
Error in download.file(urlStr, destfile, mode = "wb", quiet = TRUE) :
cannot open URL 'https://maps.googleapis.com/maps/api/staticmap?center=49.676615,15.591801&zoom=5&size=640x640&maptype=terrain&format=png32&sensor=true&key='
In addition: Warning message:
In download.file(urlStr, destfile, mode = "wb", quiet = TRUE) :
cannot open URL 'https://maps.googleapis.com/maps/api/staticmap?center=49.676615,15.591801&zoom=5&size=640x640&maptype=terrain&format=png32&sensor=true&key=': HTTP status was '403 Forbidden'
Can you please help me? Thank you very much.