将.csv(sf包中的.geo列转换为r中的shapefile)>

问题描述 投票:0回答:1

我已经从栅格图层中提取了值,现在想将其转换为shapefile。 csv文件包含sf软件包中不同范围的值和一列.geo。在R中将csv文件转换为shapefile的任何想法。

library(sf)
# Read data file
LS2013<-read.csv("https://raw.githubusercontent.com/tuyenhavan/Rice-Paper/master/LS_2013.csv",header = T)
head(LS2013)
 .geo
1  {"type":"Point","coordinates":[106.0283799940066,21.191342664375124]}
2  {"type":"Point","coordinates":[106.02664540369682,21.19108403651402]}
3 {"type":"Point","coordinates":[106.02693524526529,21.191084036514017]}
4  {"type":"Point","coordinates":[106.02722508683375,21.19107957741297]}
5  {"type":"Point","coordinates":[106.02751492840221,21.19107957741297]}
6  {"type":"Point","coordinates":[106.02780031086967,21.19107511831191]}

shapefile可以在地理坐标系中(4326)。

谢谢。

我已经从栅格图层中提取了值,现在想将其转换为shapefile。 csv文件包含sf软件包中不同范围的值和一列.geo。有关转换csv文件的任何想法...

r type-conversion shapefile sf
1个回答
0
投票

似乎文件是JSONgeoJSON文件。您可以直接使用sf::st_read

© www.soinside.com 2019 - 2024. All rights reserved.