在SF对象上设置正确的crs以绘制坐标点 [英] Set the right crs on sf object to plot coordinate points
本文介绍了在SF对象上设置正确的crs以绘制坐标点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试为我的sf
对象定义正确的CRS.我想在以下图层(国家:荷兰)上绘制点:
I'm trying to define the right CRS for my sf
object. I want to plot points atop the following layer (country: the Netherlands):
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
?
But the POINT
layer doesn't have the correct CRS project presumably because it has no 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
如何设置与上一张地图相同的投影,以便可以在其上绘制坐标点?
How do I set the same projection as the previous map so I can plot the coordinates points on it?
推荐答案
此外,还有函数st_set_crs()
,可在管道中使用.例如
In addition, there is the function st_set_crs()
, which can be used in a pipe. For example,
points %>% st_set_crs(st_crs(polygons))
这篇关于在SF对象上设置正确的crs以绘制坐标点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文