2016-12-28 78 views
0

我需要在R中的ggplot2中製作的全球地圖上添加比例尺,easiest way似乎是通過ggsn包。ggsn全球地圖比例尺看起來不對

但是當我觀察地圖時,比例尺看起來不正確 - 例如,它橫跨澳大利亞E-W大約4000公里,略低於赤道非洲地區。這條2000公里的比例尺在赤道上看起來比非洲寬,幾乎和澳大利亞一樣寬。

感謝您的想法!

重複性代碼:

library(ggplot2) 
library(ggsn) 
library(dplyr) 

GG.GlobalMap = map_data("world") %>% 
    filter(region != "Antarctica") 

ggplot(GG.GlobalMap, aes(long, lat, group = group)) + 
    geom_path(color = "black") + 
    scalebar(data = GG.GlobalMap, dist = 1000, dd2km = TRUE, model = "WGS84", 
      st.size = 3, location = "bottomright") + 
    theme_void() 
+0

在經緯度投影繪製的全球地圖上,比例尺非常沒有意義,因爲距離與緯度高度失真。更好的辦法是繪製網格圖,這是這種地圖的首選方法。如果你真的想要一個比例尺,然後使用密切保留距離的投影。見例如https://en.wikipedia.org/wiki/List_of_map_projections – dww

+0

也相關:https://blogs.esri.com/esri/arcgis/2010/04/21/back-to-the-issue-of-scale-bars/ – dww

+0

是的,這就是爲什麼我還包括非洲沿赤道的例子 - 距離似乎也不匹配。 –

回答

1

在您使用的是簡單的經緯度長的投影距離被扭曲與緯度,逐漸變得捉襟見肘,因爲他們更接近極點。在極點處,單個點伸展到矩形地圖的整個寬度。因此,不建議在這些地圖上使用比例尺,因爲它們的大小隻能在特定的緯度上正確,並且會在地圖上的其他地方誤導。我們可以通過繪製了一系列在不同緯度的比例尺看到這個動作,以顯示它們的尺寸如何變化:

ggplot() + 
    geom_path(data = map_data("world"), aes(long, lat, group = group), color = "grey80") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -80, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -60, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -40, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -20, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 0, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 20, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 40, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 60, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 80, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") + 
    theme_void() 

enter image description here

出於這個原因,通常建議使用一個刻度,而比小規模全球地圖上的比例尺更大。

ggplot() + 
    geom_path(data = map_data("world"), aes(long, lat, group = group), color = "black") + 
    scale_x_continuous(breaks = (-9:9)*20) + 
    scale_y_continuous(breaks = (-9:9)*10) + 
    theme_bw() + 
    theme(panel.grid.major = element_line(colour = 'grey50', size = 0.3, linetype = 3)) 

enter image description here

如果你真的想用一個標尺,應先重新投影數據(使用spTransform),以相等的面積投影,爲此距離被扭曲只是最低限度或完全不。

+0

感謝您的解釋 - 我錯誤地認爲比例尺大小會匹配赤道距離。 –