calculate distance for each locations

Prepare for sorting by distance