The function creates Voronoi diagram for each segment in a directed connected river network (sf LINESTRING), where the Voronoi polygons join together at network segment intersections. The function requires package lwgeom and will not work without it.

river_voronoi(river, aoi, riverID = "riverID", verbose = FALSE)

Arguments

river

An 'sf' linestring feature representing a river network.

aoi

An area of interest. 'sf' polygon object. Optional.

riverID

A character string which specifies the name of the column in river containing unique river network identifiers. Defaults to "riverID".

verbose

Whether or not print progress indicators.

Value

Returns an 'sf' polygon object, with a column "ID" corresponding to the river segment IDs.

Details

Creating the segment Voronoi diagram is done in the following steps:

  1. Move starting and ending nodes forward or backwards (respectively) for a small amount to ensure there are no identically placed nodes.

  2. Compute a Voronoi diagram from point cloud of river segment nodes.

  3. Union the individual polygons using river segment ID.

  4. Clip the polygons to the area of interest.

  5. Process erroneous polygons, if any.

The accuracy of the final segment Voronoi diagram is depending on the density of nodes in the river network. Consider densifying geometry e.g. with sf::st_segmentize() function for higher accuracy.