[R-sig-Geo] intersections to individual polygons

Agustin Lobo @loboli@t@@ @ending from gm@il@com
Mon Jul 2 13:35:59 CEST 2018


Mimicking your vignette:

require(rgdal)
require(raster)
require(spatstat)
require(rgeos)
require(maptools)

dzfile <-"https://www.dropbox.com/s/xxujcwqy3ec21sa/TDM1_DEM__04_S63W062_epsg32720.zip?dl=0"
download.file(dzfile,"TDM1_DEM__04_S63W062_epsg32720.zip",method="wget")
unzip("TDM1_DEM__04_S63W062_epsg32720.zip")
v <- readOGR(dsn="TDM1_DEM__04_S63W062_epsg32720",
             layer="TDM1_DEM__04_S63W062_epsg32720", stringsAsFactors = FALSE)
plot(v)
p <- slot(v, "polygons")
p2 <- lapply(p, function(x) { SpatialPolygons(list(x)) })
w <- lapply(p2, as.owin) #maptools required

te <- tess(tiles=w)
class(te)
plot.tess(te,do.labels=TRUE)

But this is still the original polygons,
not the mosaic of polygon parts I'm looking for.
Would I need to go doing all possible intersections and then
adding the "A not B" and "B not A" parts for all possible pairs?

Or is there a function in spatstat to convert "te" into a tesselation
of adjacent polygons?

Thanks



On Thu, Jun 28, 2018 at 2:02 PM, Rolf Turner <r.turner using auckland.ac.nz> wrote:
>
> On 29/06/18 00:51, Agustin Lobo wrote:
>
>> Given an SpatialPolygons DF with i.e. 2 intersecting polygons, A and
>> ,B,  is there a function
>> that would split the original polygons into "onlyA", "onlyB" and
>> "AintersectingB" polygons?
>
>
> You can do this easily in spatstat by converting your polygons to "owin"
> objects.
>
> cheers,
>
> Rolf Turner
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list