Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить некоммерческое право на сохранение доступа к Earth Engine.
Export.table.toDrive
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Создает пакетную задачу для экспорта FeatureCollection в виде таблицы на Диск. Задачи можно запустить на вкладке Задачи.
Использование | Возвраты | Export.table.toDrive(collection, description , folder , fileNamePrefix , fileFormat , selectors , maxVertices , priority ) | |
Аргумент | Тип | Подробности | collection | FeatureCollection | Коллекция объектов для экспорта. |
description | Строка, необязательно | Удобочитаемое имя задачи. Может содержать буквы, цифры, -, _ (без пробелов). По умолчанию "myExportTableTask". |
folder | Строка, необязательно | Папка Google Диска, в которой будет находиться экспорт. Примечание: (a) если имя папки существует на любом уровне, вывод записывается в нее, (b) если существуют дублирующиеся имена папок, вывод записывается в последнюю измененную папку, (c) если имя папки не существует, в корне будет создана новая папка, и (d) имена папок с разделителями (например, «путь/к/файлу») интерпретируются как буквенные строки, а не системные пути. По умолчанию — корень Диска. |
fileNamePrefix | Строка, необязательно | Префикс имени файла. Может содержать буквы, цифры, -, _ (без пробелов). По умолчанию — описание. |
fileFormat | Строка, необязательно | Формат вывода: «CSV» (по умолчанию), «GeoJSON», «KML», «KMZ» или «SHP» или «TFRecord». |
selectors | Список<Строка>|Строка, необязательно | Список свойств для включения в экспорт: либо одна строка с именами, разделенными запятыми, либо список строк. |
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
Информацию об API Python и использовании geemap
для интерактивной разработки см. на странице Python Environment .
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()
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\u003cp\u003eCreates a batch task to export a FeatureCollection from Google Earth Engine to your Google Drive as a table in various formats (CSV, GeoJSON, KML, KMZ, SHP, or TFRecord).\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the export by specifying a description, output folder, filename prefix, file format, and properties to include.\u003c/p\u003e\n"],["\u003cp\u003eThe task can be started from the Tasks tab in Google Earth Engine and allows control over priority and geometry complexity.\u003c/p\u003e\n"],["\u003cp\u003eExporting allows you to download and utilize Earth Engine data outside the platform for further analysis and use.\u003c/p\u003e\n"]]],["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"],null,["# Export.table.toDrive\n\n\u003cbr /\u003e\n\nCreates a batch task to export a FeatureCollection as a table to Drive. Tasks can be started from the Tasks tab.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| `Export.table.toDrive(collection, `*description* `, `*folder* `, `*fileNamePrefix* `, `*fileFormat* `, `*selectors* `, `*maxVertices* `, `*priority*`)` | |\n\n| Argument | Type | Details |\n|------------------|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `collection` | FeatureCollection | The feature collection to export. |\n| `description` | String, optional | A human-readable name of the task. May contain letters, numbers, -, _ (no spaces). Defaults to \"myExportTableTask\". |\n| `folder` | String, optional | The Google Drive Folder that the export will reside in. Note: (a) if the folder name exists at any level, the output is written to it, (b) if duplicate folder names exist, output is written to the most recently modified folder, (c) if the folder name does not exist, a new folder will be created at the root, and (d) folder names with separators (e.g. 'path/to/file') are interpreted as literal strings, not system paths. Defaults to Drive root. |\n| `fileNamePrefix` | String, optional | The filename prefix. May contain letters, numbers, -, _ (no spaces). Defaults to the description. |\n| `fileFormat` | String, optional | The output format: \"CSV\" (default), \"GeoJSON\", \"KML\", \"KMZ\", or \"SHP\", or \"TFRecord\". |\n| `selectors` | List\\\u003cString\\\u003e\\|String, optional | A list of properties to include in the export; either a single string with comma-separated names or a list of strings. |\n| `maxVertices` | Number, optional | Max number of uncut vertices per geometry; geometries with more vertices will be cut into pieces smaller than this size. |\n| `priority` | Number, optional | The priority of the task within the project. Higher priority tasks are scheduled sooner. Must be an integer between 0 and 9999. Defaults to 100. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A Sentinel-2 surface reflectance image.\nvar img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');\nMap.setCenter(-122.359, 37.428, 9);\nMap.addLayer(img, {bands: ['B11', 'B8', 'B3'], min: 100, max: 3500}, 'img');\n\n// Sample the image at 20 m scale, a point feature collection is returned.\nvar samp = img.sample({scale: 20, numPixels: 50, geometries: true});\nMap.addLayer(samp, {color: 'white'}, 'samp');\nprint('Image sample feature collection', samp);\n\n// Export the image sample feature collection to Drive as a CSV file.\nExport.table.toDrive({\n collection: samp,\n description: 'image_sample_demo_csv',\n folder: 'earth_engine_demos',\n fileFormat: 'CSV'\n});\n\n// Export a subset of collection properties: three bands and the geometry\n// as GeoJSON.\nExport.table.toDrive({\n collection: samp,\n description: 'image_sample_demo_prop_subset',\n folder: 'earth_engine_demos',\n fileFormat: 'GeoJSON',\n selectors: ['B8', 'B11', 'B12', '.geo']\n});\n\n// Export the image sample feature collection to Drive as a shapefile.\nExport.table.toDrive({\n collection: samp,\n description: 'image_sample_demo_shp',\n folder: 'earth_engine_demos',\n fileFormat: 'SHP'\n});\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# A Sentinel-2 surface reflectance image.\nimg = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')\nm = geemap.Map()\nm.set_center(-122.359, 37.428, 9)\nm.add_layer(\n img, {'bands': ['B11', 'B8', 'B3'], 'min': 100, 'max': 3500}, 'img'\n)\n\n# Sample the image at 20 m scale, a point feature collection is returned.\nsamp = img.sample(scale=20, numPixels=50, geometries=True)\nm.add_layer(samp, {'color': 'white'}, 'samp')\ndisplay(m)\ndisplay('Image sample feature collection', samp)\n\n# Export the image sample feature collection to Drive as a CSV file.\ntask = ee.batch.Export.table.toDrive(\n collection=samp,\n description='image_sample_demo_csv',\n folder='earth_engine_demos',\n fileFormat='CSV',\n)\ntask.start()\n\n# Export a subset of collection properties: three bands and the geometry\n# as GeoJSON.\ntask = ee.batch.Export.table.toDrive(\n collection=samp,\n description='image_sample_demo_prop_subset',\n folder='earth_engine_demos',\n fileFormat='GeoJSON',\n selectors=['B8', 'B11', 'B12', '.geo'],\n)\ntask.start()\n\n# Export the image sample feature collection to Drive as a shapefile.\ntask = ee.batch.Export.table.toDrive(\n collection=samp,\n description='image_sample_demo_shp',\n folder='earth_engine_demos',\n fileFormat='SHP',\n)\ntask.start()\n```"]]