[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Visualize BigQuery GEOGRAPHY polygons with Looker Studio\n\nThis tutorial is intended for people who want to visualize `GEOGRAPHY` data from BigQuery using Looker Studio. To complete this tutorial, you'll need a BigQuery billing project. You don't need to know how to write SQL, and you can use the public dataset.\n\nGoals\n-----\n\nIn this tutorial, you'll create a report that shows the affordability of rental properties in Washington state. You'll use a Google Map to visualize `GEOGRAPHY` data coming from a public BigQuery dataset.\n\nIn this tutorial, you'll accomplish the following:\n\n- [Create a new blank report](#create_a_new_blank_report)\n- [Add a Google Map to the report](#add_a_google_map_to_the_report)\n- [Configure the map](#configure_the_map)\n- [Style the map](#style_the_map)\n- [Interact with the map](#interact_with_the_map)\n- [Change the tooltip](#change_the_tooltip)\n- [Add more style to the map](#add_more_style_to_the_map)\n\n### Before you begin\n\nIf you don't already have a BigQuery billing project set up, you can [sign up for free](https://cloud.google.com/bigquery/).\n\nCreate a new blank report\n-------------------------\n\n1. [Sign in to Looker Studio.](https://lookerstudio.google.com)\n2. Click **Create** and then select **Report**.\n3. In the **Add data to report** panel, choose **BigQuery**.\n\n4. In the left navigation, choose **CUSTOM QUERY**.\n\n5. Select or enter your billing project ID.\n\n6. Under **Enter Custom Query**, paste the following SQL query:\n\n select\n ct.state_fips_code,\n ct.county_fips_code,\n c.county_name,\n ct.tract_ce,\n ct.geo_id,\n ct.tract_name,\n ct.lsad_name,\n ct.internal_point_lat,\n ct.internal_point_lon,\n ct.internal_point_geo,\n ct.tract_geom,\n acs.total_pop,\n acs.households,\n acs.male_pop,\n acs.female_pop,\n acs.median_age,\n acs.median_income,\n acs.income_per_capita,\n acs.gini_index,\n acs.owner_occupied_housing_units_median_value,\n acs.median_rent,\n acs.percent_income_spent_on_rent,\n from `bigquery-public-data.geo_census_tracts.census_tracts_washington` ct\n left join `bigquery-public-data.geo_us_boundaries.counties` c\n on (ct.state_fips_code || ct.county_fips_code) = c.geo_id\n left join `bigquery-public-data.census_bureau_acs.censustract_2018_5yr` acs\n on ct.geo_id = acs.geo_id\n\n | **Note:** This query retrieves data from BigQuery Public Datasets about US census tracts in Washington state. A census tract is a relatively small subdivision of a county. The query joins the geospatial data about the census tract boundaries with census statistics, such as population, age, income, and housing costs.\n7. Click **Add** to add this data to the report.\n\nAdd a Google Map to the report\n------------------------------\n\n1. Delete the table on the report page.\n2. Click **Add a chart.**\n3. In the **Google Maps** section, click **Filled map.**\n\nConfigure the map\n-----------------\n\nThe map won't appear yet. You'll need to add the field that uniquely identifies each location first.\n\n1. In the **Location** section, click **Invalid dimension** , and then choose **geo_id** .\n 1. This field uniquely identifies each census tract.\n2. In the **Geospatial** **field** section, click **Add metric** , and then choose **tract_geom** .\n 1. This field contains the BigQuery `GEOGRAPHY` data that defines the polygons that you want to display.\n\nThe map should look like this:\n\n\u003e **Why is the map missing polygons?** A Google Map in Looker Studio plots 100K points (polygon vertices) by default, but the **tract_geom** column contains 911,364 points. You can increase the number of points (up to a maximum of 1 million) or, to reduce the number of points, you can add a filter to focus on a specific area. In the **STYLE** tab of the chart properties panel, in the **Filled Area Layer** section, set the **Max number of polygon vertices** to **1,000,000** .\n\n### Add a county filter\n\n1. In the toolbar, click **Add a control**.\n2. Select **Drop-down list**.\n3. Set the **Control** field to **county_name** , and, for **Default selection** , enter **King**.\n\nNow you should see all polygons for King County, which contains Seattle:\n\nStyle the map\n-------------\n\nThe map's default color metric is **Record Count**. You can also choose a different metric.\n\nIn the **Color metric** section, choose **percent_income_spent_on_rent**.\n\nInteract with the map\n---------------------\n\nDepending on the options that you turned on, you can zoom and pan around and notice census tracts where people spend nearly half their income on rent, such as the University District in Seattle:\n\nChange the tooltip\n------------------\n\nAs you mouse over the map, you'll notice that the tooltip shows the `geo_id`, which isn't particularly meaningful in this context:\n\nYou can provide viewers with a more useful tooltip by changing the **Tooltip** dimension.\n\n1. In the report, click **Edit**.\n2. Select the map.\n3. In the **Tooltip** section of the properties panel, choose **lsad_name** .\n 1. This field contains the human-readable census tract name:\n\nAdd more style to the map\n-------------------------\n\nYou can customize the appearance of the map in the **STYLE** tab. For example, you could increase the fill opacity to 80% and change the color gradient from blue to red.\n\nCongratulations\n---------------\n\nYou've created a Google Map in Looker Studio that visualizes BigQuery `GEOGRAPHY` data.\n\nRelated resources\n-----------------\n\n- [Connect to Google BigQuery](/looker/docs/studio/connect-to-google-bigquery)\n- [BigQuery Public Datasets](https://console.cloud.google.com/marketplace/browse?q=geo&filter=solution-type:dataset) (several datasets with geographic polygon data)\n- [Google Maps reference](/looker/docs/studio/google-maps-reference)\n- [BigQuery geography functions](/bigquery/docs/reference/standard-sql/geography_functions)"]]