Building map visualization from Druid datastore


I’m experimenting with metabase and trying to build a map visualization, but ran into these issues:

  • For the country map, I guess metabase is assuming there is a column called “country” with the value in ISO 3166-1 Alpha 2 format. Am I able to tell metabase the name of the column? I already have a column “country” which is in a different format.

  • For the PIN map, I would like to use the spatialdimensions I defined on Druid, however, these don’t even show up on the “Filter by” list. Does metabase ignore Druid’s spatialdimensions?

  • If spatialdimensions cannot be used, can I tell metabase which dimensions to use as LAT/LON? I have 2 sets of coordinates per row.

  • Am I able to center the map on a different country? My data points are in Portugal.

Thanks for the help!

Which version are you using. There was some recent change in these visualizations.

I’m using Metabase v0.19.3 and Druid

I suggest to try with a new build from master

We don’t currently support spacialdimensions.

Regarding country maps, you can select which column to use for the map, but clicking on the gear icon for chart settings and picking the column with the key and the column with the metric.

I’ve tried with the master branch and can’t seem to select the right columns for lat/lon or region. Only one options appears called “sum”.

List of columns:

Hmm… in the data model/schema what is the type of “latitude” + “longitude”?

Also for the US region map, all the keys are states and we’re looking for a field with type “states”.

I’m using Druid. AFAIK all dimensions have the type “string”, right? Can I tell metabase that they are of a different type?

I’ve managed to progress a bit, it seems that the view you choose in the outer menu influences the fields you can pick in the Map menu:

I’m more interested in the world map, not limited to the US, but in my experiments the map seems incorrect. My “Country Iso” field is a string and some countries appear to be missing. Which format should be used here? Also, the “Count” field also seems to be badly interpreted (NaN?).

You can go to the “Data model” page in the admin to set types if we haven’t auto-discovered them.

Can you share the query results + the underlying data schema definitions? It’s very difficult to try to unpack what’s going on based purely on the settings dialog information.

I’ve since been able to correctly define the types and I can obtain a map visualization. One of the problems I was having was that there were too many points, and the jvm was throwing OOM exceptions and no point was displayed.

I guess I need some kind of heatmap visualization for so many points.


Huh. how big a result set was this? We should at least a clear error message in this case.

About 20k data points. How much memory would metabase need to plot 20k points in a map?

That’s really strange. How big were the rows you’re returning? 20k rows should be pretty non-dramatic.

@edevil Im planning to give this a try as well. Could you share what you needed to do to get this working ?


We are trying to do the same with Druid where metabase does identify a column as Country but in Map visualisation not showing the distinction. It has generated 5data points (which cannot be configured in metabase)

Map Visualisation

Can you please help to check what can be wrong here? How does it map underlying country value to the map’s country?Please note that Druid does not allow to store column values as geojson.

what’s the table of result values look like?
and what country codes are you using in that column? while we’ll often mark a column as “country” we don’t always know how to transform the contents of the column to the keys in the geojson file.

Thanks for the quick reply Sameer…

Currently countries are stored as simple string values…here is how the table view looks like…

What needs to be done for it to be properly mapped in metabase as country? If we provide the ISO code for a country will it work then?

Yes, ISO country codes are what we use