Alteryx Spatial - Find Nearest

The 'Find Nearest' tool in Alteryx allows you to locate the closest (find nearest) spatial point when compared to a selection of other spatial points. The tool works by first choosing one point (one row) of group A and comparing it all possible points in group B.

First we need to identify our two groups to compare. I have chosen A & B as shown.

Next we need to add these to our Find Nearest input anchors. The tool has two input anchors 'T' and 'U'. U represents our Universe, this will be the list of points we will comparing out T against to find the closest. T represents our targets, each row of T will be compared to every row of U.

In this example I have chosen to input group A into T and group B into U.

The next step is to configure our Find Nearest tool as shown below:

First we need to state our Spatial Object Field for both T and U. As seen on the configuration page, U can also be called from a predetermined file or database. Next we need to select how many points to find, I have selected 1. As well as the distance to find said points, In this example I have selected a range of 2 miles, if a member of T cannot find a member of U within 2 miles of itself it will be unmatched and therefore returned out of the U output anchor, those that match will be returned via the M output anchor as shown:

Once we hit run we can see the output of the M anchor:

Here we can see that within a 2 mile radius, point B has matched with 2 and point C with 3. Accompanied with it's distance and direction.

Whereas the output of the U anchor is as follows:

As points A & D were unable to find a match within a 2 mile radius to any points in group B, their points have simply been returned sad and alone via the U anchor.

The browse tool can also be used to observe the spatial points visually as shown below for the M output browse tool:

Author:
Robson Hemans-Alexander
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab