Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top