Combining bordering shapefiles in R

為{幸葍}努か 提交于 2019-12-10 23:07:39

问题


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?

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.


回答1:


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.

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.

btw, "something like ArcGIS" but much closer to "free": www.manifold.net




回答2:


If you are looking for a Free and Open Source solution I highly recommend QGIS or uDIG or OpenJump or MapWindows. You can do all the shapefile manipulation you want in these packages, they are all GIS software.

I am sorry I do not of a way to do this in R and I am not sure I would trust the result - better to use a hammer for a nail than to use a screwdriver.

If you want to programmaticly want to alter the shapefiles let me know and I will recommend some python and java libraries.



来源:https://stackoverflow.com/questions/2962433/combining-bordering-shapefiles-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!