Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Find Nearest Outside of Polygon

JoeMapsG
5 - Atom

Hi,

 

Hopefully someone will be able to help me with the following problem I am trying to solve.

 

I have a list of spatial polygons (town boundaries) and then a separate list of locations (centroids), I would like to find the nearest location that falls outside of each polygon (almost all the polygon contains 1-2 of the location centroids. Therefore I need to find nearest, excluding any points that fall within a polygon.

 

Thanks in advance for any help!

 

Joe

2 REPLIES 2
JosephSerpis
17 - Castor
17 - Castor

HI @JoeMapsG you can use the spatial match tool as a filter to first find the locations that fall inside a ploygon then isolate those records from your list of locations then use a Find the Nearest tool with the remaining list of locations to find the nearest from the points that fall outside of a polygon. 

PhilipMannering
16 - Nebula
16 - Nebula

You could also use the Distance Tool and return a distance of zero if point is within the polygon. Example attached.

 

 

Labels
Top Solution Authors