This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I've been struggling to find a way to do the following in Alteryx:
Given a set of contiguous polygons (input 1), I want to be able to cut each polygon into smaller sections wherever any polygon from a second set (input 2) overlaps it. Each resulting polygon would retain the data of the polygon it originally belonged to.
For further clarity, here is input 1 with 15 rows, each containing a shape:
Input 2 is brought in, containing 3 shapes . They sit on top of some of the shapes in Input 1. These 3 shapes, in turn, may or may not overlap each other.
Wherever the shapes of input 2 overlap with input 1, AND wherever one shape of input 2 overlaps another shape of input 2 and then also a shape of input 1, the input 1 shape is split in as many sub-polygons as necessary:
The output is a file similar to input 1 but now with 43 polygons as a result of the "cookie cutting" exercise (as partly illustrated above).
Each new polygon retains the data of its "parent". For example in the above picture, polygons 3,4,5,6,7 will all contain the same data that was originally in the polygon tagged "2" in the previous picture.
The "circle" (input 2) polygons contain no data and are there only for the purpose of slicing the polygons of input 1.
For sure it's possible; I think it requires an iterative macro and it's not a straight forward problem! I thought I resolved it just now but I've found a minor problem which I'll look to fix. However i'm quite busy over the next few days.
Let's see if anyone jumps in but in the meantime I'll keep developing a macro that allows for this.
@Patrick_digan Yes I do indeed, sorry it took so long to reply. The attached package contains a sample of shapes (the squares in my diagram) and target areas (the circles).
@Philip Thank you, I came across your solution in that thread and it does achieve what I need in principle, but I didn't know how to build a workflow that will take every shape in the file and cut the other file accordingly. That is, in a way that is repeatable no matter what number of "cutting shapes" your bring in.
Attached is my attempt at it. I haven't checked out @Philip's macro.
I used a spatial match to get all the intersections. I then summarized that into 1 object and removed this from the original spatial objects. I've added a filter in there at one point in case you want to take out really small areas. I've currently turned it off by checking if 1=1, but you could remove the comments and turn it back on. You'll notice the last record at the very end has 8.04883526561763e-007 Sq Mi, which seems like noise more than anything.
@SergiArtigas It looks like that is exactly what @Philip's macro is doing. It first finds any overlapping areas within each spatial set and then finds the intersections between the two sets. If his macro isn't a perfect fit for your situation, it would at least be a great starting point.