在R中使用spTransform()函数时出现PROJ警告

4

我使用的是 R v 4.0.4 - sp v 1.4-5 和 rgdal 1.5-23。我正在使用 rgdal 包加载一个 shapefile,然后尝试简单地应用 spTransform(),但我收到了一系列荒谬的警告,无法摆脱。有人对此有什么见解吗?

options("rgdal_show_exportToProj4_warnings"="none")
library(rgdal)
library(sp)

## Shapefile has a projection of WGS84
X <- readOGR(dsn=".", layer="myshapefile.shp")
UTM30 <- sf::st_crs(32630)$proj4string

transf <- spTransform(X,UTM30)

############################################################
### This warning gets repeated tens to hundreds of times ###

proj_as_proj_string: C:\PostgreSQL\13\share\contrib\postgis-3.1\proj\proj.db lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR metadata. It comes from another PROJ installation.
proj_as_wkt: C:\PostgreSQL\13\share\contrib\postgis-3.1\proj\proj.db lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR metadata. It comes from another PROJ installation.
proj_create: C:\PostgreSQL\13\share\contrib\postgis-3.1\proj\proj.db lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR metadata. It comes from another PROJ installation.

有人遇到过这个问题并解决了吗?

谢谢!

1个回答

3
发现了来自rgdal的解释:
“GDAL”和“PROJ”库是该软件包的外部依赖项,当从源代码安装软件包时,必须先正确安装这两个库;重要的是,“GDAL”< 3必须与“PROJ”< 6相匹配。从“rgdal”1.5-8开始,使用“GDAL”>=3,“PROJ”>=6和“sp”>= 1.4进行安装,并使用“WKT2_2019”字符串而不是“PROJ”字符串来处理坐标参考系统。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接