Solving distance(s) to work in QGIS

A couple of days ago I was asked to calculate some distances for people, from where they lived to where they worked…I scratched my head a little and then went to turn on the ArcGIS spatial join tool….but then thought of how this could be done in QGIS. The answer? The Hub Distance tool, part of the MMQGIS set of tools.

I’ll run through how to use this tool below using some arbetuary points and a pretend hospital to “calculate the distance to the hospital”

Let’s consider the image below, there are multiple houses and a hospital. The houses are on one layer and the hospital is on it’s own layer.

Figure 1

Select the “Hub Distance” tool as below:

figure 2

The houses are the SOURCE layer and the Hospital is the DESTINATION layer, there is also the option to set your options for the unit of distance (Note that you should be using a local projection for metres)

figure 3…and process!!

If everything went to plan you should have some lines now connected between the “hub” [hospital] and the houses. The distance will be within a field HUBDist – this can be used for labelling:

figure 4

And don’t forget to adjust the formatting to limit the number of decimal places shown, unless you want 7 decimal places!

figure 5Now, within a matter of minutes, you have a map showing the distances from houses to the hospital….so easy and extremely quick.

figure 6What I really like about doing this in QGIS, is that, unlike ArcGIS where I have to create a shapefile and edit etc, I can hit the “new shapefile” option in QGIS and put the point down in seconds.

Nick D

4 thoughts on “Solving distance(s) to work in QGIS

    1. QGIS has a meltdown….interestingly I haev run this a few times & the result is that normally the locations go to the nearest hospital but it is not reliable.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s