Area left in shape file
On 11/09/12 10:31, Juan Tomas Sayago wrote:
Dear list, I have two shapes with polygons, and need to find the area in one of them that is not covered by the other. What do you recommend? Thanks Juan
You can use the functions area.owin() and setminus.owin() from
the "spatstat" package. E.g.
area.owin(setminus(A,B))
will give the area of that part of A not covered by B.
Note that A and B have to be objects of class owin; use the function
as.owin() to convert polygons to such objects. See vignette("shapefiles")
for some guidance.
Note that setminus(A,B) will yield an owin object of type *mask*
(whence your answer will be an approximation via "pixellation")
unless "gcplib" is available and enabled (by setting:
spatstat.options(gpclib=TRUE)
If you set gpclib=TRUE make sure that your use of this package
does not conflict with its unfortunately restrictive licensing terms.
(See license.polygons().)
cheers,
Rolf Turner