check_ring_dir: Polygon rings directions are checked and corrected if asked.

View source: R/check_ring_dir.R

check_ring_dirR 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))



cartogramR documentation built on Sept. 11, 2024, 5:48 p.m.