[R-sig-Geo] editing/"moving" coordinates of shape file
Julie Lee-Yaw
julleeyaw at yahoo.ca
Sun Jan 5 19:20:40 CET 2014
Hi
I have two shapefiles that I am reading in to R via maptools (readShapePoly): for example, shape 1 is a map of the lower 48 US states and shape 2 is a polygon that represents a very crude buffer region around the Mississippi River.
I ultimately want to create two new shapefiles representing the region west of the buffer zone (including the buffer) and the region east of the buffer zone (also including the buffer…so effectively two new shapefiles that only overlap via the buffer). Note this is sort of a splitting of the US shapefile into two, with the need to preserve the shape that bisected the original continent.
In ArcGIS, one way to do this would be to save the buffer shapefile as a new shp and manually "edit" some of the coordinates. So to create the "eastern" region, I would change the eastern-most points in the buffer polygon so that the shape extends well past the eastern edge of the continent; I could then crop this new shapefile by the continent to get the final eastern region.
I think I can pull everything in to PBSmapping format and use the joinPolys function to do the latter part of this process (e.g. crop to continent) but how can I modify/edit coordinates of the original buffer polygon to overshoot the continent boundaries? I see that "coords" is a slot in my buffer polygon but I haven't been able to figure out how to extract the coordinates from a polygon shapefile, let alone change them.
Any suggestions on how to access the coordinates for purposes of changing them? Or better yet, a more efficient way to tackle this type of problem?
Thanks in advance!
More information about the R-sig-Geo
mailing list