check_ring_dir {cartogramR}R Documentation

Polygon rings directions are checked and corrected if asked.

Description

Polygon ring are seen from above: exterior ring counter clockwise, holes clockwise

Usage

check_ring_dir(polygons, check.only = TRUE)

Arguments

polygons

a sfc object which contains simple feature geometry of types POLYGON or MULTIPOLYGON

check.only

a boolean which indicates if the function only checks the ring direction (check.only=TRUE) or checks and corrects the polygon direction (check.only=FALSE)

Value

Either a logical vector which indicates if line i of polygons is in the right direction (TRUE) or not or the corrected sfc object

Examples

  data(usa)
  all(check_ring_dir(sf::st_geometry(usa), check.only=TRUE))



[Package cartogramR version 1.0-7 Index]