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)
Top Articles
Is Hero Forge Worth the Cost? A Guide to Custom Miniature Creation - Wizard's Respite
2 openings and one closing ratchet up this Fort Worth restaurant news
Mybranch Becu
Northern Counties Soccer Association Nj
9.4: Resonance Lewis Structures
NYT Mini Crossword today: puzzle answers for Tuesday, September 17 | Digital Trends
Unblocked Games Premium Worlds Hardest Game
Senior Tax Analyst Vs Master Tax Advisor
Vocabulario A Level 2 Pp 36 40 Answers Key
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Large storage units
Aquatic Pets And Reptiles Photos
Regular Clear vs Low Iron Glass for Shower Doors
Hssn Broadcasts
General Info for Parents
Troy Athens Cheer Weebly
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Where does insurance expense go in accounting?
Gma Deals And Steals Today 2022
Finger Lakes Ny Craigslist
Best Uf Sororities
How pharmacies can help
Traveling Merchants Tack Diablo 4
20 Different Cat Sounds and What They Mean
Unionjobsclearinghouse
Cincinnati Adult Search
Bethel Eportal
Hdmovie2 Sbs
Victory for Belron® company Carglass® Germany and ATU as European Court of Justice defends a fair and level playing field in the automotive aftermarket
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
Penn State Service Management
Hannah Jewell
Die wichtigsten E-Nummern
Free Tiktok Likes Compara Smm
Kiddie Jungle Parma
Mrstryst
Smartfind Express Henrico
Family Fare Ad Allendale Mi
Wsbtv Fish And Game Report
Studio 22 Nashville Review
Paperless Employee/Kiewit Pay Statements
Tripadvisor Vancouver Restaurants
Kutty Movie Net
Dragon Ball Super Super Hero 123Movies
How To Customise Mii QR Codes in Tomodachi Life?
Kjccc Sports
The Sports Academy - 101 Glenwest Drive, Glen Carbon, Illinois 62034 - Guide
York Racecourse | Racecourses.net
Campaign Blacksmith Bench
How To Connect To Rutgers Wifi
Latest Posts
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6260

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.