Alteryx Designer Desktop Discussions

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

Radius of largest circle inscribed in a polygon

Neico
7 - Meteor

I'm working with several UK counties for which I'd like to calculate the largest circle that fall within each polygon. How could I go about this?

Thank you!

9 REPLIES 9
cplewis90
13 - Pulsar
13 - Pulsar

Hello @Neico,

 

I am assuming you have two datasets: one with the UK counties and the other is the circles. You can use spatial match to find all circles intersecting your counties and then use a spatial info tool to identify the length of those circles. Finally use a formula tool and divide the length by 2 which would give you the radius.

Neico
7 - Meteor

Thanks for the swift reply.

No, so far I only have the counties as a shapefile. My goal is to create the circles that entail each polygon (as in the attached picture) to then calculate the radius of each circle. 

Does that still work? If so, could you help specifying a possible solution?

Thanks!

cplewis90
13 - Pulsar
13 - Pulsar

Can you share a sample (1 county) as a dataset to use to try and create something?

Neico
7 - Meteor

Sure, here's the data for the UK. Thank you!

cplewis90
13 - Pulsar
13 - Pulsar

Here is what I came up with.

Radius Circles workflow.PNG

Hollingsworth
12 - Quasar
12 - Quasar

I wrote a macro that calculates the centroid and radius of the largest circle that will fit inside a polygon. Below is a link to the macro in the gallery.

 

https://gallery.alteryx.com/#!app/LabelCentroid/575d2f46aa690a052849012e

 

Let me know if you need assistance.

 

John

John Hollingsworth
Clear Channel Outdoor
Hollingsworth
12 - Quasar
12 - Quasar

Upon review, my macro may not be what you need. Your written requirement was the circles that fall in the polygon, but your attached image show the polygons that fall inside the circles.

My macro calculates the largest circle that can fit inside of a polygon.

John Hollingsworth
Clear Channel Outdoor
Neico
7 - Meteor

@cplewis90: Thank you. I think it works as an approximation, not 100% accurate (see screenshot). But it will suffice for my needs!

Neico
7 - Meteor

 

@Hollingsworth: Thank you, also super helpful to know about!

Labels