![](https://www.thedataschool.co.uk/content/images/2022/05/1.png)
First we input the bus route data – every row contains a bus stop name, its longitude and latitude, and a sequence number indicating how far along the route the bus stop is.
![](https://www.thedataschool.co.uk/content/images/2022/05/2-1.png)
After changing the sequence field data type from string to numeric, we create spatial object points for the bus stops using the Create Points tool by selecting the longitude and latitude fields.
![](https://www.thedataschool.co.uk/content/images/2022/05/3-1.png)
To create lines symbolising the bus routes, we join the points using the Poly-Build tool. We select the Centroid field that contains the points as the source field, grouping by the route and sequencing by the Sequence field.
![](https://www.thedataschool.co.uk/content/images/2022/05/4-1.png)
With the browse tool we can see the routes drawn out in Alteryx, but Tableau has more options for formatting and details.
![](https://www.thedataschool.co.uk/content/images/2022/05/5.png)
Before exporting the data to Tableau, we calculate the lengths of the routes by using the Spatial Info tool and selecting Length (Kilometres) and the route line field we created.
![](https://www.thedataschool.co.uk/content/images/2022/05/6.png)
Once we’ve exported the data and imported it into Tableau, we can then build our map by double-clicking both latitude and longitude, then adding the Path spatial object field to detail. You will also need to add the route name to Detail to separate the lines according to route. To view the route distance, we add the LengthKm field to Tooltip.
![](https://www.thedataschool.co.uk/content/images/2022/05/7.png)
After reducing the size of the lines, we can now see the different routes more clearly and the length of the route in the tooltip.
Further analysis for this map could involve things like adding highlight actions and filters. For example, if we use a parameter filter we find that the longest bus routes tend to be night buses, which makes sense since there are fewer of them and they would need to cover more ground.
![](https://www.thedataschool.co.uk/content/images/2022/05/8.png)