Memvisualisasikan poligon GEOGRAPHY BigQuery dengan Looker Studio
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Tutorial ini ditujukan untuk orang-orang yang ingin memvisualisasikan data GEOGRAPHY dari BigQuery menggunakan Looker Studio. Untuk menyelesaikan tutorial ini, Anda memerlukan project penagihan BigQuery. Anda tidak perlu mengetahui cara menulis SQL, dan Anda dapat menggunakan set data publik.
Sasaran
Dalam tutorial ini, Anda akan membuat laporan yang menampilkan keterjangkauan harga properti di negara bagian Washington. Anda akan menggunakan Peta Google untuk memvisualisasikan data GEOGRAPHY yang berasal dari set data BigQuery publik.
Dalam tutorial ini, Anda akan menyelesaikan hal berikut:
Klik Tambahkan untuk menambahkan data ini ke laporan.
Menambahkan Google Maps ke laporan
Hapus tabel di halaman laporan.
Klik Tambahkan diagram.
Di bagian Google Maps, klik Peta bidang.
Mengonfigurasi peta
Peta belum akan ditampilkan. Anda harus menambahkan kolom yang secara unik mengidentifikasi setiap lokasi terlebih dahulu.
Di bagian Lokasi, klik Dimensi tidak valid, lalu pilih geo_id.
Kolom ini mengidentifikasi setiap jalur sensus secara unik.
Di bagian KolomGeospasial, klik Tambahkan metrik, lalu pilih tract_geom.
Kolom ini berisi data GEOGRAPHY BigQuery yang menentukan poligon yang ingin Anda tampilkan.
Peta akan terlihat seperti ini:
Mengapa peta tidak berisi poligon? Peta Google di Looker Studio memetakan 100 ribu titik (sudut poligon) secara default, tetapi kolom tract_geom berisi 911.364 titik. Anda dapat menambah jumlah titik (hingga maksimum 1 juta) atau, untuk mengurangi jumlah titik, Anda dapat menambahkan filter untuk berfokus pada area tertentu. Di tab GAYA di panel properti diagram, di bagian Lapisan Area Bidang, tetapkan Jumlah maksimum verteks poligon ke 1.000.000.
Menambahkan filter county
Di toolbar, klik Tambahkan kontrol.
Pilih Menu drop-down.
Setel kolom Kontrol menjadi county_name, dan untuk Pilihan default, masukkan King.
Sekarang Anda akan melihat semua poligon untuk King County, yang berisi Seattle:
Menata gaya peta
Metrik warna default peta adalah Record Count. Anda juga dapat memilih metrik yang berbeda.
Di bagian Metrik warna, pilih percent_income_spent_on_rent.
Berinteraksi dengan peta
Bergantung pada opsi yang diaktifkan, Anda dapat memperbesar/memperkecil dan menggeser serta melihat jalur sensus tempat orang-orang menghabiskan hampir setengah pendapatan mereka untuk biaya sewa, seperti University District di Seattle:
Mengubah tooltip
Saat mengarahkan mouse ke peta, Anda akan melihat bahwa tooltip menampilkan geo_id, yang tidak terlalu berarti dalam konteks ini:
Anda dapat memberikan tooltip yang lebih berguna kepada pelihat dengan mengubah dimensi Tooltip.
Di laporan, klik Edit.
Pilih peta.
Di bagian Tooltip pada panel properti, pilih lsad_name.
Kolom ini berisi nama jalur sensus yang dapat dibaca manusia:
Menambahkan gaya lain ke peta
Anda dapat menyesuaikan tampilan peta pada tab GAYA. Misalnya, Anda dapat meningkatkan opasitas isi menjadi 80% dan mengubah gradien warna dari biru menjadi merah.
Selamat
Anda telah membuat Peta Google di Looker Studio yang memvisualisasikan data GEOGRAPHY BigQuery.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[],[],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)"]]