Distance Calculator Tool - MapInfo_Pro - 2023

MapInfo Pro Help

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapInfo Pro
Version
2023
Language
English
Product name
MapInfo Pro
Title
MapInfo Pro Help
First publish date
1985
ft:lastEdition
2023-09-12
ft:lastPublication
2023-09-12T16:39:16.995549

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.

For information about how to add a tool to the Tool Manager, see Working with MapInfo Pro Tools.

Using the Distance Calculator Tool

To use the Distance Calculator tool:

  1. Open the table you want to calculate the distance in.
  2. Run the Distance Calculator tool to open the Distance Analysis window. See Running a Tool for details.

    On the MAP tab, in the Options group, click Map Tools, and then click Distance Calculator.

  3. From the drop-down lists at the upper right part of the Distance Analysis dialog box, you specify the origin and destination tables and their unique identifying columns.

    For example, you can calculate the distance between each customer site listed in the US_CUSTG table and the nearest big city listed in the CITY_125 table. The accompanying Layer Control, Select, Zoom, Pan, and Snap buttons function just as they do throughout the MapInfo Pro interface.

  4. When you click Calculate Distance, the results of the distance query are displayed in the Browser window. The results may then be cleared (Clear Results) saved to a table (Save Results), or appended to. To discard the current results and generate new results, select Clear Results before recalculating distances.

    To append more results, change table, column, and other criteria as desired, then click Calculate Distance. The new results will be added to the bottom of the results table.

  5. Optionally, you can also set destination criteria to limit the results. For example, after checking the Use the following criteria check box you could restrict your results according to selected criteria (for example, to cities with populations greater than a specified number).
  6. Optionally, you can restrict the number of destination distances to find for each origin point. The default is 1.
  7. You can also select the display distance units that are used for calculating distances. The default is miles.

    When you click Calculate Distance, the possible destination points are limited to the subset defined by your criteria.

Example of Find Nearest Use

The following example shows the closest distances between California customer sites in the US_CUSTG table and cities with over 2 million population.

  1. Select Layer Control and make sure that the US_CUSTG table is the topmost selectable layer. This may mean that you need to clear the Selectable indicator for other layers.
  2. 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.
  3. Select Selection from US_CUSTG from the origin table drop-down list.
  4. Select Company for the origin table identifying column.
  5. Select CITY-125 for the destination table.
  6. Select City for the destination table identifying column.
  7. After checking Use the following criteria, specify Tot_pop > 2000000 to target destination cities with a population greater than 2 million.
  8. In Enter the number of distances to find enter the number 2 to limit the results to two destinations for each origin.
  9. Make sure you Clear Results to clear previous results from the Results Browser window; otherwise the new results would be appended to the previously displayed results.
  10. Click Calculate Distance.

Notes on Using the Distance Calc Tool to Find Nearest/Farthest

The Distance Calculator tool calculates the distance between all the objects in a table or all the objects between two tables and displays the results in a Browser window. When you are processing distances for Region or Polyline tables, the processing time may be slower, due to the complex nature of the calculation.