Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

% of Spatial Polygon Overlapping Another Polygon

andrew_downs
7 - Meteor

Is there any easy way of working out the proportion of one spatial polygon that overlaps with another?

 

I have a number of bespoke trade areas, some of which overlap more than others. I'd like to know for each store, the degree to which there is overlap with other trade areas.

 

Thanks!

8 REPLIES 8
BenMoss
ACE Emeritus
ACE Emeritus

You can certainly achieve that.

 

2018-04-12_10-57-41.png

What I would do is append your trade area stream with itself. 

 

This will create me every single combination. 

You can then use the spatial process tool to build out the 'intersect' object.

Finally you can use the spatial info tool and formula tool to calculate the %.

 

Example attached.

Ben

andrew_downs
7 - Meteor

Marvellous!

Rich_Stebles
8 - Asteroid

I'm trying to star the solution, because it has saved me a ton of time today, but clicking on the star doesn't seem to be doing anything.  So just a quick note to say thanks :-)

mtouiti
Alteryx Alumni (Retired)

Hi guys

 

That workflow published by @BenMoss saved my life. Thanks 

 

I've found another way to calculate the % of overlap without using the Spatial Object Field, only by using the formula tool using the function 

ST_Area(object,"SqMi") which will return the area in the specified units (SqMi here) of the spatial object (Spatial Object).

 

Spoiler
Capture.PNG

 

konrade
7 - Meteor

Is there a way to also do that with lines? Say I have two files with line input and set a buffer around them of 1 mile. If they touch each other, they overlap. Now instead of calculating the percentage of overlap of the area, I want to get the percentage of length that they run close to each other. I tried to solve that with the Spatial Info tool and selecting the length, but somehow it gives me unrealistic values.

 

neilgallen
12 - Quasar

Fascinating problem! I've gotten close, but the distances are still off. I believe it's due to having to 'convert' the lines into ploygons in order to create the intersection...

 

 

p-g
8 - Asteroid

Hi Guys,

 

Thanks for publishing your solutions @BenMoss and @mtouiti. Saved me a ton of time.

 

I stumbled upon the formula function ST_Intersection which reduced the number of tools needed to just 3 (Trade Area, Append and Formula). That's awesome. I am wondering if Multi-Row formula can replicate Append tool action in this case. If that's possible, it would bring down the tools needed to just 2 (Trade Area and Multi-Row Formula).

 

Spoiler
p-g_0-1604931604677.png

 

 

p-g
8 - Asteroid

Have you tried using the Poly-Split tool first to split both lines into multiple points. You can then check for overlapping points and divide them against points that make up each line to come up with the % of length that they run close to each other. Hope this helps! 

Labels