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

Agustin Lobo Agustin.Lobo at ija.csic.es
Thu Jul 5 18:16:19 CEST 2007


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
-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster


-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crossov.rda
Type: application/octet-stream
Size: 191 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070705/81e7bb97/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crov_352_387.jpg
Type: image/jpeg
Size: 21131 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070705/81e7bb97/attachment.jpg>


More information about the R-sig-Geo mailing list