Improving Spatial analysis in Alteryx using Spatial Filters

Alteryx is amazing at processing data fast and especially when performing spatial analysis. Let’s take a fairly common scenario of analysing points that are within a trade area or polygon. The rationale for such analysis can be numerous, such as looking at how many potentially customers are in the near vicinity to a store or determining how many people can be served within a drivetime or distance.

Alteryx is more than capable of serving this function in the below image is a mock up of said approach. I have two inputs one being a SQL table of postcodes with Latitude and Longitude and a Spatial object. The other input is a map input of a point that I use later in the approach to create a 1Km trade area/polygon. I use a Spatial match tool to determine how many of my postcodes are within the polygon.

Approach A – Spatial Match

The answer to the question is 5413 postcodes sit within my 1Km postcode and it took 18.7 seconds. I should caveat that hardware does play a factor so the time may increase or decrease depending on hardware. However, this is still a fast time spatial analysis is well known to be a compute intensive task.

It might seem unlikely that this time could be improved by it can.  The biggest drawback of the previous approach or approach A is that all the Postcodes of the SQL table are brought down from SQL into memory of my machine hardware. This takes time and resources a more efficient and faster approach is using the Dynamic Input tool. This approach takes only 5 seconds and achieves the same result of 5413 postcodes within a 1Km Trade Area.

Approach B – Dynamic Input

How is this achieved you may ask well the answer is within the Dynamic Input Tools. One of the options in the configuration is to use a Spatial Filter. The requirements to use this function is first a polygon to be utilised which I have in my workflow and a Latitude and Longitude field in the SQL table you are using.

Dynamic Input – Configuration

What the Spatial Filter does is use a polygon from the Incoming data stream to analyse if existing latitude and longitude from the SQL table are contained the polygon. Essentially, we are pushing the analysis onto the SQL database and pulling only the results we need. Hence why see a nearly 14 second difference to achieve the same results. As we are not pulling first, all postcodes from the table then performing the analysis.

Approach B does only work if the data is in database that supports spatial functions such as SQL. However, given a significant portion of big data is spatial data it is typical that this data would reside in a database. Therefore, Approach B can significantly improve the performance of your spatial analysis allowing you to gain insight quicker.

Hope you find this blog helpful and seen how easy it is to improve performance of your spatial analysis in Alteryx. Please leave a comment or reach out to me on Twitter @JosephSerpis or on the Alteryx Community and Linkedin.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s