Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_map cannot load OpenStreetMap #172

Open
weianuk opened this issue Aug 15, 2017 · 6 comments
Open

get_map cannot load OpenStreetMap #172

weianuk opened this issue Aug 15, 2017 · 6 comments
Labels

Comments

@weianuk
Copy link

weianuk commented Aug 15, 2017

Tried to use get_map to load openstreetmap, but it gives the error below:

map <- get_map(location = 'uk', zoom = 8, source = "osm")

Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=uk&zoom=8&size=640x640&scale=2&maptype=terrain&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=uk&sensor=false
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=-5.19103891796874,54.3650719770938,-1.67541391796874,56.3626958621291&scale=2800000&format=png': HTTP status was '400 Bad Request'

@dkahle Is there any effective solution to this problem? thanks.

@jonathan-g
Copy link

See this issue: #117

From that issue, it seems that OpenStreetMap has blocked external applications (such as ggmap) from calling its export API function because of the load this puts on the OSM servers.

The fix is to use another map source, such as stamen.

@Edouard-Legoupil
Copy link

It seems this package: https://github.com/ifellows/ROSM/blob/master/OpenStreetMap/R/osm.R
https://cran.r-project.org/web/packages/OpenStreetMap/OpenStreetMap.pdf
is able to get OSM tiles... Isn't there a way to fix ggmap using the same approach?

@scottmmjackson
Copy link
Collaborator

Looks like we need to fix the API access:

https://wiki.openstreetmap.org/wiki/Downloading_data

@competulix
Copy link

Any news on this? It would be really helpful if this functionality was restored.

@bbrewington
Copy link

To clarify the comment from @Edouard-Legoupil it looks like the package "OpenStreetMap" breaks a bounding box into individual tiles and gets them one at a time, then combines into one map. Not sure if that's what get_openstreetmap is also doing

As FYI, here is a link to some blog posts by the OpenStreetMap package author, Ian Fellows - http://blog.fellstat.com/?cat=15

@lysogeny
Copy link

Most of the things needed to make get_openstreetmaps (or any other tile server) work are already present in get_stamenmap.

I have created new functions for getting tiles from arbitrary tile servers (get_tilemap), and some prespecified tile servers.
Not all of the features of the old function are available yet, as I am currently busy with my thesis.
Also, I am not sure if I need to do something to make this okay with the usage policies, I will look into that at a later point.

In case anyone is interested: https://github.com/lysogeny/ggmap

Here is a map I just made:
opentopomap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants