[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    [R-sig-Geo] Slivers in thinned spatial polygon
From:       Kurt Ranalter <k.ranalter () gmail ! com>
Date:       2013-03-26 9:20:05
Message-ID: CABXgnVmbQCqRRLui9BTPbQ6V5CpKKXjhLOcwR7ttN85wMyPmug () mail ! gmail ! com
[Download RAW message or body]

Dear list,

while trying to simplify a SpatialPolygons object by means of the
thinnedSpatialPoly function of the maptools package, I've encountered
the following problem.

As far as I understand things, setting the topologyPreserve option to
TRUE should allow one to avoid slivers. However, when I use the
function in this way, this does not seem to happen: see for instance
the graph produced by the following example session.

> require(maptools)
Loading required package: maptools
Loading required package: foreign
Loading required package: sp
Loading required package: grid
Loading required package: lattice
Checking rgeos availability: TRUE
> require(maps)
Loading required package: maps
>
> map <- map("italy", plot = FALSE)
> sp <- map2SpatialPolygons(map, IDs = map$names)
>
> t <- sp@polygons[[114]]
> a <- sp@polygons[[16]]
>
> ta <- SpatialPolygons(list(t, a))
>
> ta.thin <- thinnedSpatialPoly(ta, tolerance = 0.02,
+                               topologyPreserve = TRUE)
Loading required package: rgeos
rgeos: (SVN revision 360)
 GEOS runtime version: 3.3.5-CAPI-1.7.5
 Polygon checking: TRUE
>
> plot(ta, border = "grey")
> plot(ta.thin, add = TRUE)

I'm not sure whether I'm just missing something obvious. Any help
would be much appreciated.

Best wishes,

Kurt

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic