Earth Engine 推出了
非商业配额层级 ,以保护共享计算资源并确保为所有人提供可靠的性能。非商业项目默认使用 Community
层级,但您可以随时更改项目的层级。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
发送反馈
Export.table.toDrive
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建批量任务,以将 FeatureCollection 作为表格导出到云端硬盘。您可以在“任务”标签页中开始任务。
用法 返回 Export.table.toDrive(collection, description , folder , fileNamePrefix , fileFormat , selectors , maxVertices , priority )
参数 类型 详细信息 collectionFeatureCollection 要导出的地图项集合。 description字符串,可选 任务的人类可读名称。可以包含字母、数字、-、_(不能包含空格)。默认值为“myExportTableTask”。 folder字符串,可选 导出文件将位于的 Google 云端硬盘文件夹。注意:(a) 如果文件夹名称存在于任何级别,则输出会写入该文件夹;(b) 如果存在重复的文件夹名称,则输出会写入最近修改的文件夹;(c) 如果文件夹名称不存在,则会在根目录中创建一个新文件夹;(d) 包含分隔符(例如“path/to/file”)的文件夹名称会被解读为字面字符串,而不是系统路径。默认为云端硬盘根目录。 fileNamePrefix字符串,可选 文件名前缀。可以包含字母、数字、-、_(不能包含空格)。默认值为说明。 fileFormat字符串,可选 输出格式:“CSV”(默认)、“GeoJSON”“KML”“KMZ”“SHP”或“TFRecord”。 selectorsList[String]|String,可选 要包含在导出中的属性列表;可以是包含以逗号分隔的名称的单个字符串,也可以是字符串列表。 maxVertices数字,可选 每个几何图形的未剪切顶点数量上限;顶点数量超过此上限的几何图形将被剪切成小于此大小的块。 priority数字,可选 任务在项目中的优先级。优先级较高的任务会更早安排。必须是介于 0 到 9999 之间的整数。默认值为 100。
示例
代码编辑器 (JavaScript)
// A Sentinel-2 surface reflectance image.
var img = ee . Image ( 'COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG' );
Map . setCenter ( - 122.359 , 37.428 , 9 );
Map . addLayer ( img , { bands : [ 'B11' , 'B8' , 'B3' ], min : 100 , max : 3500 }, 'img' );
// Sample the image at 20 m scale, a point feature collection is returned.
var samp = img . sample ({ scale : 20 , numPixels : 50 , geometries : true });
Map . addLayer ( samp , { color : 'white' }, 'samp' );
print ( 'Image sample feature collection' , samp );
// Export the image sample feature collection to Drive as a CSV file.
Export . table . toDrive ({
collection : samp ,
description : 'image_sample_demo_csv' ,
folder : 'earth_engine_demos' ,
fileFormat : 'CSV'
});
// Export a subset of collection properties: three bands and the geometry
// as GeoJSON.
Export . table . toDrive ({
collection : samp ,
description : 'image_sample_demo_prop_subset' ,
folder : 'earth_engine_demos' ,
fileFormat : 'GeoJSON' ,
selectors : [ 'B8' , 'B11' , 'B12' , '.geo' ]
});
// Export the image sample feature collection to Drive as a shapefile.
Export . table . toDrive ({
collection : samp ,
description : 'image_sample_demo_shp' ,
folder : 'earth_engine_demos' ,
fileFormat : 'SHP'
});
Python 设置
如需了解 Python API 和如何使用
geemap 进行交互式开发,请访问
Python 环境 页面。
import ee
import geemap.core as geemap
Colab (Python)
# A Sentinel-2 surface reflectance image.
img = ee . Image ( 'COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG' )
m = geemap . Map ()
m . set_center ( - 122.359 , 37.428 , 9 )
m . add_layer (
img , { 'bands' : [ 'B11' , 'B8' , 'B3' ], 'min' : 100 , 'max' : 3500 }, 'img'
)
# Sample the image at 20 m scale, a point feature collection is returned.
samp = img . sample ( scale = 20 , numPixels = 50 , geometries = True )
m . add_layer ( samp , { 'color' : 'white' }, 'samp' )
display ( m )
display ( 'Image sample feature collection' , samp )
# Export the image sample feature collection to Drive as a CSV file.
task = ee . batch . Export . table . toDrive (
collection = samp ,
description = 'image_sample_demo_csv' ,
folder = 'earth_engine_demos' ,
fileFormat = 'CSV' ,
)
task . start ()
# Export a subset of collection properties: three bands and the geometry
# as GeoJSON.
task = ee . batch . Export . table . toDrive (
collection = samp ,
description = 'image_sample_demo_prop_subset' ,
folder = 'earth_engine_demos' ,
fileFormat = 'GeoJSON' ,
selectors = [ 'B8' , 'B11' , 'B12' , '.geo' ],
)
task . start ()
# Export the image sample feature collection to Drive as a shapefile.
task = ee . batch . Export . table . toDrive (
collection = samp ,
description = 'image_sample_demo_shp' ,
folder = 'earth_engine_demos' ,
fileFormat = 'SHP' ,
)
task . start ()
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-06-11。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-06-11。"],[],["This function exports a FeatureCollection as a table to Google Drive. Key actions include specifying the `collection`, task `description`, target `folder`, `fileNamePrefix`, and `fileFormat` (CSV, GeoJSON, KML, KMZ, SHP, or TFRecord). Optional actions include specifying `selectors` to limit exported properties, setting `maxVertices` to manage geometry size, and `priority` to control task scheduling. Multiple examples show how to export sampled image data to Drive in various formats.\n"]]