我将一个geoJSON
对象加载到R中,并将jsonlite
作为对象poly_shape
。poly_shape
有4列,其中一列称为geometry
,包含坐标对中的多边形数据。例如,poly_shape$geometry
的第一行看起来像这样:
[[1]]
[,1] [,2]
[1,] 27.81674 -82.05954
[2,] 27.81499 -82.05964
[3,] 27.81498 -82.05872
[4,] 27.81484 -82.05872
[5,] 27.81492 -82.05889
如何将这个对象转换为sf
对象,因为st_as_sf
只返回
Error in st_sf(x, ..., agr = agr, sf_column_name = sf_column_name) : no simple features geometry column present
1条答案
按热度按时间svmlkihl1#
我最近写了一个小函数来做这件事。
创建于2023-10-10使用reprex v2.0.2