我需要一些可視化地理數據的世界地圖。我已經瞭解到Flowing Data的great circle mapping tutorial,結果似乎很奇怪。它是這樣的:如何避免R世界地圖中的斷線?
而且很顯然,我需要避免這些交叉畫面線條。但我該怎麼做?繪製地圖的代碼是這樣的:
map("world", col="#f2f2f2", fill=TRUE, bg="white",lwd=0.05)
for (j in 1:length(location$lon)) {
inter <- gcIntermediate(c(lon_nj, lat_nj), c(location$lon[j], location$lat[j]), n=100, addStartEnd=TRUE)
lines(inter, col="black", lwd=0.8)
}
我試圖通過GPE Automating great-circle map production in R
map("world", col="#f2f2f2", fill=TRUE, bg="white",lwd=0.05)
for (j in 1:length(location$lon)) {
inter <- clean.Inter(c(lon_nj, lat_nj), c(location$lon[j], location$lat[j]),n=100, addStartEnd=TRUE)
lines(inter, col="black", lwd=0.8)
}
提供的代碼,結果是這樣的:
而我只是想使用最短的距離到達所需的位置。
而且從網絡像使用像greatCircle另一個函數()也未能實現我的目標的答案。
那麼,有沒有人有一些想法如何實現這一目的?
非常感謝!
gcIntermediate有breakAtDateLine參數 – mdsumner