Unlock the Power of Location Intelligence: Discover the Benefits of Spatial Indexing
In the past, the most common method of displaying data on a map was through aggregation by administrative units. However, as companies strive to gain insights from their data, alternative methods of visualization are emerging, such as using the spatial index on regular grid cells. This approach has its own advantages and limitations, which will be discussed in this article. We will also explain how to implement this technique using CleverMaps and how it can benefit your location intelligence analysis
Grid, H3 grid, hexbins… Buzzwords or real helpers?
The need for visualizing data in a different way then aggregated to administrative units has been discussed for quite some time. If you consider the size and shape of municipalities, which are the most often used granularity when visualizing data, their geometrical aspects are rarely comparable. And even if two municipalities have a similar size, shape, and an equal number of inhabitants, can they really be considered the same? When visualizing the data aggregated to municipalities, it will certainly seem so. Switching the granularity to grid will sometimes make you more surprised than you thought you were going to be. See these pictures for example.
These are two neighbouring municipalities in the Pardubický region in the Czech Republic, Rosice and Chroustovice. On the level of municipalities, these two look very similar, and they both have around 1 300 inhabitants. However, visualizing the same information on a hexagonal grid will tell a different story.
In the right picture, Rosice displays a pivotal cluster of people, surrounded by three smaller clusters. On the other hand, Chroustovice exhibits an uneven distribution of residents, lacking a dominant center. While a more detailed administrative unit may partly address this issue, even with statistical sectors or basic residential units, visualizing population distribution remains challenging. In contrast, the hexagonal grid facilitates visualization at any desired level, providing valuable insights.
This example highlights the power of grid visualization, with numerous similar cases awaiting exploration. Before delving into further examples, let's briefly trace the development of grid visualization to its present state.
Unveiling the Perks of the Hexagonal Grid
As mentioned before, talks about visualizing spatial data in a grid have been around for a while. The first attempts used a triangle and square as the grid shape. An important project using a square grid was the Eurostat Population mapping, which collected data about the population in the European Union member states on the level of 1km2 squares. This way of collecting and visualizing data also helped the Eurostat data team overcome one of the biggest challenges of gathering data across Europe: the varying size of municipalities in the member states. Grid mapping enabled them to compare areas with each other without needing to adjust the population counts based on the municipality area.
Over time, the shape of squares turned out to be ineffective, especially when analyzing movement, because, with squares or triangles, the distance between neighbours is different. Therefore, squares were replaced with hexagons, which have the property of expanding rings of neighbours approximating circles and are more optimally space-filling. On average, a polygon may be filled with hexagon tiles with a smaller margin of error than with square tiles. The hexagons also tick all the other boxes - they are a regular shape, easy to construct, and for some people, are visually even more appealing than squares. Also, compared to the complicated polygons of administrative units, hexagons always consist of six-coordinate pairs only, which makes joining them with other statistical data a very straightforward process.
There are a few global hexagonal grid systems that all use a different hierarchy and way of spatial indexing. In the last few years, however, an H3 grid system developed by Uber (yes, the company that gets you places also has a very competent team of data developers) has established itself as the most used for cartographical purposes for numerous reasons. The spatial hierarchy is the most significant advantage of using H3 in cartography and location intelligence.
Each cell has seven child cells below it in this hierarchy, which goes on to level 16, represented by a grid size of 0,895 m2. Another strong reason for using H3 grid is the shape of the borders between hexagons, which more accurately resembles real geographical features such as rivers or coastlines. If you consider the shape of cells in the regular square grid, each border will have an angle with the neighbouring cell equal to 90 degrees, which is rare to see among all natural features of our planet. Therefore, when mapping the population along the coast, H3 would be the visualization method to go for!
Fig. 1: A parent hexagon approximately contains seven children. (source: https://h3geo.org/)
Turning your data into hexagonal grid
At this moment it is clear that aggregating data to hexagonal grid cells has advantages that cannot be overlooked. However, the all important blocker that used to stand between deploying hexagons into analysis was the grid usability. If you are working in a GIS software, turning your map from one type of visualization to the other would require some work done by a GIS analyst. And this is where CleverMaps comes in handy, because our platform recently added the native H3 grid support and using the hexagons is now a matter of seconds. Let’s see how easy it is to set up the grid visualization in CleverMaps.
The most common use case will be visualizing a point dataset with hexagons instead of a dot map or a heatmap. In CleverMaps, no additional computations are required to do that. All you need to do is create an H3 grid dataset file specifying the zoom level of the H3 grid that you wish to visualize your point dataset on, as you can see in Fig. 2, and then add a line into your point dataset with reference to this H3 grid dataset. This is demonstrated in Fig. 3.
Fig. 2: H3 grid dataset with resolution 9.
Fig. 3 Adding H3 geometry into a point dataset.
These two steps are the only ones needed to turn a dotmap visualization into a hexagonal grid visualization in CleverMaps. Simple, isn’t it? And we didn’t even get to the best part yet. Because just like this, you can create H3 grid dataset on as many resolutions as you need to and CleverMaps will use those as granularities and will enable you to change between the levels of visualization according to your needs. So just as easily as you switch between districts, municipalities and statistical sectors, you can switch between levels of hexagonal grid and visualize your data on any level that suits your needs. From now, a single point dataset is the only thing required for your analysis. And also, CleverMaps started to incorporate the native H3 grid into some of our products which you can use to analyze potential locations for your business. Let’s see one of them in action!
Getting more value from data with CleverMaps Enhanced grid
Since implementing the H3 grid into projects is now so simple, we provide our customers with it. We also put our heads together and developed a product that could help our customers search for potential new business locations. We called this product “CleverMaps Enhanced grid”, and we believe that it provides you with most of the features you might need when targeting your business. On resolution 9 of the H3 grid (cell edge length approx 175 m) it contains the demography of the cell, including gender structure, age structure with 5-year age groups and a total number of inhabitants, land use and then various information about points of interest in the surroundings or the cell distance from them. And, of course, there are loads of other data regarding purchasing power, consumer segments, etc., that we can add to the Enhanced grid to better serve your needs. You can find this data in our Data Marketplace.
Using the Enhanced grid on our platform is possible in several ways. For example, suppose you are looking for a place in a city with more than 10 000 inhabitants, having a bus stop and a restaurant closer than 500 meters. The most common way to find spots like this would be to look at the potential destinations in our application. There you can search for a desired destination with the help of our filters. However, if that’s convenient for you, CleverMaps makes it possible to use only the data and query it from anywhere. So, for example, you can create your own data app on a platform like StreamLit and then use our data aggregated to a grid to get information about any location you are interested in. Also, we can handle a request on evaluating data around given locations, so if you have a business network and want to enrich that network with the data from the Enhanced grid without any job on your side, CleverMaps is also ready to provide that analysis for you.
Fig. 4 Potential selected locations in Hradec Králové based on population in the grid cell
Site selection using various visualizations and granularity levels
Looking for a potential new location for a business is very effective when using a grid and administrative units on different levels of granularity. It doesn't matter whether you are opening a new branch or relocating your current one; the first step you will be doing is to evaluate the market saturation, which is one of the most common use cases. In some cases, analyzing market saturation on the same visualization and granularity level might make less sense than searching for a new location. This is when switching between granularities in CleverMaps is a significant advantage. For example, in Fig. 5, you can see the market saturation analysis on the level of municipalities and city districts in Prague. Straightaway you can see two city districts with the potential for five new shops.
Fig. 5 City districts visualized by the number of potential new shops.
Fig. 6 Potential locations for a new shop visualized with a grid.