我正试图使用sf包转换这里示例中跨越日期线的多边形的CRS,但是得到了警告
警告信息:
In CPL_wrap_dateline(x, options, quiet) :
GDAL Error 6: GEOS support not enabled.这将导致代码的最后部分失败:
library(sf)
#Linking to GEOS 3.6.1, GDAL 2.1.3, proj.4 4.9.3
point1 <- st_point(c(-179.5, -50))
point2 <- st_point(c(0, -30))
points <- st_sfc(point1, point2, crs = 4236)
points_trans <- st_transform(points, 32621)
circles <- st_buffer(points_trans, 100000)
circles_latlon <- st_transform(circles, 4326)
circles_latlon2 <- st_wrap_dateline(circles_latlon, options = c("WRAPDATELINE=YES"))我在网上查看了如何启用GEOS支持(或者只是更新GDAL),但找不到简单的解释。有什么建议吗?
我正在运行MACOS 10.13.6;R3.5.0(也使用3.5.1检查,但问题相同)。
发布于 2018-09-18 13:19:39
我终于解决了这个问题
sf下载cran源文件sf安装R CMD INSTALL sf_0.6-3.tar.gz --configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Versions/2.2/unix/bin/gdal-config -with-geos-config=/Library/Frameworks/GEOS.framework/Versions/3B/unix/bin/geos-config'。请注意,我需要(重新)添加.gz扩展,因为苹果可以方便地隐藏它。https://stackoverflow.com/questions/52335853
复制相似问题