Skip to content

Map Chart

Map Chart displays data on a map. You can specify locations using latitude/longitude, geohash, geocode, or GeoJSON. The available drawing types depend on the data format.

Data formats

Map Chart can display the following data formats on a map.

Latitude/longitude

Draws objects at the specified latitude/longitude position. Specify numeric columns for latitude and longitude. Available with the following drawing types.

Map Pin
Pin
Map Pin
Pin
Map Bubble
Bubble
Map Bubble
Bubble
Map Heatmap
Heatmap
Map Heatmap
Heatmap
Map Flow
Flow
Map Flow
Flow

* Flow requires two sets (source and target) of latitude/longitude.

Geohash

Draws objects at the position specified in geohash format.

The following drawing types (same as latitude/longitude) draw an object at the center point of the specified geohash.

  • Pin
  • Bubble
  • Heatmap
  • Flow

The following drawing type fills in the area of the specified geohash. (The size of the filled area varies depending on the precision of the geohash.)

Map Mesh
Mesh
Map Mesh
Mesh

Geohash samples

Here are sample geohashes.

GeohashPrecisionExample locationApproximate area size
xn2 charactersAround Tokyo630km × 500km
xn73 charactersCentral Tokyo78km × 78km
xn764 charactersTokyo Station area20km × 10km
xn76u5 charactersAround Tokyo Station2.4km × 2.4km
xn76ur6 charactersNear Tokyo Station610m × 300m
xn76urx7 charactersClose to Tokyo Station76m × 76m
xn76urxk8 charactersAround Tokyo Station19m × 9m

BigQuery example

In BigQuery, you can use the ST_GEOHASH function to convert latitude/longitude data to a geohash. Converting to a geohash allows more efficient area-based aggregation and grouping than handling latitude/longitude individually.

The following example uses BigQuery's ST_GEOHASH function to convert latitude/longitude data to a geohash.

sql
SELECT
  ST_GEOHASH(ST_GEOGPOINT(longitude, latitude), 6) AS geohash,
  COUNT(*) AS station_count
FROM
  `bigquery-public-data.new_york_citibike.citibike_stations`
GROUP BY
  geohash
ORDER BY
  station_count DESC

Geocode

Fills in the area associated with a geocode. Available with the following drawing type.

Map Area
Area
Map Area
Area

Specify a geocode using a string in one of the following formats.

GranularityGeocode formatGeocode example
Country2-letter country code
(ISO 3166-1, uppercase)
JP
Prefecture (Japan only)"JP-" + 2-digit prefecture code
(JIS X 0402)
JP-13
Municipality (Japan only)"JP-" + 5-digit municipality code
(JIS X 0402)
JP-13101
First 2 digits of postal code (Japan only)"JP-POST-" + first 2 digits of postal codeJP-POST-10
First 3 digits of postal code (Japan only)"JP-POST-" + first 3 digits of postal codeJP-POST-100

The geospatial data used to fill areas is a lightweight, processed version of the following sources.

A geocode that's valid in format but not included in the above data can't be drawn.

Geocode samples

Here are sample geocodes. See the CSV file of available geocodes for the full list of available geocodes.

GeocodeName
USUnited States
JPJapan
JP-01Hokkaido
JP-02Aomori Prefecture
JP-03Iwate Prefecture
JP-01100Sapporo City
JP-01101Sapporo, Chuo Ward
JP-01102Sapporo, Kita Ward
JP-01103Sapporo, Higashi Ward
JP-01202Hakodate City
JP-01203Otaru City
JP-01204Asahikawa City
JP-POST-10Postal codes 10X-XXXX
JP-POST-100Postal codes 100-XXXX

GeoJSON

Draws geometry data specified in GeoJSON format on a map. Available with the following drawing types.

Map Polygon
Polygon
Map Polygon
Polygon
Map Polyline
Polyline
Map Polyline
Polyline

Specify JSON of the following geometry types as a string column.

  • Point
  • LineString
  • Polygon
  • MultiPoint
  • MultiLineString
  • MultiPolygon
  • GeometryCollection

GeoJSON sample

json
{
  "type": "Polygon",
  "coordinates": [
    [
      [-73.9812, 40.7681],
      [-73.9581, 40.7681],
      [-73.9581, 40.8007],
      [-73.9812, 40.8007],
      [-73.9812, 40.7681]
    ]
  ]
}

BigQuery example

In BigQuery, you can use the ST_ASGEOJSON function to convert geometry data to GeoJSON format. The following example converts the county_geom column of the bigquery-public-data.geo_us_boundaries.counties table to GeoJSON format.

sql
SELECT
  * EXCEPT (county_geom),
  ST_ASGEOJSON(county_geom) AS county_geom
FROM
  `bigquery-public-data.geo_us_boundaries.counties`
WHERE
  state_fips_code = '36'  -- New York

If the size of the geometry data you want to draw is large, it might hit the size limit for SQL run results and cause an error. In that case, you can use the ST_SIMPLIFY function to simplify the geometry data and reduce its size. Large geometry data also affects rendering performance, so simplify it to the minimum size necessary.

sql
SELECT
  * EXCEPT (county_geom),
  ST_ASGEOJSON(ST_SIMPLIFY(county_geom, 1000)) AS county_geom
FROM
  `bigquery-public-data.geo_us_boundaries.counties`
WHERE
  state_fips_code = '36'  -- New York

Usage limitations

Map Chart uses WebGL to render maps, which brings the following limitations.

  • It can't be drawn in browsers that don't support WebGL.
  • Because of limits on the number of WebGL contexts, trying to render many map charts at the same time might discard charts that were rendered earlier.
    • Redrawing restores the display, but be careful not to have too many map charts on a single page.