Alteryx Designer

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

Check if Polygon Crosses Itself

Highlighted
9 - Comet

I have a bunch of polygons and I need to determine if their borders cross themselves.  Like this, as a very simplified example: 

 

EW_0-1592946462302.png

 

Is there a good way to do this with spatial tools? Given how robust the spatial tools are, I suspect it's something simple I'm missing.  I searched some and haven't seen this issue addressed.  It looks like I can't attach a KML file example, hopefully the package export will work.  

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @EW 

 

I would try using the Poly Split tool set to "Regions". This should create a record for each part of a multi-polygon. Make sure you have a unique ID (like a Record ID) on the polygons ahead of time so you can see which ID values are duplicated after the Poly Split process.

 

This case requires an extra step. Because there's no point in the middle there, we need to "flatten" this polygon (it's the term I use, idk if anyone else does). Use a Summarize tool, group by the unique ID, and Spatial>Combine the polygon with itself. This will force Alteryx to rebuild the object as a flat polygon, which adds the point in the middle we need for the Poly Split to work.

 

Check out the attached example to see this in action. 

 

20200623-PolySplit.PNG

Highlighted
9 - Comet

That's so cool!  I never would have figured out the Summarize tool flattens it like that.  I think this solution will work great, thank you.

Labels