Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Calculate common border between two spatial objects

julsto93
5 - Atom

Hi All,

 

I have a file full of spatial objects. My goal would now be to calculate the length of the common border between two touching spatial objects. I can find easily enough all the objects, that do touch each other. However I find it hard to figure out how long the shared border is...

Any input would be very welcome.

 

Best

2 REPLIES 2
T_Willins
14 - Magnetar
14 - Magnetar

Hi @julsto93,

 

Use a Spatial Match tool and bring in one object in the T anchor and the other object in the U anchor.  Set the tool to "Where Target Touches Universe".  Attach a Spatial Info tool to the U output anchor and set to Length (Kilometers) or Length (Miles).  This should give you the distance of the common border.

CharlieS
17 - Castor
17 - Castor

Hi @julsto93 

 

This is an interesting spatial project that takes a couple tricks since the "Touches" relationship doesn't output a spatial object to measure. 

 

- The first trick is knowing that there's a spatial function in the Formula tool (that doesn't exist in the Spatial tools) called ST_Boundary(. This will take a polygon input and output the line object of the polygon border. 

 

- The second important bit of information is knowing what spatial object type will be returned from each type of intersection. Line to line returns a point, so we need polygon to line, which returns the line. Using this information we'll intersect the boundaries from the first step against the original polygons.

 

- Now we have the intersecting lines! The only problem is that depending on how the spatial objects were drawn, parts of the boundary may only match to one side of the match or another. So the Transpose, Summarize, and Join tools you see at the end are finding unique pairs, combining the boundaries from both sides, and applying it to all the original records. 

 

Check out the attached example where I calculate the border lengths of neighboring ZIP polygons.

 

20200309-BorderLength.PNG

Labels