0

The following set of commands should plot markers on a world map:

import datalab.bigquery as bq

 %%sql --module geo_data
    SELECT
      userLat,
      userLon
    FROM
      [project_id:datasource.table]

%%chart geo --data geo_data

The query returns ~180k rows and when run on a local version of datalab on my macbook with 8GB RAM it never manages to produce the chart. I've only since discovered that the high number of records appears to be the problem, when I add LIMIT 100 to the end of the query the chart is produced rapidly.

What prevented the ~180k records from being plotted?

goose
  • 2,502
  • 6
  • 42
  • 69

1 Answers1

2

Datalab charts are powered by Google Charting APIs - which don't have the power to plot ~180k records.

Docs for the map viz, underlying this chart:

https://developers.google.com/chart/interactive/docs/gallery/map

Felipe Hoffa
  • 54,922
  • 16
  • 151
  • 325
  • Muchos gracias for the response. Is there a "go-to" approach if you feel you need to do this, basemap? Or would a more common approach be to re-formulate your data into a less granular form? I ask because as I'm learning how to create more complex visualisations it's difficult to be sure whether my approach is flawed or my execution. – goose Feb 16 '17 at 08:21
  • depends on your restrictions (you want to do it in datalab?) see http://minimaxir.com/2015/08/nyc-map/ and other questions on Stack Overflow – Felipe Hoffa Feb 16 '17 at 08:52
  • I'm not set on using datalab, but I am looking for a tool that I can adopt as a go-to data analysis suite. Thanks – goose Feb 16 '17 at 08:53