Executing spatial queries