[R-sig-Geo] [Fwd: SpatialPolygons: Problems with cross overs?]

Edzer J Pebesma e.pebesma at geo.uu.nl
Thu Jul 5 19:29:07 CEST 2007


Agustin,

I didn't look at the cross overs, but spplot inside a loop needs an 
explicit print(spplot(...)) around it to get the result printed 
(actually plotted); this is a lattice FAQ, spplot wraps xyplot or 
levelplot in lattice.
--
Edzer

Agustin Lobo wrote:

> Dear rsiggeos,
>
> After importing an shp file with rgdal using
> refG <-
> readOGR("C:/ALOBO/dipu2006/espaisoberts_P037/GARRAF/GFO_EOA_TOTS_v4",layer="GFO_EOA_Acti_v4") 
>
>
> (I can send the shp file upon request)
>
> I do
>
> l2 <- as(as(refG, "SpatialPolygons"), "owin")
>
> and get a report of problems that I summarize here:
>
> Polygon 240 contains duplicated vertices
> Polygon 240 is self-intersecting
> Polygon 352 contains duplicated vertices
> Polygon 352 is self-intersecting
> Polygons 240 and 352 contain duplicated vertices
> Polygons 240 and 352 are self-intersecting
> Polygons 4 and 264 cross over
> Polygons 4 and 334 cross over
> Polygons 57 and 104 cross over
> Polygons 141 and 142 cross over
> Polygons 168 and 218 cross over
> Polygons 174 and 177 cross over
> Polygons 220 and 240 cross over
> Polygons 224 and 229 cross over
> Polygons 224 and 235 cross over
> Polygons 225 and 240 cross over
> Polygons 266 and 271 cross over
> Polygons 274 and 277 cross over
> Polygons 291 and 304 cross over
> Polygons 325 and 334 cross over
> Polygons 330 and 334 cross over
> Polygons 341 and 361 cross over
> Polygons 352 and 367 cross over
> Polygons 352 and 387 cross over
> Polygons 388 and 390 cross over
>
> I've checked the cross overs, and the reported polygons
> do not seem to have cross-overs at all. For an example,
> just look at the attached file crov_352_387.jpg, plotted as
>
> spplot(refG[c(352,387),],zcol="OBJECTID")
>
> There are many like this: I've put all the polygons with cross-overs in
> matrix crossov. You can check, for example:
>
> spplot(refG[crossov[18,],],zcol="OBJECTID")
> spplot(refG[crossov[4,],],zcol="OBJECTID")
>
> etc.
>
> (BTW, why the following code does not plot anything?:
> for (i in 1:nrow(crossov)){
>       print(crossov[i,])
>       spplot(refG[crossov[i,],],zcol="OBJECTID")
>       readline()
> }
>
> Thanks for any help!
>
> Agus
>
> ------------------------------------------------------------------------
>
>------------------------------------------------------------------------
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070705/1aba2f27/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 21131 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070705/1aba2f27/attachment.jpe>


More information about the R-sig-Geo mailing list