Here are the files for creating a "distance to markets" measure: