Spatial analysis · 4 min
Find the nearest store to every customer
Nearest-neighbour joins, distance columns and the areas each store is closest to.
Spatial analysis
The nearest-neighbour join
For every point in one layer, find the nearest thing in another, and copy its name and the distance across. That is a nearest join.
Customers to their nearest store, schools to their nearest hospital, houses to their nearest bus stop: the same question every time.
Lesson notes
Everything from the cards above, on one page to come back to.
The nearest-neighbour join
For every point in one layer, find the nearest thing in another, and copy its name and the distance across. That is a nearest join.
Customers to their nearest store, schools to their nearest hospital, houses to their nearest bus stop: the same question every time.
Nearest as the crow flies
The nearest store in a straight line is not always the quickest to reach. A river or a motorway between them can make another one closer by road.
For planning and a first look, straight-line nearest is quick and usually right. For delivery times, check the close calls with a route planner.
In MapGO
Join columns by nearest in the Process tools takes points as its first layer and anything as the second: points, lines or areas. A point inside an area is 0 away from it.
Shortest lines draws the line from each point to its nearest shape, with its length, so you can see the answer on the map.
Each store's patch
Turn the question round: for every spot on the map, which store is nearest? The answer splits the map into one area per store, called Voronoi areas.
They are a quick way to see catchments, and to spot a gap where a new store would take the most customers.
Questions
What is a nearest-neighbour join?
An operation that gives every point in one layer the columns of the nearest feature in another, plus the distance between them.
What are Voronoi areas?
Areas drawn around a set of points so that every spot inside one is closer to its point than to any other. Also called Thiessen polygons.