Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
A human-readable name of the task. May contain letters, numbers, -, _ (no spaces). Defaults to "myExportTableTask".
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.
fileNamePrefix
String, optional
The filename prefix. May contain letters, numbers, -, _ (no spaces). Defaults to the description.
fileFormat
String, optional
The output format: "CSV" (default), "GeoJSON", "KML", "KMZ", or "SHP", or "TFRecord".
selectors
List<String>|String, optional
A list of properties to include in the export; either a single string with comma-separated names or a list of strings.
maxVertices
Number, optional
Max number of uncut vertices per geometry; geometries with more vertices will be cut into pieces smaller than this size.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-08 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,["\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\nCode 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\nColab (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```"]]