我从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”_。还有什么建议? –