r - sp::CRS 和 ggspatial::annotation_map_tile 分别出错
问题描述
它工作得reprex::reprex()
很好(见下文),但在 Rterm 和 RStudio 控制台中我得到错误......你知道如何解决这个问题吗?有一些类似的问题,但到目前为止我还没有找到解决方案
rgdal::rgdal_extSoftVersion()
#> Error: no such table: metadata
sp::CRS(SRS_string='EPSG:4326')
#> Error in sp::CRS(SRS_string = "EPSG:4326") : NA
sp::CRS("+init=epsg:4326")
#> Error in sp::CRS("+init=epsg:4326") : NA
ggplot2::ggplot() +
ggspatial::annotation_map_tile(
zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
ggplot2::geom_sf(data = longlake_waterdf, fill = NA, col = "grey50")
#> Error in sp::CRS(paste0("+init=epsg:", epsg)) : NA
非常感谢,克里斯托夫
sf::sf_extSoftVersion()
#> GEOS GDAL proj.4 GDAL_with_GEOS USE_PROJ_H
#> "3.9.1" "3.2.1" "7.2.1" "true" "true"
#> PROJ
#> "7.2.1"
rgdal::rgdal_extSoftVersion()
#> GDAL GDAL_with_GEOS PROJ sp EPSG
#> "3.2.1" "TRUE" "7.2.1" "1.4-5" "v10.008"
sp::CRS(SRS_string='EPSG:4326')
#> CRS arguments: +proj=longlat +datum=WGS84 +no_defs
sp::CRS("+init=epsg:4326")
#> CRS arguments: +proj=longlat +datum=WGS84 +no_defs
wkt <- sf::st_crs(4326)[[2]]
sp::CRS(wkt)
#> CRS arguments: +proj=longlat +datum=WGS84 +no_defs
ggspatial::load_longlake_data()
ggplot2::ggplot() +
ggspatial::annotation_map_tile(
zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
ggplot2::geom_sf(data = longlake_waterdf, fill = NA, col = "grey50")
#> Zoom: 13
由reprex 包于 2021-10-22 创建(v2.0.1)
解决方案
推荐阅读
- visual-studio-code - 是否可以映射 `alt+s` 在 VSCode Vim 中转义?
- mysql - 为每个用户从表中获取最后 5 行
- sql - 使用窗口函数时出现 Teradata 错误 3504(非聚合值必须是组的一部分)
- javascript - How to resolve promise once all async operations in multiple nested forEach loops are complete?
- docker - 调查 Docker 连接问题
- automation - 自动化在 citrix xenapp 下运行的应用程序的测试
- rest - 在 LoggingInInterceptor 中记录有效负载
- linux - 从 Linux 复制到 Windows 的文本文件中的垃圾值 ([39m[22m[0m)]
- java - ERROR 17392 osboot.SpringApplication 应用程序启动失败
- python-2.7 - 在 python 中创建具有相同度数序列的常规图。可能吗?