Export.table.toDrive

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

استفاده برمی گرداند
Export.table.toDrive(collection, description , folder , fileNamePrefix , fileFormat , selectors , maxVertices , priority )
استدلال تایپ کنید جزئیات
collection مجموعه ویژگی ها مجموعه ویژگی برای صادرات.
description رشته، اختیاری نام کار قابل خواندن برای انسان. ممکن است شامل حروف، اعداد، -، _ (بدون فاصله) باشد. پیش‌فرض «myExportTableTask» است.
folder رشته، اختیاری پوشه Google Drive که صادرات در آن قرار خواهد گرفت. توجه: (الف) اگر نام پوشه در هر سطحی وجود داشته باشد، خروجی در آن نوشته می‌شود، (ب) اگر نام پوشه‌های تکراری وجود داشته باشد، خروجی در پوشه اخیراً اصلاح شده نوشته می‌شود، (ج) اگر نام پوشه وجود نداشته باشد، یک پوشه جدید در ریشه ایجاد می‌شود، و (d) نام پوشه‌ها به‌عنوان «literepareg» تفسیر می‌شوند. رشته ها، نه مسیرهای سیستم. به طور پیش فرض درایو root است.
fileNamePrefix رشته، اختیاری پیشوند نام فایل ممکن است شامل حروف، اعداد، -، _ (بدون فاصله) باشد. پیش‌فرض در توضیحات.
fileFormat رشته، اختیاری فرمت خروجی: «CSV» (پیش‌فرض)، «GeoJSON»، «KML»، «KMZ»، یا «SHP»، یا «TFRecord».
selectors List<String>|رشته، اختیاری فهرست اموالی که باید در صادرات گنجانده شود. یک رشته با نام های جدا شده با کاما یا لیستی از رشته ها.
maxVertices شماره، اختیاری حداکثر تعداد رئوس برش نخورده در هر هندسه. هندسه هایی با رئوس بیشتر به قطعات کوچکتر از این اندازه بریده می شوند.
priority شماره، اختیاری اولویت کار در پروژه. کارهای با اولویت بالاتر زودتر برنامه ریزی می شوند. باید یک عدد صحیح بین 0 و 9999 باشد. پیش فرض 100 است.

نمونه ها

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

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