私は同じ問題を抱えており(南極をプロットしようとしたとき)、それを回避するために に頼りましたが、パッケージggplot
のいくつかの関数に依存していました。ggmap
@Henrik のリンクが示唆するように、地図投影法が問題のようです。
全体のアイデアとコードは David Kahle の厚意によるものです
ケースで機能させるためにできることは次のとおりです。
location <- get_map(location = c(lon = 0, lat = 80), zoom = 4, maptype = "hybrid")
#Create a small data frame to pass to ggplot
fourCorners <- expand.grid(
lon = as.numeric(attr(location, "bb")[, c("ll.lon", "ur.lon")]),
lat = as.numeric(attr(location, "bb")[, c("ll.lat", "ur.lat")])
)
# The inset_raster function needs 4 data coordinates. Pull it out of your "location" that you got via get_map
xmin <- attr(location, "bb")$ll.lon
xmax <- attr(location, "bb")$ur.lon
ymin <- attr(location, "bb")$ll.lat
ymax <- attr(location, "bb")$ur.lat
# Now you are ready to plot it
mp <- ggplot(fourCorners, aes(x = lon, y = lat) ) +
inset_raster(location, xmin, xmax, ymin, ymax)
mp
これにより、(経度= 0、緯度= 80)を中心とする「ハイブリッド」マップが得られます
