A generalization of Kendall’s tau for spatial data