Reputation: 1
I am trying to find a code that runs through a table of housing building locations (w lat and long data in separate columns), against another table with food place locations, to determine the food place that is closest and the corresponding distance.
Anyone know how to code this such that I don't have to make this calculation manually for each comparison?
So far internet trawling has only provided small-sized comparisons, often 1 to 1.
Upvotes: 0
Views: 17
Reputation: 395
Not sure what your limitations are because if by 'manually' you mean using a 'for' loop then this shouldn't be a massive problem. One way around having to do this many times would be to create a 'reference table' of the distances between all food places and all building locations (one-off, using a loop) that you can then quickly filter and sort.
Upvotes: 0