Learn R Programming

rsgeo (version 0.1.7)

bounding_boxes: Compute Geometric Boundaries

Description

From a vector of geometries identify different types of boundaries.

Usage

bounding_boxes(x)

bounding_rect(x)

minimum_rotated_rect(x)

convex_hull(x)

concave_hull(x, concavity)

extreme_coords(x)

bounding_box(x)

Value

  • bounding_box() returns a named vector of xmin, ymin, xmax, and ymax

  • bounding_boxes() returns a list of bounding box numeric vectors for each geometry

  • bounding_rect() returns an rs_POLYGON of the bounding rectangle of each geometry

  • convex_hull() returns an rs_POLYGON of the convex hull for each geometry

  • concave_hull() returns an rs_POLYGON of the specified concavity for each geometry

  • extreme_coords() returns the extreme coordinates of each geometry as a list where each element is a named vector of xmin, ymin, xmax, and ymax where each element is a Point geometry of the extreme value

  • minimum_rotated_rect() returns the minimum rotated rectangle covering a geometry as an rs_POLYGON

Arguments

x

an object of class rsgeo

concavity

a value between 0 and 1 specifying the concavity of the convex hull

Details

Note that if you want a convex or concave hull over an entire vector of geometries you must first union or combine them using either combine_geoms() or union_geoms()

Examples

Run this code
lns <- geom_linestring(
  1:20,
  runif(20, -5, 5),
  rep.int(1:5, 4)
)
bounding_box(lns)
bounding_boxes(lns)
minimum_rotated_rect(lns)
convex_hull(lns)
concave_hull(lns, 0.5)
extreme_coords(lns)

Run the code above in your browser using DataLab