
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Find the stations with more than 30 bikes available
/ 10
Visualize the query results in Geo Viz
/ 10
This lab introduces you to BigQuery GIS. BigQuery GIS allows you to easily analyze and visualize geospatial data in BigQuery.
This is an introductory lab that is intended for data analysts. A data analyst uses BigQuery standard SQL to analyze data trends that inform business strategy and operations. This includes using BigQuery ML to train ML models, to evaluate ML models, and to do predictive analytics.
In this lab you:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
This lab uses a dataset available through the Google Cloud Public Dataset Program. A public dataset is any dataset that is stored in BigQuery and made available to the general public. The public datasets are datasets that BigQuery hosts for you to access and integrate into your applications. Google pays for the storage of these datasets and provides public access to the data via a project. You pay only for the queries that you perform on the data (the first 1 TB per month is free, subject to query pricing details).
Citi Bike is the nation's largest bike share program, with 10,000 bikes and 600 stations across Manhattan, Brooklyn, Queens, and Jersey City. The dataset we use here includes daily Citi Bike trips since Citi Bike launched in September 2013. The data has been processed by Citi Bike to remove trips that are taken by staff to service and inspect the system, as well as any trips below 60 seconds in length, which are considered false starts.
You can start exploring this data in the BigQuery console by viewing the details of the citibike_stations
table.
The Welcome to BigQuery in the Cloud Console message box opens. This message box provides a link to the quickstart guide and lists UI updates.
Click Done.
Query a few rows from bigquery-public-data.new_york_citibike.citibike_stations
to get an understanding of the data stored inside the table. Add the following query into the Query editor text area:
Three columns in this table are relevant to this lab:
Next, run a standard SQL query that finds all the Citi Bike stations in New York City with more than 30 bikes available to rent.
The query clauses do the following:
SELECT ST_GeogPoint(longitude, latitude) AS WKT, num_bikes_available
The SELECT
clause selects the num_bikes_available
column and uses the ST_GeogPoint
function to convert the values in the latitude and longitude columns to GEOGRAPHY
types (points).
FROM bigquery-public-data.new_york.citibike_stations
The FROM
clause specifies the table being queried: citibike_stations
.
WHERE num_bikes_available > 30
The WHERE
clause filters the values in the num_bikes_available
column to just those stations with more than 30 bikes.
The query takes a moment to complete. After the query runs, your results appear in the Query results pane.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted with an assessment score.
Next, visualize your results using BigQuery Geo Viz — A web tool for visualization of geospatial data in BigQuery using Google Maps APIs.
Open the Geo Viz web tool in a new tab on your browser.
Under Query click Authorize.
In the pop-up window click your QwikLabs username to authenticate.
Click Allow on the next page of the dialog to give Geo Viz access to your BigQuery data.
For Processing Location, choose United States (US). When you query a public dataset, choose United States (US) as the processing location because the public datasets are stored in the US.
Click the Run button.
View the output of your query by clicking on Show results. Check that the query results are consistent with your expectations.
For Geometry column, choose WKT if it's not already selected. This plots the points corresponding to the bike stations on your map.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted with an assessment score.
The Style section provides a list of visual styles for customization. Certain properties apply only to certain types of data. For example, circleRadius
affects only points.
Supported style properties include:
Each style may be given either a global value (applied to every result) or a data-driven value (applied in different ways depending on data in each result row). For data-driven values, the following are used to determine the result:
To format your map:
#0000FF
, the HTML color code for blue..5
. Examine your map. The fill color of the points is now semi-transparent.linear
.num_bikes_available
.30
in the first box and 60
in the second.20
in the first box and 450
in the second.Click Apply Style.
Examine your map. The radius of each circle now corresponds to the number of bikes available at that location.
Depending on the resolution of your screen you might need to adjust the Range values to make the dynamic data point circle scaling more obvious.
You have used the BigQuery GIS function to analyze a public dataset and visualized your results with BigQuery Geo Viz.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated November 05, 2024
Lab Last Tested November 05, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one