Alteryx’s ability to generate geospatial polylines provides a way to create and customize a hallmark of spatial analytics. Polylines are a series of two or more spatial points (A fancy way of saying points composed of latitude and longitude!) and depict information between the first and last point. They can be used to show transport routes, nearby business competitors, and combined with telemetrics to show foot traffic! The long and the short of it is that the humble polyline has as many uses as a tree has leaves. So how can we use our good friend Alteryx to create and investigate them?

That’s a lot of uses there…

Polyline Cheat Sheet

To make a single line, all you need are two sets of latitude and longitude in a single field for your start and end points respectively.

For complex lines (ie. more than two points), you must specify the order that each point represents in the line via a sequence number in a separate field.

For multiple lines, you must specify a group that each point belongs to in a separate field.

 

Example of building a polyline

(using data modified from Alteryx Community challenge 6)

1. Convert START latitude and longitude points into a Spatial Object using Create Points tool
2. Convert END latitude and longitude points into a Spatial Object using Create Points tool

 

 

3. Split and union the start and end points to a single Spatial Object column

 

 

4. Generate sequence numbers to represent which co-ordinates lie where in the line using Multi-row Formula tool*

 

5. Generate a ‘Sequence Polyline’ using the Polybuild tool**

 

 

6. Investigate relevant properties using spatial info tool

– Use a browse tool to view your lines

 

* The formula used to group by REP name is
if [REP] != [Row-1:REP] then 1

else [Row-1:Sequence] + 1

endif

 

**Things to look out for

Grouping and sequencing

  • Grouping is how the lines are eventually generated
  • Sequencing is how the lines are ordered throughout the journey

 

The polybuild tool can also create polygons as shapes with exactly the same build options as when you create a polyline but by selecting Convex Hull or Sequence Polygon! And if you don’t require the precision of exact co-ordinates… Then you can always draw your own with the Map-input tool ? The options are endless!