400 bad request with ggmap

眉间皱痕 提交于 2019-12-02 00:35:43

问题


I have used this before, and it has worked all the times:

library("ggmap")
newmap2<-get_openstreetmap(bbox = c(left = -71.2612362452596, 
bottom = 42.3308503846824, right = -71.0475647202879,
top = 42.4560226746649), scale=80000)

Now, all I can get is the following error message:

In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") : URL 'http://tile.openstreetmap.org/cgi-bin/export?bbox=-71.2612362452596,42.3308503846824,-71.0475647202879,42.4560226746649&scale=80000&format=png': status was '400 Bad Request'

I have used both the package ggmap v. 2.6.1 (from CRAN) and 2.7 (from GITHUB). Any help is appreciated. G


回答1:


The process seems to be very resource intensive, and that's why the code doesn't works. Read the discussion here: Updated link: https://help.openstreetmap.org/questions/25637/i-am-receiving-a-blank-page-http11-400-bad-request-after-requesting-a-data-export

Quote from the link:

Background: The export feature needs much processing power, which our servers are short of (just donated resources!). It could be that it works during a low load time

I tried the same location bounding box using "google" as map source and it worked:

newmap4 <- get_map(location = c(-71.2612362452596,42.3308503846824
                                ,-71.0475647202879,42.4560226746649), source = 'google')


来源:https://stackoverflow.com/questions/41526370/400-bad-request-with-ggmap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!