r - 带有 PROJ 的 R 警告中的 spTransform()
问题描述
我在 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”字符串。
推荐阅读
- java - 如何使用单个 JFrame 并基于 Action Listener 显示多个 JPanel?
- react-native - 如何使用 jest 模拟调用实用程序函数?
- php - 为什么我的 php json_encode 在 alamofire 中不能用 .responseJSON 序列化?
- excel - 如何在 Excel 中的水平栏中显示数据集?
- python-3.x - 为什么在我的模型 init() 上发生 OOM?
- python - Python 3 在句子之间添加引号
- javascript - 在javascript中打印一个对象数组
- vue.js - 如何修复“无法在布尔值'true'上创建属性'default'”
- php - myphpadmin 问题导致空白表
- python - 如何迭代以日期为键的嵌套字典