إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
Export.table.toDrive
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تنشئ هذه الدالة مهمة مجمّعة لتصدير FeatureCollection كجدول إلى Drive. يمكن بدء المهام من علامة التبويب "مهام Google".
الاستخدام | المرتجعات |
---|
Export.table.toDrive(collection, description, folder, fileNamePrefix, fileFormat, selectors, maxVertices, priority) | |
الوسيطة | النوع | التفاصيل |
---|
collection | FeatureCollection | مجموعة العناصر المطلوب تصديرها. |
description | سلسلة، اختياري | اسم المهمة الذي يمكن للمستخدم قراءته يمكن أن يحتوي على أحرف أو أرقام أو - أو _ (بدون مسافات). القيمة التلقائية هي "myExportTableTask". |
folder | سلسلة، اختياري | مجلد Google Drive الذي سيتم تخزين عملية التصدير فيه ملاحظة: (أ) إذا كان اسم المجلد متوفّرًا في أي مستوى، تتم كتابة الناتج فيه، (ب) إذا كانت أسماء المجلدات مكرّرة، تتم كتابة الناتج في المجلد الذي تم تعديله مؤخرًا، (ج) إذا لم يكن اسم المجلد متوفّرًا، سيتم إنشاء مجلد جديد في الجذر، (د) يتم تفسير أسماء المجلدات التي تتضمّن فواصل (مثل "path/to/file") كسلاسل حرفية، وليس كمسارات نظام. يتم ضبط القيمة التلقائية على جذر Drive. |
fileNamePrefix | سلسلة، اختياري | بادئة اسم الملف يمكن أن يحتوي على أحرف أو أرقام أو - أو _ (بدون مسافات). القيمة التلقائية هي الوصف. |
fileFormat | سلسلة، اختياري | تنسيق الإخراج: "CSV" (تلقائي) أو "GeoJSON" أو "KML" أو "KMZ" أو "SHP" أو "TFRecord". |
selectors | List<String>|String, optional | قائمة بالسمات المطلوب تضمينها في عملية التصدير، إما سلسلة واحدة تتضمّن أسماء مفصولة بفواصل أو قائمة سلاسل |
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 للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
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 Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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```"]]