check.ventana: Checks for Anticlockwise Vertices

Description Usage Arguments Details Value Author(s) Examples

View source: R/check.ventana.R

Description

Checks that the vertices of polygons in a multi-polygon owin object are listed anticlockwise and, if some are not, tries to correct them.

Usage

1
check.ventana(ventana)

Arguments

ventana

A multiple-polygon window with the format owin of spatstat.

Details

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.

Value

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.

Author(s)

Marcelino de la Cruz Rot

Examples

1
2
3
4
5
6
7
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)

overlapptest documentation built on March 16, 2021, 1:08 a.m.