check.ventana | R Documentation |
Checks that the vertices of polygons in a multi-polygon owin
object are listed anticlockwise and, if some are not, tries to correct them.
check.ventana(ventana)
ventana |
A multiple-polygon window with the format |
This functions should be employed after importing shapefiles into owin
objetcs (see vignette). Vertices of the individual polygons in the multiple-polygon owin
objects should be listed anticlockwise to avoid errors in the computations of area overlapp (clockwise listed polygons represent "holes" in spatstat). This functions checks this and, in case that the vertices of some polygons are listed clockwise, tries to revert their order.
A multiple-polygon window with the format owin
of spatstat with the vertices of all polygons listed anticockwise. The order number of the corrected polygons are included in the attribute "malos1". If there has been any polygon whose vertices have not been corrected, their orden number are included in the attribute "malos2": these polygons should be corrected manually.
Marcelino de la Cruz Rot
data(Astragalus)
# For illustrative purposes, make the vertices of some individual polygon to be listed clockwise
Astragalus.malo<-Astragalus
Astragalus.malo$bdry[[14]]<-lapply(Astragalus.malo$bdry[[14]], rev)
# check and correct
Astragalus.corrected<-(check.ventana(Astragalus.malo))
attributes(Astragalus.corrected)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.