RgoogleMaps で地図を作ろうとしています。私のコードは今朝動作していましたが、今はこのエラーが発生します:
map.lyon <- GetMap(center=c(45.77338,4.856039), zoom = 15, destfile = "tile1.png", maptype = "mobile")
Error in download.file(url, destfile, mode = "wb", quiet = TRUE) :
cannot open URL 'http://maps.google.com/maps/api/staticmap?center=45.77338,4.856039&zoom=15&size=640x640&maptype=mobile&format=png32&sensor=true'
In addition: Warning message:
In download.file(url, destfile, mode = "wb", quiet = TRUE) :
cannot open: HTTP status was '403 Forbidden'
今朝たくさんの地図を作りました(たぶん200くらい)が、Google Maps APIのリクエストに制限はありますか?
また、Google マップの代わりに OpenStreetMaps を使用しようとしましたが、常に RgoogleMaps パッケージを使用しましたが、これも機能しません (ウェブサイトで見つかったコードの単純な例にすぎません)。エラーは非常に似ています。コードは次のとおりです。
library(RgoogleMaps)
lat_c<-51.47393
lon_c<-7.22667
bb<-qbbox(lat = c(lat_c[1]+0.01, lat_c[1]-0.01), lon = c(lon_c[1]+0.03, lon_c[1]-0.03))
OSM.map<-GetMap.OSM(lonR=bb$lonR, latR=bb$latR, scale = 20000, destfile="bochum.png")
そして、これが私がそれを実行したときに私が持っているものです:
> library(RgoogleMaps)
> lat_c<-51.47393
> lon_c<-7.22667
> bb<-qbbox(lat = c(lat_c[1]+0.01, lat_c[1]-0.01), lon = c(lon_c[1]+0.03, lon_c[1]-0.03))
> OSM.map<-GetMap.OSM(lonR=bb$lonR, latR=bb$latR, scale = 20000, destfile="bochum.png")
[1] "http://tile.openstreetmap.org/cgi-bin/export?bbox=7.19637,51.46383,7.25697,51.48403&scale=20000&format=png"
trying URL 'http://tile.openstreetmap.org/cgi-bin/export?bbox=7.19637,51.46383,7.25697,51.48403&scale=20000&format=png'
Error in download.file(url, destfile, mode = "wb", quiet = FALSE) :
cannot open URL 'http://tile.openstreetmap.org/cgi-bin/export?bbox=7.19637,51.46383,7.25697,51.48403&scale=20000&format=png'
In addition: Warning message:
In download.file(url, destfile, mode = "wb", quiet = FALSE) :
cannot open: HTTP status was '403 Forbidden'
何が問題なのかわかりません。使用できる別のパッケージはありますか?基本的には、その地域の主要都市と道路を含む背景地図が必要で、その上に点をプロットできるようにするだけです。
お時間をいただきありがとうございます。