Hi, I am trying to get a map using R and the get_map function. Location.S <- c(3.5, 57.7, 11, 66) This code worked fine three weeks ago but I now get the following error message: Error: map grabbing failed - see details in ?get_openstreetmap. In addition: Warning message: In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") : cannot open URL 'http://tile.openstreetmap.org/cgi-bin/export?bbox=3.5,57.7,11,66&scale=5000000&format=png': HTTP status was '400 Bad Request' Any help will be greatly appreciated. asked 11 Jan '17, 11:57 Pierrick0204 |
This R function seems to run an CGI export call. I'm surprised that it worked at all. An issue has been filed against the github repo requesting that this call not be used: https://github.com/dkahle/ggmap/issues/117. The website export call is heavily rate limited. There are numerous examples of queries on this site relating to this issue. answered 11 Jan '17, 13:38 SK53 ♦ |
This means that the IMHO R should access individual tiles for the specified zoom level instead (without violating the tile usage policy, of course). Afterwards it just has to concatenate these tiles locally. This should be roughly equivalent to a call to answered 11 Jan '17, 13:38 scai ♦ The call get_openstreetmap() does not semm to work as well. Is there any way I can import the OSM from R since I am plotting data linked to geo coordinates?
(11 Jan '17, 14:00)
Pierrick0204
I can't answer this question since I've never worked with OSM in R.
(11 Jan '17, 14:43)
scai ♦
Hi again. If I understand the recent conversation from this post on Github, there is no way I can plot the same OSM map from R? That's really a pity since I used I for a scientific paper from which I have to update the map figure using the same map background as I previously did. Is there any alternative to get through this?
(12 Jan '17, 01:33)
Pierrick0204
1
You can try BigMap 2 to generate an image which you can then embed yourself. Keep in mind that this program will also violate the tile usage policy if used excessively. But for your paper it is probably okay.
(12 Jan '17, 08:19)
scai ♦
Thanks. Will the generated image contain the geographic coordinates? I need this information to plot my data (aquaculture sites) along the Norwegian coast, based on coordinates.
(12 Jan '17, 08:55)
Pierrick0204
1
No, the image will just be a regular image. The image generated by
(12 Jan '17, 09:58)
scai ♦
1
An alternative would be to use QGIS, the Composer option & Quick Map Services Plugin to create a map from OSM tiles covering the same area. This gives good control over scale and boundaries. I'm not sure exactly how pulling a map into ggplot works though.
(12 Jan '17, 13:26)
SK53 ♦
1
In the meantime, I just figured out the openstreetmap package on R which seem to do more or less the same.
(12 Jan '17, 14:42)
Pierrick0204
showing 5 of 9
show 4 more comments
|