简体   繁体   English

r 中的 ggmap - 自己的边界框

[英]ggmap in r - own bounding box

I am trying to make a map with my own borders of bounding box.我正在尝试使用我自己的边界框边界制作地图。 But so far I failed every time.但到目前为止,我每次都失败了。

First I tried to do it with function get_map .首先,我尝试使用函数get_map来完成它。 Here I found that I need to specify source = "osm" . 在这里我发现我需要指定source = "osm" My code had been我的代码已经

 my_map<-get_map(location=c(-15, 30, 15, 85), source="osm")

but I recieved an error但我收到一个错误

 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: HTTP status was '0 (nil)'`

Than I tried using get_openstreetmap .比我尝试使用get_openstreetmap My code was我的代码是

  get_openstreetmap(bbox = c(left = -15.00000, bottom = 29.38048, right = 15.00000,
  top=85.00000, scale=606250))

but again I got an error但我又犯了一个错误

 Error: bounding box improperly specified.  see ?get_openstreetmap

Although I read both ?get_openstreetmap and ?get_map I dont know what I am doing wrong.虽然我读了?get_openstreetmap?get_map我不知道我做错了什么。 Can anyone help me?谁能帮我? Please consider that after getting a map I will need to add some points on it, so just url isn't enough for me.请考虑在获得地图后我需要在其上添加一些points ,因此仅url对我来说是不够的。

Thx a lot!多谢!

Couple of issues here.这里有几个问题。 You have a typo thats including scale in your bounding box for the get_openstreetmap function, causing the error.您有一个错字,包括get_openstreetmap函数的边界框中的get_openstreetmap ,导致错误。

get_openstreetmap(bbox = c(left = -15.00000, bottom = 29.38048, right = 15.00000,
  top=85.00000), scale=606250)

Second the scale you're trying to download appears to be to small for the region your downloading.其次,您尝试下载的规模对于您下载的区域来说似乎很小。 Try increasing the scale.尝试增加规模。

help(OSM_scale_lookup)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM