Calculate the entropy of rotation angles for building footprint polygons within zones.

fs_angle_entropy(X, index = NULL, col = NULL, normalize = TRUE)

# S3 method for sp
fs_angle_entropy(X, index = NULL, col = NULL, normalize = TRUE)

# S3 method for sf
fs_angle_entropy(X, index = NULL, col = NULL, normalize = TRUE)

# S3 method for sfc
fs_angle_entropy(X, index = NULL, col = NULL, normalize = TRUE)

Arguments

X

Spatial object with building footprint polygons

index

A string identifying a column within X which provides a zonal index for summarising values. Alternatively a vector of indices can be provided. If omitted, all observations in X are assumed to be within one zone.

col

column name within X with pre-calculated area measures

normalize

A logical value indicating whether to normalize the entropy. Default is TRUE.

unit

character or units object to define area. Default is NULL which will use the units of the spatial reference system

Value

data.table of zonal indices and values.

Details

This measure uses the angle of the minimum rotated rectangle enclosing each footprint polygon. Entropy is an information criteria measure. When summarising the angles of footprints, higher entropy values may suggest less formally planned or zoned areas. The entropy calculation uses the common Shannon's Entropy. The normalization step produces an indicator for how much a zone departs from a grid. This metric is based on work by Boeing (2019).

Note that this function is provided as a standalone calculation for convenience. The same summary measure can be executed within calculate_footstats by specifying what='angle' and how='entropy'.

References

Boeing, Geoff (2019). "Urban spatial order: Street network orientation, configuration, and entropy." Applied Network Science, 4(67), https://doi.org/10.1007/s41109-019-0189-1.

Examples

data("kampala", package="foot") b <- kampala$buildings # assign random groups idx <- sample(1:10, nrow(b), replace=T) angles <- fs_angle_entropy(b, index=idx, normalize=FALSE)
#> Error in UseMethod("as_geos_geometry"): no applicable method for 'as_geos_geometry' applied to an object of class "c('XY', 'POLYGON', 'sfg')"
angle_norm <- fs_angle_entropy(b, index=idx, normalize=TRUE)
#> Error in UseMethod("as_geos_geometry"): no applicable method for 'as_geos_geometry' applied to an object of class "c('XY', 'POLYGON', 'sfg')"