I am trying to use R to download a map but am getting a map grabbing failed message:

mapImage <- get_map(location = c(lon = -87.89, lat = 43.05),color = "color",source = "osm",zoom = 6) Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=43.05,-87.89&zoom=6&size=640x640&scale=2&maptype=terrain&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=-94.910263671875,37.6894455061226,-80.847763671875,47.9652621160178&scale=10000000&format=png': HTTP status was '0 (null)'

asked 04 Jun '16, 08:40

erikwanta's gravatar image

erikwanta
11223
accept rate: 0%

edited 04 Jun '16, 11:46

aseerel4c26's gravatar image

aseerel4c26 ♦
32.0k16238549

You do not really ask about a google maps error here, right? ;-)

(04 Jun '16, 09:58) aseerel4c26 ♦

Likely the image area is too big or the server currently has too high load to process your special request. Also see https://help.openstreetmap.org/questions/21192/error-export-load-average-on-the-server-is-too-high-at-the-moment .

Use tiles instead - they are usually pre-rendered and served via a CDN. Or use a different service (e.g. MapQuest Open Static Maps, see OSM on paper) which is based on OpenStreetMap data.

permanent link

answered 04 Jun '16, 10:32

aseerel4c26's gravatar image

aseerel4c26 ♦
32.0k16238549
accept rate: 17%

edited 04 Jun '16, 10:32

See this previous question among others re R. The options at aseerel4c26's "OSM on paper" link are the way to go, if you want a rendered map (as opposed to the map data itself).

Would it be possible to find out whose code it is (in whatever library or example) that contains the offending "http://tile.openstreetmap.org/cgi-bin/export?bbox=" request? I'd be happy to explain why what they are suggesting will almost never work.

permanent link

answered 04 Jun '16, 11:34

SomeoneElse's gravatar image

SomeoneElse ♦
32.0k63330748
accept rate: 15%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×277
×232
×10
×8

question asked: 04 Jun '16, 08:40

question was seen: 6,251 times

last updated: 04 Jun '16, 11:46

powered by OSQA