An iterative algorithm for spatial clustering