问题描述
我有五个与加利福尼亚州接壤的县的shapefile,我试图将它们合并成一个大的shapefile,并保持县的原始边界.然后,我想绘制诸如此的点>因此,该地图仅需为县边界的简单地图.有没有办法在R中做到这一点,还是我必须使用类似ArcGIS的东西?
I have five shapefiles of bordering counties in California that I am trying to combine into one large shapefile and maintain the original borders of the counties. I then want to plot points such as this so the map only needs to be a simple map of county boundaries. Is there a way to do this in R or will I have to use something like ArcGIS?
关于在shapefile中进行合并的大量文档,例如此处,其中两个shapefile具有相同的坐标.但是没有关于仅部分共享坐标的shapefile的文档.
There is extensive documentation about merging within a shapefile such as here where both shapefiles have the same coordinates. But no documentation on shapefiles that only partially share coordinates.
推荐答案
如果只需要将所有边界放入一个数据集中,则可以使用sp
/rgdal
轻松地做到这一点,但是如果需要实际以几何方式合并边界(剪切/合并/溶解),以此类推,R中的支持并不是那么简单.
If you only need to put all the borders into one data set then you can do that with sp
/rgdal
easily enough, but if you need to actually merge borders geometrically (clip/join/dissolve) and so on the support in R is not that simple.
大致来说,简单的选项是使用readOGR
读取每个shapefile,然后将它们一起spRbind
读取.如果rgdal
难以构建/安装,则还有其他选项可用于读取各种软件包中的shapefile.
Roughly the simple option is read each shapefile with readOGR
, then spRbind
them together. If rgdal
presents difficulties for building/installing then there are other options for reading shapefiles in various packages.
顺便说一句,类似于ArcGIS",但更接近免费":www.manifold.net
btw, "something like ArcGIS" but much closer to "free": www.manifold.net
这篇关于在R中合并边界shapefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!