在R中组合多个shapefile [英] combining multiple shapefiles in R

查看:48
本文介绍了在R中组合多个shapefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件夹,其中包含大约 100 个点形状文件,这些文件是在对有蹄类动物进行采样时获得的位置.我想将所有这些点 shapefile 合并到 R 中的一个 shapefile.所有点数据最初都是 .gpx 格式,然后我更改为 shapefile.

I have a folder with about 100 point shapefiles that are locations obtained while scat sampling of an ungulate species. I would like to merge all these point shapefiles into one shapefile in R. All the point data were in .gpx format initially which I then changed to shapefiles.

我对 R 相当陌生,所以我对如何做到这一点感到非常困惑,并且找不到合并或组合多个 shapefile 的代码.任何建议将不胜感激.谢谢!

I am fairly new to R,so I am very confused as on how to do it and could not find codes that merged or combined more than a few shapefiles. Any suggestions would be much appreciated. Thanks!

推荐答案

基于@M_Merciless ..对于长列表,您可以使用

Building on @M_Merciless .. for long lists you can use

all_schools <- do.call(rbind, shapefile_list)

或者,非常快:

all_schools <- sf::st_as_sf(data.table::rbindlist(x))

这篇关于在R中组合多个shapefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆