Data maps are great tools to combine spatial and statistical data. Grid maps are very useful when associating the size of a geographic area with statistical data related to the area. Let's see how we can make it with Alteryx and Tableau using a dataset about crime in London.
In the first step, we only need the longitude, latitude, spatial object from a .shp file and the values whose density we will explore, so we delete everything else.
To create a Point type spatial object, we use the tool Create Point Tool and select the Latitude and Longitude columns.
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild2.png)
A new column Centroid will be created. This data represents all our spatial points.
To create a grid, we use the Make Grid tool. Here we can define what our grid should look like:
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild3.png)
By default we generate Grids for Each Object. This option creates a grid for each spatial object in the layer and each polygon gets its own grid.
When Clip to boundaries is turned off each grid cell will be the same size regardless of the boundaries of the polygons.
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild4.png)
Using Generate Single Grid for Entire Layeroption we create a single grid that spans up the entire geographic area in order to cover all of the polygons and fills in the space between them.
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild5.png)
Then use a Spatial Match Tool to overlay the original shapes and their data with the grids. We select the "M" output anchor to view the rows from the "T" input that matched a point from the "U" input.
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild6.png)
Use a Summarize tool to group and count the numbers of cases within the grid.
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild7.png)
Then let the Tableau do the rest! For that we should save our result as a .hyper file.
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild8.png)
Open the file in Tableau Desktop, put grid name and the spatial object on details and choose a color and opacity to display the “Count of cases”:
![](https://www.thedataschool.co.uk/content/images/2022/04/Bild9.png)