Map visualizations
The map visualizations display results on a geographic map. The query result set must include the appropriate geographic data:
- Choropleth: Geographic localities, such as countries or states, are colored according to the aggregate values of each key column. The query must return geographic locations by name. For an example, see choropleth example.
- Point map: A marker is placed at a set of coordinates on the map. The query result must return latitude and longitude pairs. For an example, see marker example.
Choropleth options
This section explains the options for configuring choropleth visualizations.
To create a choropleth map, your query must return geographic locations by name. You can create maps that display administrative boundaries at the country, state or province, and county or district level. To display on the map, the locality identifiers in your data must match to one of the identifiers available in Databricks. Download and review the following lookup tables to match your data to the available names and abbreviations:
You can use the readable_name
column to help lookup values, but you must use one of the other columns as an identifier.
Use the visualization editor to configure the following settings:
-
Field: The column containing the locations for the map.
-
Geographic role: The format of values in the key column. Choose the format that matches your data. Available formats are listed by regional category:
- Country:
- Name
- 2-letter
- 3-letter
- State/Province:
- Name
- Country-specific
- Subdivision code
- County/City
- Name
- Country-specific
- Country:
If a geographic column value doesn't match one of the target field formats, no data is shown for that locality.
Colors and groups
Colors automatically populate the map in the localities with values in your data set. Click the color swatch to choose a different color.
Group by setting
Click the + in the color section to choose a field to group by. You can apply a transformation by clicking on one of the available options, such as SUM
or MEDIAN
. The map automatically applies a gradient to localities in the chart. To customize the colors, gradient, and chart labels, click the color swatch to show available options.
Point map options
This section describes options for point map charts.
Use the viusalization editor to configure the following settings:
- Latitude: Choose the column that contains the Latitude component of the map coordinates.
- Longitude: Choose the column that contains the Longitude component of the map coordinates.
Color
For ungrouped data, click the color swatch to change the point colors shown on the map. To apply a grouping strategy, click + in the Color section of the visualization editor. You can adjust the automatically assigned colors by clicking the color swatch next to each group label in the editor.
Size
Click + in the Size section to choose a field that reflects quantity, allowing you to display dots of varying sizes based on the data value.