New script to calculate nearest distance to each feature (on average)