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

Create Contiguous Spatial Object Zones Using Formula Tool

ddavis216
6 - Meteoroid

Hi:

 

I am trying to create "Zones of Opportunity" based on a high z-score. So I would like to combine block groups that are contiguous AND are have a z-score greater than two. With the attached image, I used a Filter tool first then the "ST_Touches" component in the Formula tool, however it is still returning spatial objects (in this case block groups) that are not touching any other blocks with a 2 or higher.

 

Can someone verify if I should use an alternate Formula tool or if I need to modify this one?

 

Thanks,

Donny

7 REPLIES 7
NicoleJohnson
ACE Emeritus
ACE Emeritus

From the image you attached, I think your formula might be comparing spatial objects only to themselves, if you're using the same field in both parts of the formula?

 

Might need more info about your process and what you want the desired output to look like, but could you use the summarize tool to combine your blocks? There is an action for SpatialObjCombine that might be what you're looking for? Blends your spatial objects together to create "zones" of combined individual objects... and then if you wanted them split back out into separate records for each zone, add a Poly-Split tool after it to separate them into Regions. Does that help?

 

NJ

Philip
12 - Quasar

Hi @ddavis216

 

If I understand your needs correctly, the Formula Tool won't do what you want. Instead, you need the Summarize Tool. This will create a single record with all zones of opportunity present. If you need the polygons separate, you can add a PolySplit Tool. I've attached the workflow if you want to see.

 

Let me know if there is a missing piece or have additional questions.

ZonesOfOpportunity.png

 

Philip
12 - Quasar

Sorry, @ddavis216, I reread the requirements this morning and realized I misunderstood. 

 

You need the Spatial Match Tool to find touching polygons, then use a Filter Tool to remove any polygons that returned as touching themselves (self-matches), then use a Unique Tool to retain only a single polygon for each input (if a polygon touches multiple other polygons, it will return multiple records for each match), and finally a select tool to clean up the results.

ZonesOfOpportunity2.png

ddavis216
6 - Meteoroid

Thank you!

ddavis216
6 - Meteoroid

Hi Philip:

 

One additional question...How can I combine the adjacent polygons into one contiguous polygon for each "zone." I've tried a number of functions including Summarize, Formula, and Combine (Spatial), but it continue to treat them as separate polygons. 

 

Thank you,
Donny

Philip
12 - Quasar

It depends. Do you need to know the identifiers of the polygons that went into creating that zone? If not, then use Spatial->Combine in the Summarize Tool. This will create a single record with all the zones of opportunity included. If you need contiguous area polygons as individual records, use the Poly-Split Tool with regions selected.

 

Contiguous areas 3.png

Philip
12 - Quasar

In case you did want to know which of the original polygons fit into each region, here is one method. It applies a negative buffer to the input polygons to shrink them a bit so that the Spatial Match Tool can use the Contains logic, then concatenates the input polygon IDs using the Summarize Tool to list which input polygons go into the contiguous regions.

 

Note that I applied the Poly-Split Tool on the input polygons so that complex polygons that contain two polygons for one spatial object are broken into separate regions. This is so that the Contains logic works. If the contiguous region polygon checks to see if it contains the complex polygon composed of two separate regions, one of which lies outside the contiguous region, it will return negative. (Hope this makes sense!)

 

Contiguous areas 5.png

Labels