Alteryx Designer Desktop Discussions

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

Smallest Possible Circle around Points or Polygon

EW
11 - Bolide

I'm trying to figure out how to get Alteryx to generate the smallest possible circle/buffer around a group of oddly spaced points.  Seems like it should be reasonably simple with spatial tools, but I can't figure it out!  I'm attaching sample data and some attempts that don't quite work.  

 

1.  Median of all points as centroid, radius is distance to furthest point.  

2.  Polybuild Convex Hull, split to points, median of points is centroid, radius is distance to furthest point.

3.  Polybuild Convex Hull, split to points, two furtherst-apart points distance divided by 2 is the radius, centroid is the midpoint. 

 

I've tried a few other variations, but none seem to solve the problem.  In 1 & 2, the circle has extra space and could be shifted and shrunk.  In 3, the circle excludes a point in my test data.   I think I've forgotten all my high school trigonometry, but I'm pretty confident the Alteryx community has a solution! 

5 REPLIES 5
Raj
14 - Magnetar

Try This,

 

calculate the maximum distance between each point
divide it by to create a imaginary point
calculate the distance of all the points from the imaginary point the max is the radius.

EW
11 - Bolide

Thanks @Raj!  I think that doesn't work in my sample data, but it seems like it should!  It's similar to #3 in my original post just without simplifying to a polygon first.  I'm updating my file and attaching it with what I think your solution is as  #4, and it's still showing a point outside of the circle.  

Raj
14 - Magnetar

@EW  Debugged and please find the result attached

please mark accepted if this was required.

EW
11 - Bolide

Thanks @Raj!  I think your workflow really close (and probably close enough for my actual use case) but it does have extra space in the circle vs what's required to surround all points.  I'm curious if there's a way to get it exact.  

 

Extra Space.PNG

Raj
14 - Magnetar

@EW 
I can give it a try although according to my mathematics this becomes the best possibility. 

Labels