Geospatial analysis made easy with two new spatial functions: MakePoint and MakeLine

For people trying to understand their location data and to see spatial patterns, Tableau is adding two spatial functions that will make analyzing location data easier than ever.

Location data can come in many forms and formats, but one of the most common formats is in separate fields containing latitude and longitude values. This data might reside in an Excel file, CSV, or any other table of data. These values could represent anything—the position of a physical location, object, Wi-Fi hotspot, wildlife, or literally anything else on the planet. For people trying to understand their location data and to see spatial patterns, Tableau is adding two spatial functions that will make analyzing location data easier than ever. The spatial functions are called MakePoint and MakeLine. While their names are self-explanatory, permit me a few paragraphs to showcase what is now possible with maps in Tableau.

Use longitude/latitude fields in a spatial join to map police incidents using MakePoint

Let’s start with MakePoint, a function that will allow you to use latitude and longitude fields in a spatial join. Spatial joins allow you to use points and polygons to join datasets based on their spatial relationship and MakePoint is the function that can...make points! Another way to think about this function is that it turns non-spatial data sources like text files and Excel tables into spatial data sources that allow you to spatially aggregate spatial data. In this example, I am going to explore the city of San Francisco’s open data for crime incidents by neighborhood. To get started, I visited and downloaded a neighborhood shapefile and the latest incident report data as a CSV file. The incident dataset includes latitude and longitude fields and a number of other categories like Police District or Incident Type. My questions are which neighborhood has the most reported incidents and what neighborhoods have the highest risk of theft. Look at how easy it is to answer these questions now. After connecting to the shapefile, I can add a connect to the CSV and use MakePoint in a join calculation to allow me to use Intersects to complete the spatial join.

With the data joined, I can use Number of Records to visualize which neighborhood has the most crime incidents and use a filter to answer my question about theft. Source:

Connecting origins and destinations for flight routes using MakeLine

The second function we added to Tableau is called MakeLine. This function is useful when you want to visualize the connection between two points on a map. If you have ever built an Origin-Destination map or worked with pick-up and drop-off datasets, MakeLine makes connecting the dots simple because you do not have to replicate rows of data or perform any pre-processing, so long as you have the latitude and longitude for the start and end of your data. A great use case for working with origins and destinations are flight routes. You will need the departure city or airport’s latitude and longitude, along with the latitude and longitude for the arrival city or airport. My dataset includes a number of routes between major cities in Asia; using MakeLine I can now visualize the flight routes.
After I create the calculated field, I can simply drop that field on to the canvas and we’re ready for take-off. MakeLine generates geodesic lines, which will display as curved when connecting locations that are far apart on the earth. When working with data at a local/city-scale, like pick-up and drop-off locations for a bicycle-share, the lines will appear straight.

Get more out of your location data to reveal hidden spatial patterns. Spatial calculations make geospatial analysis simple, and remove the need for pre-processing and shaping of data. Spatial functions represent another building block capability in Tableau and we can’t wait to see what you build with it. Members of the Tableau community are already sharing some of their examples. Marc Reid build an interactive dashboard to look at flights from different origin cities.


Jeffery Shaffer

takes some community inspiration to build an exploration of ride-share data using set actions, vector maps, and spatial calculations.

I want to encourage everyone to stay tuned in for the 2019.3 beta as we expect to release more spatial functions for early testing. Until then, go forth and make beautiful maps!