Pitney Bowes
MapInfo Pro™ Monthly Journal
Rummaging in the Toolbox: The Distance Calculator

Rob The Distance Calculator is one of the many useful tools hiding under the MapInfo Professional® tools menu, it is used to calculate the straight line distance from a selected object (or group of objects) to the closest or farthest object(s), selection criteria can be applied to limit the results; the Distance Calculator tool forms the starting point for many common analytical use cases such as "Find My Nearest resources from a location".

We will explore the Distance Calculator functionality through an example, where an organisation has to identify households close to a location that contain individuals that meet a specific demographic profile. This example will use data from the United Kingdom 2011 Census which includes household and population estimates by age and sex for England and Wales along with Output Area boundaries and population weighted centroids.

The Distance Calculator must first be enabled through the Tool Manager as shown in Figure 1 below, this step is only required once if you set the tool to auto load when MapInfo Professional is opened.

Figure 1: Enabling the Distance Calculator in the Tool Manager. 

To display the Distance Calculator tool click on: Tools > Distance Calculator > Run Distance Calculator

Figure 2: The Distance Calculator showing StreetPro® background mapping data from Pitney Bowes Software.

The Distance Calculator calculates the straight line distance between objects in two tables. Starting with an origin and a destination table, distances can be calculated between the full contents of tables or selections. The left hand side of the Distance Calculator dialogue has selection tools that allow objects to be selected spatially from the currently displayed map window, there are controls to switch between map windows and to display the Layer Control to configure layer display. The origin and destination tables are selected on the right hand side of the dialog, the example shows a selection being used as the origin against the Census table (PBS_R1_EW_OA_DEC12_PW) as the destination, the user selects a field from each table to be included in the result, for clarity my example shows a descriptive field however the use of a unique identifier would be better suited to further analysis.

The results of the Distance Calculator are restricted to the requested number of nearest or farthest objects based on any addition criteria that are specified, in the example shown the ten closest objects where the "Person_90_and_over" value is greater than or equal to one. Once all criteria have been entered click "Calculate Distance" to perform the calculations and display the results in the browser section of the dialog. Once calculated the results can be saved and then visualised in MapInfo Professional as line objects, the process can be repeated for different criteria with the results appended to the previous results, or the results can be cleared between each calculation. The Distance Calculator results include origin and destination identifiers, distance and distance unit; any applied selection criteria are also included for easy identification in subsequent analysis, the results are shown in Figure 3.

Figure 3: Distance Calculator results displayed in MapInfo Professional® with StreetPro® UK background mapping © TomTom BV and 2011 UK Census data from Pitney Bowes Software.

The distance calculator operates with points, line or polygons and for clarity my example is based on point datasets, more information on the Distance Calculator tool can be found in the MapInfo Professional help system.

The Distance Calculator tool is a powerful simple to use tool for use cases where straight line distance calculations are sufficient for the analysis. Uses cases that demand distance and catchment area calculation along a road network require the use of more specialised driving region and routing software. Pitney Bowes Software offers desktop to enterprise solutions for this. More info can be found at www.mapinfo.com.

Article by Robert Salmond

When not writing articles for "The MapInfo Professional", Robert is a Presales consultant for Pitney Bowes Software. When not working he likes to ride his push bike so he can stay fit and keep up with his children around the garden.