Export.table.toDrive

یک وظیفه دسته‌ای برای خروجی گرفتن از یک FeatureCollection به عنوان یک جدول به Drive ایجاد می‌کند. وظایف را می‌توان از تب Tasks شروع کرد.

کاربرد بازگشت‌ها
Export.table.toDrive(collection, description , folder , fileNamePrefix , fileFormat , selectors , maxVertices , priority )
استدلال نوع جزئیات
collection مجموعه ویژگی‌ها مجموعه ویژگی‌ها برای اکسپورت کردن.
description رشته، اختیاری یک نام قابل خواندن برای وظیفه. می‌تواند شامل حروف، اعداد، -، _ (بدون فاصله) باشد. مقدار پیش‌فرض "myExportTableTask" است.
folder رشته، اختیاری پوشه گوگل درایو که خروجی در آن قرار خواهد گرفت. توجه: (الف) اگر نام پوشه در هر سطحی وجود داشته باشد، خروجی در آن نوشته می‌شود، (ب) اگر نام پوشه تکراری وجود داشته باشد، خروجی در آخرین پوشه تغییر یافته نوشته می‌شود، (ج) اگر نام پوشه وجود نداشته باشد، یک پوشه جدید در ریشه ایجاد می‌شود، و (د) نام پوشه‌ها با جداکننده (مثلاً 'path/to/file') به عنوان رشته‌های تحت‌اللفظی تفسیر می‌شوند، نه مسیرهای سیستم. پیش‌فرض روی ریشه درایو است.
fileNamePrefix رشته، اختیاری پیشوند نام فایل. می‌تواند شامل حروف، اعداد، -، _ (بدون فاصله) باشد. پیش‌فرض توضیحات است.
fileFormat رشته، اختیاری قالب خروجی: "CSV" (پیش‌فرض)، "GeoJSON"، "KML"، "KMZ" یا "SHP" یا "TFRecord".
selectors List[String]|String، اختیاری فهرستی از ویژگی‌هایی که باید در خروجی لحاظ شوند؛ یا یک رشته واحد با نام‌های جدا شده با کاما یا فهرستی از رشته‌ها.
maxVertices شماره، اختیاری حداکثر تعداد رئوس برش نخورده در هر هندسه؛ هندسه‌هایی با رئوس بیشتر به قطعاتی کوچکتر از این اندازه برش داده می‌شوند.
priority شماره، اختیاری اولویت وظیفه در پروژه. وظایف با اولویت بالاتر زودتر زمان‌بندی می‌شوند. باید یک عدد صحیح بین ۰ تا ۹۹۹۹ باشد. پیش‌فرض ۱۰۰ است.

مثال‌ها

ویرایشگر کد (جاوااسکریپت)

// 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'
});

تنظیمات پایتون

برای اطلاعات بیشتر در مورد API پایتون و استفاده از geemap برای توسعه تعاملی، به صفحه محیط پایتون مراجعه کنید.

import ee
import geemap.core as geemap

کولب (پایتون)

# 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()