我從http://www1.kew.org/gis/tdwg/index.html下載了TDWG level4形狀。此形狀具有WGS84投影。我需要將此圖層重新投影到歐洲LAEA或CRS(「+ init = epsg:3035」)。R spTransform投影點不是有限的
我用下面的代碼:
TDWG4 <- readOGR("D:/GIS/Administrative/world/TDWG/level4/level4.shp", layer="level4")
TDWG4.LAEA <- spTransform(TDWG4, CRS("+init=epsg:3035"))
,並出現以下錯誤:
Error in .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args, : failure in Polygons 37 Polygon 1 points In addition: Warning message: In .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args, : 361 projected point(s) not finite
任何建議來解決這個問題?
幾乎在那裏。我嘗試繪製使用以下圖形聚焦於歐洲的轉換後的形狀: plot(TDWG4.LAEA ['Level4_cod'],xlim = c(943611,8500000),ylim = c(600000,7800000)) 但得到以下錯誤: 錯誤POLYPATH(p_bind(L),邊界=邊界[I],LTY = LTY [I],LWD隨鑽測井= [I]:無效的圖形路徑 任何建議 –
@NielsRaes你ggplot嘗試,而不是的基本情節?'devtools :: install_github(「tidyverse/ggplot2」)','library(「ggplot2」)#需要dev版本的ggplot2','ggplot(data = TDWG4.LAEA)+ geom_sf()'? – Phil
while打開使用devtools安裝的ggplot2我得到這個錯誤:_Error:在get(Info [i,1],envir = env)中'ggplot2'的包或命名空間加載失敗: lazy-loa d數據庫'D:/R/library/ggplot2/R/ggplot2.rdb'已損壞。當使用常規的ggplot2庫和'ggplot2 :: ggplot(data = TDWG4)+ geom_sf()'時我得到錯誤:geom_sf()中的_Error:找不到函數「geom_sf」_。還有什麼建議? –