Visualizing data with maps (2024)

How to use pin maps, region maps, and grid maps to visualize data in Metabase.

This article covers how to visualize data using maps in Metabase. The maps of the United States used throughout this article were created using the Sample Database that comes with every Metabase installation.

Map types

Metabase features three map types:

  • Pin maps mark specific locations.
  • Region maps group data by country or state.
  • Grid maps distribute a large number of points over a specified area.

Any of these map types can be used with our two default map options: the United States and the world. For a different map (for example, one that focuses on a specific region of the world), you can upload a custom map in GeoJSON format.

Visualizing data with maps (1)

If you have a column with two-letter country codes, Metabase will automatically select the world map. If your data contains names of U.S. states, or two-letter state codes, Metabase will select the map of the United States.

Make your data compatible with mapping

If you plan on using a map visualization, you’ll need to make sure your data is compatible with map visualizations in two ways:

  • Field types in your metadata
  • Field types
  • Country codes

To edit metadata, go to your Data Model admin settings. Confirm that all your field types are set as a Location data type. For example, the State and Longitude fields both have their corresponding field type listed, but Latitude has no field type. To add the field type, click the dropdown menu in the Type column and select Latitude.

Visualizing data with maps (2)

To create a world map or US region map, make sure that your country or state codes match the standardized two-letter format specified by the International Organization for Standardization (ISO).

Matches are case-sensitive; if the country or state codes listed in your database are lowercase or contain extra spaces, Metabase won’t recognize them.

Pin map

A pin map represents data geographically using discrete markers, and requires coordinates — latitude and longitude — to generate. Let’s start an example by visualizing the People table found within the Sample Database. Once you’re viewing the table, you’ll notice that this table contains four pieces of geographic information: city, state, latitude, and longitude.

Select Visualization, and scroll to the Map icon. With your latitude and longitude fields set correctly, Metabase will produce a pin map by default, placing markers on the map at those coordinates. The pins are locating customers, but you can also use a pin map to locate businesses partners, company branch locations, or shipping addresses, as long as those records contains coordinates.

Visualizing data with maps (3)

Hovering over a pin provides additional information.

Other cool things you can do with pin maps:

  • Double click to zoom in on an area.
  • Click and drag the map to move to a different area.
  • Click on a pin to drill-through to additional information.

Visualizing data with maps (4)

If your pin is linked to other tables, or there’s too much information to fit in the tooltip, clicking on the point will take you to a details page that displays a list of fields, as well as a list of connected tables. Clicking a relationship to another table directs you to a list of the instances where the current pin and the other table intersect. In this case, Metabase displays orders placed by that person.

Region map

Region maps display data across a geographic area by coloring parts of that area according to a value. Grouping people by region can be a great way to detect patterns in your customer base. Let’s generate a region map using the same People table within the Sample Database. Summarize the data by selecting the green Summarize button at the top righthand corner of your screen. If you count the number of records by State, Metabase will produce a region map, displaying a map of the United States, with the varying shades representing how many records are present for each state.

Here’s a drill-through on Texas to see how user creation has been tracking.

Visualizing data with maps (5)

Region maps require your data to have columns with the (correctly formatted) field type State or Country.

Visualizing data with maps (6)

Like the pin map, you can drill through states, but the interface and options are slightly different. With regional maps, you have data points that have been grouped together by state or country, so drilling through will reveal an action-menu instead of additional details about a single data.

Grid map

Grid maps create a colorful gradient that overlays the map. Grid maps are an excellent way to visualize answers to questions about where most of your customers come from, or where your company is experiencing the most activity. They are also a great alternative to pin maps for huge quantities of data displayed across a single map.

Visualizing data with maps (7)

To create a grid map, you need to bin latitude and longitude.

Click Browse Data from the button at the top of the screen. Select Sample Database, open the People table, and click the green Summarize button in the upper right corner. Scroll down to longitude and as you hover over the column name, and the phrase Auto binned and a plus symbol + will appear on the right.

Clicking Auto binned will open a popover with several binning options. (The bigger the number of degrees, the more area each bin will cover on the map.) Select Bin every 1 degree.

The next step is to scroll to latitude. When you hover, you will again see Auto binned and a plus symbol appear on the right. This time, click on the plus symbol +. After selecting it, repeat the steps you took with longitude: select the binning option.

Visualizing data with maps (8)

There are different ways you can interact with a grid map:

  • Hover over a grid element to reveal its coordinates and how it is grouped.
  • Double click a grid element to zoom in on the map.
  • Click and drag to move within the map.
  • Single click on a grid element and select Zoom in to have its data points appear as separate grid elements.

Visualizing data with maps (9)

Additional features (pin map and grid map)

There are a few more features specific to pin and grid maps to cover:

  • Save as default view
  • Draw box to filter

Save as default view

In addition to the other map features, moving your mouse onto the map, will reveal a couple options in both upper corners. In the upper left corner is a zoom in and zoom out control. In the upper right corner is Save as default view and Draw box to filter.

After using the Zoom in control and refreshing the page, the map resets to the original map display.

Now let’s set a default view. To control the map’s reset position on a page refresh, select Save as default view after you have adjusted your map orientation. This will be the new default view that the map returns to after a page refresh.

To change your default view, simply zoom to your desired view and select Save as default view again; your old default view will be replaced.

Draw box to filter

Filter boxes allow you to filter data by a specific area.

You can click Draw box to filter and mouse over the map. The mouse is now a plus sign. To outline a section of the map, hold your mouse down and drag across the map to create a transparent blue box. Once you’ve outlined your target area, release your mouse, and your map will update to filter for data in the selected area. If you’ve set a default view, the view will remain stationary. If no default view is set, the view will zoom in on the selected area.

Visualizing data with maps (10)

Common problems with maps

Choosing an inappropriate field for map coordinates

If you create a question using the People table and ask for a map visualization, Metabase will let you use the record ID as the latitude or longitude. This is a case of “legal but wrong”, and if the administrator of your Metabase installation hasn’t set field types in the data model, you might be able to use other inappropriate fields as map coordinates with your own data.

Not having a map of the region you need

Metabase ships with maps of the world and of the United States. As the introduction to this lesson said, you can upload other maps through the Admin panel. When you do this, you must specify which property of the map identifies the region; your data must then use exactly the same labels.

Forgetting that pin maps may only show a subset of data

Metabase only shows the first two thousand rows as pins on a pin map, both for performance reasons and because a million pins would be incomprehensible. If your data is sorted in some way, those pins may not be representative of the data as a whole. It’s always worth looking at a few histograms to check your assumptions.

Not summarizing data for region and grid maps

You may not want to show a simple count for each region or cell. Instead, you might want to display the total sales, the average time on the website for each user in that region, or some other statistic. Whatever it is, you have to create the summary you need so that there is one value per region or cell.

When adding a map, the browser stops responding or throws an error

Sometimes the GeoJSON files are too big for your browser to handle, and the browser will stop responding or throw an error when trying to render the map. In these cases, you can use the MapShaper tool to reduce the file size. Simply upload your GeoJSON file and use the slider to adjust the number of shapes to render on the map. The higher the slider, the smaller the file, but you’ll lose some details as the file size shrinks, so you may need to play around with the slider to get the right file size for your map.

Further reading

  • The action menu
  • General info about map types
  • Custom mapping overview
  • Editing metadata
  • Changing visualizations
Next: Almost everything you can do with the table visualization Learn how to set up conditional formatting, mini bar charts, value formatting, and more. Next article
Visualizing data with maps (2024)

FAQs

What are maps in data visualization? ›

Maps visualize location information, i.e. spatial data. Basic maps are commonly used to display multiple locations, show paths or connections between different locations, or demonstrate quantitative values related to a location, as seen in cloropleth maps.

What is data visualization answers? ›

Data visualization is the graphical representation of information and data. By using visual elements like charts, graphs, and maps, data visualization tools provide an accessible way to see and understand trends, outliers, and patterns in data.

How do I choose the right visualization for my data? ›

How to Choose the Right Visualizations
  1. Tabular format is best used when exact quantities of numbers must be known. ...
  2. Line charts are best used when trying to visualize continuous data over time. ...
  3. Bar charts are best used when showing comparisons between categories. ...
  4. Pie charts are best used to compare parts to the whole.

What is a map visualization called? ›

Geovisualization or geovisualisation (short for geographic visualization), also known as cartographic visualization, refers to a set of tools and techniques supporting the analysis of geospatial data through the use of interactive visualization.

What are maps with data called? ›

Thematic maps pull in attributes or statistics about a location and represent that data in a way that enables a greater understanding of the relationships between locations and the discovery of spatial patterns in the data that we are exploring.

What are the two types of data that maps show? ›

The two major types of GIS file formats are raster and vector. Raster formats are grids of cells or pixels. Raster formats are useful for storing GIS data that vary, such as elevation or satellite imagery. Vector formats are polygons that use points (called nodes) and lines.

What is the golden rule of data visualization? ›

This is the golden rule. Always choose the simplest way to convey your information. Identify the relationships and patterns of your data and focus on what you want to show. Depict nominal data.

What is the rule of thumb for data visualization? ›

Data Visualization Tips / Rule of Thumb

Keep it simple: Use clear, concise visualizations that convey the key points without being overly complicated or cluttered.

What are the 5 steps in data visualization? ›

  • Step 1 — Be clear on the question. ...
  • Step 2 — Know your data and start with basic visualizations. ...
  • Step 3 — Identify messages of the visualization, and generate the most informative.
  • Step 4 — Choose the right chart type. ...
  • Step 5 — Use color, size, scale, shapes and labels to direct attention to the key.

Is Excel a data visualization tool? ›

Excel is a powerful, flexible tool for every analytics activity. Combine it with Power BI for broad data analytics and visualization capabilities to easily gather, shape, analyze, and explore key business data in new ways—all in less time.

What is an example of data visualization? ›

The first is the Chart of Biography, which provided a 700-year timeline of famous men, leaders, and philosophers, and drew focus to which men were active in history at the same time. The Chart of Biography, as simple as it is, remains one of history's most important visualizations.

How do you show data on a map? ›

To build a map chart, you will need at least two columns of data. The first column will contain the name of the state, province, or prefecture. The other column will contain the values for each region. Once displayed, the values will be represented by varying shades of color in each region.

What graph is best for showing data? ›

Bar charts are good for comparisons, while line charts work better for trends. Scatter plot charts are good for relationships and distributions, but pie charts should be used only for simple compositions — never for comparisons or distributions.

What is the most accurate map representation? ›

AuthaGraph. The AuthaGraphy projection was created by Japanese architect Hajime Narukawa in 1999. It is considered the most accurate projection in the mapping world for its way of showing relative areas of landmasses and oceans with very little distortion of shapes.

Why is a map the best way to display the information? ›

Maps present information about the world in a simple, visual way. They teach about the world by showing sizes and shapes of countries, locations of features, and distances between places. Maps can show distributions of things over Earth, such as settlement patterns.

References

Top Articles
Latest Posts
Article information

Author: Patricia Veum II

Last Updated:

Views: 6211

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Patricia Veum II

Birthday: 1994-12-16

Address: 2064 Little Summit, Goldieton, MS 97651-0862

Phone: +6873952696715

Job: Principal Officer

Hobby: Rafting, Cabaret, Candle making, Jigsaw puzzles, Inline skating, Magic, Graffiti

Introduction: My name is Patricia Veum II, I am a vast, combative, smiling, famous, inexpensive, zealous, sparkling person who loves writing and wants to share my knowledge and understanding with you.