get_flightline_polygons: Create convex polygons for flight lines

get_flightline_polygonsR Documentation

Create convex polygons for flight lines

Description

Given an input LAS object, this function returns an sf spatial data frame with a convex polygon for each flight line or, optionally, each combination of flight line and point class. The default is to only consider the ground class (2) and the vegetation classes (3-5). Drawing the resulting polygons grouped by point class (see example below) can help in checking for biased representation of point classes in overlap areas.

Usage

get_flightline_polygons(las, classes = 2:5, group_classes = FALSE)

Arguments

las

A LAS object, e.g. imported using prepare_tile.

classes

Vector of one or more integer codes for point classes to consider. Default is 2:5 (ground and vegetation).

group_classes

If TRUE, separate polygons will be created for each combination of flight line and point class. If FALSE (default), a single polygon is created for each flight line.

Value

An sf data frame with columns flightlineID, Classification (if group_classes is TRUE), and group_classes. The coordinate reference system is set to that of the input LAS object, or to its horizontal component if the input object has a compound (horizontal plus vertical) CRS.

Examples

## Not run: 
library(ggplot2)

fl_polys <- get_flightline_polygons(las, group_classes = TRUE)

# Draw flight line polygons separately for each point class
ggplot(data = fl_polys) +
  geom_sf(aes(fill = factor(flightlineID)), alpha = 0.4) +
  facet_wrap(~ Classification)

## End(Not run)


mbedward/CERMBlidar documentation built on April 10, 2024, 2:05 p.m.