The Distance Calculator tool computes the distance between all objects in a table or between two tables. It then returns the closest or the farthest objects and populates a Browser window with the results.
The Distance Calculator tool (DISTANCECALC.MBX) can be used to calculate the distance from a selected object (or group of objects) to the closest or farthest object(s). You can also specify criteria to limit the results.
Example
The following example shows the closest distances between California customer sites in the US_CUSTG table and cities with over 2 million population.
- In the Layers window, ensure that the US_CUSTG table is the topmost selectable layer. This may mean that you need to clear the Selectable check box for other layers.
- Use the Boundary Selection command to select California (on the MAP tab, in the Selection group, click Boundary Selection from the selection list). This restricts results to origins (in this example, Customers) within the state of California.
- Select Selection from US_CUSTG from the Origin Table drop-down list.
- Select Company for the Origin Table identifying column.
- Select CITY-125 for the Destination table.
- Select City for the Destination table identifying column.
- Select Use the following criteria and specify Tot_pop > 2000000 to target destination cities with a population greater than 2 million.
- In Enter the number of distances to find field enter the number 2 to limit the results to two destinations for each origin.
- Click Clear Results to clear previous results from the Results Browser window; otherwise the new results would be appended to the previously displayed results.
- Click Calculate Distance to run the calculator.
- Click Calculate Distance.