gpt4 book ai didi

r - 带有 PROJ 的 R 警告中的 spTransform()

转载 作者:行者123 更新时间:2023-12-05 04:52:38 25 4
gpt4 key购买 nike

我在 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.

有没有人遇到过这个问题并成功解决了它?

干杯

最佳答案

rgdal 找到这个解释:

'GDAL' 和 'PROJ' 库是包外部的,从源代码安装包时,必须首先正确安装;重要的是 'GDAL' < 3 与 'PROJ' < 6 匹配。从 'rgdal' 1.5-8,安装到 'GDAL' >=3,'PROJ' >=6 和 'sp' >= 1.4,坐标引用系统使用“WKT2_2019”字符串,而不是“PROJ”字符串。

关于r - 带有 PROJ 的 R 警告中的 spTransform(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66421914/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com