r - 在 sf 对象上设置正确的 crs 以绘制坐标点
问题描述
我正在尝试为我的sf
对象定义正确的 CRS。我想在以下图层(国家:荷兰)上绘制点:
Simple feature collection with 380 features and 3 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: 13565.4 ymin: 306846.2 xmax: 278026.1 ymax: 619232.6
epsg (SRID): NA
proj4string: +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs
输出:
该层具有正确的投影。
但是该POINT
层没有正确的 CRS 项目大概是因为它没有proj4string
?
Simple feature collection with 566 features and 5 fields
geometry type: POINT
dimension: XY
bbox: xmin: 3.5837 ymin: 50.86487 xmax: 7.120998 ymax: 53.44835
epsg (SRID): NA
proj4string: NA
如何设置与上一张地图相同的投影,以便在其上绘制坐标点?
解决方案
此外,还有st_set_crs()
可以在管道中使用的函数。例如,
points %>% st_set_crs(st_crs(polygons))
推荐阅读
- mysql - 错误:%pre(MariaDB-server-10.5.5-1.el7.centos.x86_64) scriptlet 失败,退出状态 1
- python - 得到一个令人困惑的 TypeError。策划游戏
- aes - 将 .Net AES 函数迁移到 Java 时出现问题
- expo - 世博深度链接
- html - 单个 CSS 样式表中的多个样式标题而不更改 HTML
- node.js - 如何使 VS Code 可重现地调试 Electron App?
- java - 如何优化应该读取给定输入的最后 5000 行的 java 代码的速度/内存
- node.js - puppeteer 滚动直到特定按钮或 div
- scala - 在 Scala 中,“T 中的协变”和“T 中的逆变”到底是什么意思?
- java - 使用 MongoDB Java 仅检索数组子文档字段的值