Consider adding a function to restrict nearest neigbhour distances to be calculalted within a spatial zone (e.g. admin unit). This can use the existing fs_NNdist and restrict the search objects ('Y') to within the zone (based on an intersection). This would involved repeated calls to the distance function for each spatial zone, which could be a bottleneck.
Note: as of v0.5 the NN index implemented during calculate_footstats/bigfoot now restricts neighbours to be within the spatial zone. The stand-alone function does not restrict by default.
Consider adding a function to restrict nearest neigbhour distances to be calculalted within a spatial zone (e.g. admin unit). This can use the existing fs_NNdist and restrict the search objects ('Y') to within the zone (based on an intersection). This would involved repeated calls to the distance function for each spatial zone, which could be a bottleneck.