开发者

Combining bordering shapefiles in R

开发者 https://www.devze.com 2023-01-02 15:13 出处:网络
I have five shapefiles of bordering counties in California that I am trying to combine into one large shapefile 开发者_StackOverflow中文版and maintain the original borders of the counties.I then want

I have five shapefiles of bordering counties in California that I am trying to combine into one large shapefile 开发者_StackOverflow中文版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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号