读写geojson

r
阅读 44 收藏 0 点赞 0 评论 0

write-geojson

library(geojsonio)
library(sf)

# read geojson to sf
tmp <- geojsonio::geojson_read(file.path(in_path, layer4_name), what = "sp")

tmp2 <- st_as_sf(tmp)

# write GeoJSON - must transform from UTM to long/lat
st_write(st_transform(sf_mp,"+proj=longlat +datum=WGS84"),
         paste0("sf_mp", ".geojson"),
         driver = "GeoJSON",
         delete_dsn = TRUE)
         
# read with sf package
layer5_name    = "NoSprayInput.geojson"
layer5_path    = "./devdata/" 

gj_no_spray <- st_as_sf(
  sf::st_read(
  file.path(layer5_path, layer5_name),
  stringsAsFactors = FALSE)
)         
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号