公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.FeatureCollection.loadBigQueryTable
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
从 BigQuery 表中读取数据,并将结果显示为 FeatureCollection。
用法 | 返回 |
---|
ee.FeatureCollection.loadBigQueryTable(table, geometryColumn) | FeatureCollection |
参数 | 类型 | 详细信息 |
---|
table | 字符串 | BigQuery 表的路径,采用 `project.dataset.table` 格式。 |
geometryColumn | 字符串,默认值:null | 要用作主要地图项几何图形的列的名称。如果未指定,系统会使用类型为 GEOGRAPHY 的第一列。 |
示例
Code Editor (JavaScript)
// Load stations from the New York Subway System.
var features = ee.FeatureCollection.loadBigQueryTable({
table: 'bigquery-public-data.new_york_subway.stations',
geometryColumn: 'station_geom',
});
// Display all relevant features on the map.
Map.setCenter(-73.90, 40.73, 11);
Map.addLayer(features,
{'color': 'black'},
'Stations from New York Subway System');
// Print all stations in the "Astoria" line.
var line = features.filter(ee.Filter.eq('line', 'Astoria'));
print(line);
Map.addLayer(line,
{'color': 'yellow'},
'Astoria line');
Python 设置
如需了解 Python API 以及如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
import ee
import geemap.core as geemap
Colab (Python)
# Load stations from the New York Subway System.
features = ee.FeatureCollection.loadBigQueryTable(
table="bigquery-public-data.new_york_subway.stations",
geometryColumn="station_geom")
# Display all relevant features on the map.
m = geemap.Map()
m.set_center(-73.90, 40.73, 11)
m.add_layer(
features, {'color': 'black'}, 'Stations from New York Subway System')
# Print all stations in the "Astoria" line.
line = features.filter(ee.Filter.eq('line', 'Astoria'))
display(line)
m.add_layer(line, {'color': 'yellow'}, 'Astoria line')
m
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# ee.FeatureCollection.loadBigQueryTable\n\nReads data from a BigQuery table and presents the results as a FeatureCollection.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------------------|-------------------|\n| `ee.FeatureCollection.loadBigQueryTable(table, `*geometryColumn*`)` | FeatureCollection |\n\n| Argument | Type | Details |\n|------------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| `table` | String | Path to BigQuery table in a \\`project.dataset.table\\` format. |\n| `geometryColumn` | String, default: null | The name of the column to use as the main feature geometry. If not specified, the first column with GEOGRAPHY type will be used. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load stations from the New York Subway System.\nvar features = ee.FeatureCollection.loadBigQueryTable({\n table: 'bigquery-public-data.new_york_subway.stations',\n geometryColumn: 'station_geom',\n});\n\n// Display all relevant features on the map.\nMap.setCenter(-73.90, 40.73, 11);\nMap.addLayer(features,\n {'color': 'black'},\n 'Stations from New York Subway System');\n\n// Print all stations in the \"Astoria\" line.\nvar line = features.filter(ee.Filter.eq('line', 'Astoria'));\nprint(line);\nMap.addLayer(line,\n {'color': 'yellow'},\n 'Astoria line');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Load stations from the New York Subway System.\nfeatures = ee.FeatureCollection.loadBigQueryTable(\n table=\"bigquery-public-data.new_york_subway.stations\",\n geometryColumn=\"station_geom\")\n\n# Display all relevant features on the map.\nm = geemap.Map()\nm.set_center(-73.90, 40.73, 11)\nm.add_layer(\n features, {'color': 'black'}, 'Stations from New York Subway System')\n\n# Print all stations in the \"Astoria\" line.\nline = features.filter(ee.Filter.eq('line', 'Astoria'))\ndisplay(line)\nm.add_layer(line, {'color': 'yellow'}, 'Astoria line')\nm\n```"]]