Returns one multipolygon per input geometry, whose parts are that geometry's triangles. The output has the same length as the input.
Details
A constrained triangulation keeps the input's edges and returns only the triangles that fall inside the geometry. An unconstrained triangulation triangulates the convex hull of the input's vertices, ignoring its edges, so it may cross holes and concavities.
A null geometry, or one that cannot be triangulated, becomes a null element.
See also
Other triangulate:
ga_triangulate_earcut()
Examples
fp <- system.file("shape/nc.shp", package = "sf")
nc <- as.data.frame(read_shapefile(fp))
# constrained keeps the triangles inside the county boundary
tri <- ga_triangulate_delaunay(nc$geometry)
tri$length
#> [1] 100
# unconstrained fills the convex hull instead, so it covers more
hull <- ga_triangulate_delaunay(nc$geometry, constrained = FALSE)
head(as.vector(ga_unsigned_area(tri)), 3)
#> [1] 0.11428350 0.06139976 0.14301628
head(as.vector(ga_unsigned_area(hull)), 3)
#> [1] 0.12484563 0.07437819 0.15586877