Non Overlapping Geography within Alteryx – How to do it like a Pro!

Part 1 – Non Overlapping Geography and Inverse UK Cookie Cutting

So we have all wanted to do it, 10 mile radius around a set of locations and then removed the overlap between them so you are left with trading areas exclusive to a single location. This is great for calculating the serving population to each location, as each population point will only be served by one location.

A Hidden Mickey?
Non Overlapping Polygons within Alteryx

This is achievable easily in Alteryx with Trade Area tool using a specific value radius and checking the Eliminate Overlap box, as shown below.

The concept is great and should give you a great looking map like so…

If you need some locations to play with, see my data sources list, I have included a link to Geolytix Open Supermarkets dataset, great for playing with location analysis.

Voronoi Polygons or Non Overlapping Trade Areas

These polygons are also known as voronoi polygons, a polygon which consists of all points in the plane which are closest to that point over another point. I am always taken back to science when I create voronoi polygons as they remind me of looking at plant cells through a microscope.

But its not all plain sailing

However when you look around the coast line and rivers, islands, etc. we have a little bit of a problem.

Hull, UK – Non Overlapping Boundaries spanning over the River Humber

As you can see around the River Humber here in Hull (UK), the radius of the trading area, expands over the coastline as well as the rivers. This is not possible in the real world. Customers from over the river do not have access to this location, there is no bridge or magical transportation system (its not Disney), so how do we rectify this problem?

There are two steps we need to do in order to complete this like a pro, its easy to leave this and accept a level of error, however we can reduce that error by doing the following:

  1. Remove the sections of the non-overlapping trade areas which span into the sea and rivers
  2. Rebuild the Geography where the trade areas are split from their main store area (I will cover this in Part 2 of this blog)

The first area we need to focus on is removing the sections of the polygons which cross the rivers, we can do this within Alteryx by building a cookie cutter and clipping these areas. This concept is well known within geospatial field, its where we take a boundary and effectively cookie cut the parts we don’t want and remove it, keeping those important parts we need.

To do this in Alteryx in this context, we need to create an inverse of the UK within Alteryx to remove these parts we don’t need along the rivers. Here are the steps to do that.

Inverse UK Boundary Workflow
UK Coastline, ROI & NI and River Thames Boundaries

To achieve this you will need a coastline boundary, this can be as detailed or as generalised as you need, the more detail you have the better for cutting around the coast. It does become more complex the more detail you have so it’s a personal / job specific preference, these boundaries can be found in sources section and you can generalise them in Alteryx beforehand to remove some of the complexity if needed. For this task, I sourced two datasets, Republic of Ireland boundaries as well as mainland UK coastline. I also created my own third boundary file around the River Thames in London, as none of the datasets I found were as detailed as I needed. Good old fashioned digitising, is sometimes the quickest way to get to your goal. I completed this in ESRI ArcGIS Pro, it can be achieved in a MapInput tool too. (See the data sources section at the end for links to the files used)

Point to note: The more generalisation you carry out with your boundary files, the more work you will have to do around the complex coastline of the UK. However the more complex you leave it, the longer it takes to load and process. Its a fine balance, I’ll leave that one in your hands.

Then create a larger bounding box, within a MapInput Tool, which expands beyond the boundaries. This can then be used to create the inverse boundary of the UK. In other words, it’s like cookie cutting out the UK from the bounding box, within Alteryx we would use the Spatial Process and cut 1 from the other.

Inverse UK Boundary – The Perfect Cookie Cutter

This then leaves you with polygons that are now split in two across rivers. Now depending on how detailed your coastline boundaries are will leave you with some polygons which are split and then some further up the river which are not. In the case of Hull below I was happy with where the splits stop as there was a bridge which connected the final polygon.

Hull UK, post cookie cut leaving split regions across the River Humber

So how do we deal with the fact these polygons are now split across the rivers? We know that the population in the highlighted polygons in the image above cannot get across the river easily to be served by that store. So what do we do? We need to reassign these splits, especially those without the store within them to a polygon that has a store within it nearby.

This is why I love spatial analytics. There are concepts called split, touch and intersects as well as area calculation and calculating the number of parts to a region all in Alteryx that can help us with the above predicament.

I will continue this in Part 2 of this blog, however lets recap what we have done here. We have sourced boundary files, locations and created non overlapping boundaries using the trade area tool. Then we have created an inverse of the UK boundary to cut from the non-overlapping boundaries where they span over rivers around the coastline.

There are many ways to achieve this within Alteryx, however I chose this route because time was critical, I needed to be able to update population statistics on many scenarios very quickly.

Data Sources to support you on your journey through Part 1:

Ireland Boundaries – Administrative County Boundaries

UK Coastline Boundary – OS Open Boundary Line

River Thames Boundary

Plotted myself on ArcGIS Pro using Web Mercator projection or can be created in a MapInput Tool if needed.

Geolytix Open Supermarkets Dataset!geodata

One thought on “Non Overlapping Geography within Alteryx – How to do it like a Pro!

Leave a Reply

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

You are commenting using your 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