Cartography – What is a Map Showing Closest Distance to a Set of Points Called?

cartographydistance matrixproximity

This is one of those hard problems to Google since I don't know the right words to Google! I have a list of 6,000 retail locations in the US, and I want to know, for any given point, how far away one is from one of them.

I assumed this was a "proximity map," but that seems to mean a few different things. I THINK what I want is something like this McDonald's map from Reddit, but with an infinity decaying radius so that, even in large states where there are no locations, one gets a sense for the distance.

It seems to me there are two strategies:

  1. Take the 6,000 points and run a sort of nearest neighbor algo that shows the radius expand from the nearest location, across the whole country.

  2. Take a map of the country divided into the smallest possible intervals — Census tracts or something — and, for each tract, find the distance to the nearest location. This makes less computational sense, but I'm vague on how the first strategy would work.

In any event, I obviously didn't invent this concept, so if there's a name for it, I'm sure I can find a good QGIS tutorial!

Best Answer

The solution depends on the level of accuracy you desire. For the greatest accuracy, you would plot your points, compute the Voronoi diagram, then for each cell in your raster use the Voronoi diagram to find the closest location and then do an exact computation of the distance from the raster cell to that closest point.

At a (probably) small cost in accuracy you could skip the Voronoi step and use a breadth-first brushfire approach and work outwards from retail location, computing the distance to each raster cell.

You could probably achieve similar accuracy by dividing your data into regions corresponding to the UTM zones and using the scipy function suggested by @Jon in the comments below your question. This has its own complexities, as you need to be careful where the Voronoi cell around a retail location spans a zone. You want all the raster cells for a single retail location to be computed on the same UTM zone even if some cells fall outside the zone.

Finally, if the map is primarily a visualization tool and exact distances don't matter, the method of @Jon is probably good enough for most purposes, esp if you pick a good projection. Alternatively, just showing the Voronoi diagram on the map gives a pretty good sense of how far someone can be from the nearest location. QGIS has a built-in Voronoi function.

Related Question