Calculate and summarise selected metrics of building footprint polygons within zones.
fs_nnindex(X, zone = NULL, zoneField = NULL, unit = NULL) # S3 method for sp fs_nnindex(X, zone = NULL, zoneField = NULL, unit = NULL) # S3 method for sf fs_nnindex(X, zone = NULL, zoneField = NULL, unit = NULL) # S3 method for sfc fs_nnindex(X, zone = NULL, zoneField = NULL, unit = NULL)
X | Spatial object with building footprints or their centroid locations. |
---|---|
zone | A spatial polygon object of |
zoneField | (Optional) Column name of unique identifiers in |
unit | character or |
data.table
of zonal indices and values
The nearest neighbour index (NNI) is a measure of spatial clustering. It compares the observed mean neighbour distances with a hypothetical maximum of dispersed observations given the area of the zone. Note that NNI is sensitive to changes in the zone area.
$$ NNI_z = \frac{\bar{NND_z}}{(0.5 * \sqrt{\frac{A_z}{n_z}}})$$, where z is the zone, A is the area, NND is the mean nearest neighbour distance, and n is the count. The value of NNI can range from 0 (fully disperse) to 2.15 (clustered), with values of 1 indicating spatial randomness.
The function uses fs_nndist
to calculate the distance between
centroids of the building footprints within the same spatial zone indicated
by zone
.
Note that this function is provided as a standalone calculation. The
summary measure can be executed from within calculate_footstats
by
specifying what='nndist'
and how='nnindex'
.