The world’s leading publication for data science, AI, and ML professionals.

Unlocking the Power of Route Visualization: 3 Essential Techniques

The must-know techniques for analyzing routes

Photo by José Martín Ramírez Carrasco on Unsplash
Photo by José Martín Ramírez Carrasco on Unsplash

Route visualization is essential to transportation planning, logistics, and supply chain management. In the field of AI and data science, it is used in various applications such as ETA (estimated time to arrival), or fleet optimization.

In the blog, I will go through the top techniques to visualize a route. In order to illustrate the blog, I will take the example of taxi data in the city of Porto. The taxi has IoT devices that emit the location of the taxi every 15 seconds.

For illustration purposes, I will take data related to one taxi trip. The data has the taxi location and speed at each location.

Taxi trajectory data (image by author)
Taxi trajectory data (image by author)

Now let’s use different techniques to visualize the data.

1. Route Polyline – The basic, but the must-have technique

Route polyline is creating, generally, a two-pixel-wide, red line that shows the path or the trajectory.

Route Polyline (image by author)
Route Polyline (image by author)

It is a simple, but very effective technique, to visualize the route taken by the taxi, which is between Palacio de Bolso and HF Tuela Porto. You can also additionally observe that half of the route is along the Douro river, and half of the route is inside the city.

It is always amazing to see how simple tabular data gets transformed into a visual plot with lots of insights!

2. Route Heatmap – Going fancy

Let us make our analysis fancier by using a heatmap. Shown here is the same route, but with red and green spots. The red spots indicates that there are more location points in the data compared to green spots.

Route Heatmap (image by author)
Route Heatmap (image by author)

The visual above, with the red and green spots, on a satellite map, looks like a scene from a thriller movie!

We can observe the places where there is more number of locations points. As the IoT sensors are emitting data every 15 seconds, this means that the taxi is at a stop or going slow. With further analysis , we can conclude that that the taxi is at a stop at the start and end points, as well as going slow at a point which is a turn.

As you can observe that it gives a lot more information compared to the route polyline.

3. Route Marker Analysis – Sprinkling the route with data analysis

Let us now make the route analysis more intelligent by combining it with Data Analysis. There is a speed column in the data, which is desperately waiting to be analyzed! Let us do some justice to the column.

One of the efficient ways to analyze additional data is to use markers. Shown below is the route with markers, which indicate the point of maximum speed.

Route analysis with maximum speed marker (image by author)
Route analysis with maximum speed marker (image by author)

In addition to maximum speed, you can introduce any other Data Science techniques. One interesting analysis you can do is outlier analysis. Shown here is the route with markers indicating outliers on the higher side.

Route analysis with outlier speed marker (image by author)
Route analysis with outlier speed marker (image by author)

One can also compare it with a box plot. Generally, in speed analysis, only the outliers on the higher side are useful.

Boxplot for speed (image by author)
Boxplot for speed (image by author)

Putting markers based on data science algorithms elevates the route analysis. Here you saw an example of speed, but you can introduce markers on various other data, such as acceleration, or any other vehicle sensor data.

Conclusion

Route visualization can be done through simple, fancy, and intelligent techniques. It is useful to master all in order to be effective in solving essential use cases such in the domain of transportation planning, logistics, and supply chain management.

Datasource

The data used for the article is an extract from a dataset available here https://archive.ics.uci.edu/ml/datasets/Taxi+Service+Trajectory+-+Prediction+Challenge,+ECML+PKDD+2015

It can be used for commercial or non-commercial use with the following citation

Moreira-Matias, L., Gama, J., Ferreira, M., Mendes-Moreira, J., Damas, L., "Predicting Taxi–Passenger Demand Using Streaming Data". In: IEEE Transactions on Intelligent Transportation Systems, vol.14, no.3, pp.1393–1402, September (2013)

Please join Medium with my referral link.

Join Medium with my referral link – Pranay Dave

Please subscribe to stay informed whenever I release a new story

Get an email whenever Pranay Dave publishes.

Additional Resources

Website

You can visit my website which is a no-code platform to learn AI and data science from an application and business use-case perspective. https://experiencedatascience.com

Youtube channel

Here is a link to my YouTube channel https://www.youtube.com/c/DataScienceDemonstrated


Related Articles