Image
BLOG

Create Engaging Data Visualizations with Google Maps

Pop Quiz: You have a large, rich, geospatial data set you want to display on a Google map. Maybe it’s census data, election results, real estate values, sales performance or natural disaster locations. You’d like to use dynamic, data-driven symbology to present the information in an engaging way. What’s the best way to store and visualize that data?

There are several ways to get geospatial data into the Google Maps JavaScript API. You could use KML, but your data would become public and have limited styling. GeoJSON might work, and you could load that in a Data Layer—but then you’d have to write a bunch of code to create the right styling rules. Since both are static files, wouldn’t it be nice to filter and query for analytics?

At this point, you may be thinking that Google Maps may not be able to handle this. And until recently, I likely would have agreed. I would have recommended a platform like ArcGIS or CARTO for this kind of visualization. Several recent key developments in Google Cloud and Google Maps have changed the story, with help from a novel source: the Uber Visualization team.

deck.gl Google Maps Integration
The Uber Visualization team is doing some really exciting work building open-source frameworks that leverage cutting-edge technology for data visualization. If you’re not familiar, I encourage you to peruse the website and Uber’s GitHub to check out what they’re up to.

One of the libraries maintained by the Uber Vis team is deck.gl. deck.gl is a high-performance visualization library that leverages WebGL to render large quantities of vector data. Combined with a base map, deck.gl is a powerful new way to create engaging, beautiful maps. 

deck.gl has relied on Mapbox GL for its base maps. Then last month, Google announced support for Google Maps JavaScript API base maps in deck.gl. The addition of Google Maps support makes deck.gl a great option for Google Maps Platform customers.

*Check out the deck.gl showcase to see examples of its incredible creative styling capabilities.

So now you have a great new way to visualize data in Google Maps. Instead of using a data layer, you can load up data in a deck.gl overlay. With deck.gl, you can create data-driven styling for GIS layers in JavaScript API. With the visualization addressed, we can move on to data storage and analytic power.

Cloud GIS
One of the great things about running a Cloud SQL database is support for spatial data types directly out of the box. Both the MySQL and PostgreSQL flavors of Cloud SQL have their spatial extensions installed, which means they’re great options for storing geospatial data. At Google Next ‘19, Google announced alpha support for the SQL Server database engine in Cloud SQL. SQL Server has native support for spatial data types, so it too is a strong option. 

But what if a relational database isn’t a good fit? What if you have terabytes or petabytes of data that may not be practical to store in Cloud SQL? For that, there is BigQuery GIS. 

BigQuery GIS is a new set of capabilities that brings spatial data types and functions to BigQuery. BigQuery is a great solution for data warehousing and analytics, and with the addition of GIS functionality, you can use BigQuery to extract spatial intelligence from your data. These features were announced in beta at Google Next ’18, and at this year’s conference, Google announced general availability for BigQuery GIS. 

*For a great example of what you can build with BigQuery GIS, check out Global Fishing Watch’s vessel map.

Together, BigQuery GIS and deck.gl form a powerful new way to create visualizations in Google Maps.

Further Reading
Google’s blog announcing deck.gl integration
Uber Vis team's blog with more details on using deck.gl with Google Maps
Google I/O 2019 "Google Maps Platform: A Deep Dive on Building for Performance and Scale"
Example code on GitHub
Google Next ‘19 “Making Planet Scale Geospatial Processing Possible with BigQuery GIS”

Image
Chris Morabito

Chris Morabito is a software engineer who found a passion for maps early in his career as a computer scientist. He serves our Google Maps team as a Maps and Cloud Engineer and is a certified Google Cloud Professional.