Export.table.toDrive

สร้างงานแบบกลุ่มเพื่อส่งออก FeatureCollection เป็นตารางไปยังไดรฟ์ คุณเริ่มงานได้จากแท็บ Tasks

การใช้งานการคืนสินค้า
Export.table.toDrive(collection, description, folder, fileNamePrefix, fileFormat, selectors, maxVertices, priority)
อาร์กิวเมนต์ประเภทรายละเอียด
collectionFeatureCollectionคอลเล็กชันฟีเจอร์ที่จะส่งออก
descriptionสตริง ไม่บังคับชื่อของงานที่มนุษย์อ่านได้ อาจมีตัวอักษร ตัวเลข ขีดกลาง ขีดล่าง (ไม่มีช่องว่าง) ค่าเริ่มต้นคือ "myExportTableTask"
folderสตริง ไม่บังคับโฟลเดอร์ Google ไดรฟ์ที่จะมีไฟล์ที่ส่งออก หมายเหตุ: (ก) หากมีชื่อโฟลเดอร์ในระดับใดก็ตาม ระบบจะเขียนเอาต์พุตไปยังโฟลเดอร์นั้น (ข) หากมีชื่อโฟลเดอร์ที่ซ้ำกัน ระบบจะเขียนเอาต์พุตไปยังโฟลเดอร์ที่แก้ไขล่าสุด (ค) หากไม่มีชื่อโฟลเดอร์ ระบบจะสร้างโฟลเดอร์ใหม่ที่รูท และ (ง) ระบบจะตีความชื่อโฟลเดอร์ที่มีตัวคั่น (เช่น "path/to/file") เป็นสตริงตามตัวอักษร ไม่ใช่เส้นทางของระบบ ค่าเริ่มต้นคือรูทของไดรฟ์
fileNamePrefixสตริง ไม่บังคับคำนำหน้าชื่อไฟล์ อาจมีตัวอักษร ตัวเลข ขีดกลาง ขีดล่าง (ไม่มีช่องว่าง) ค่าเริ่มต้นคือคำอธิบาย
fileFormatสตริง ไม่บังคับรูปแบบเอาต์พุต: "CSV" (ค่าเริ่มต้น), "GeoJSON", "KML", "KMZ" หรือ "SHP" หรือ "TFRecord"
selectorsList<String>|String, ไม่บังคับรายการพร็อพเพอร์ตี้ที่จะรวมในการส่งออก ซึ่งอาจเป็นสตริงเดียวที่มีชื่อที่คั่นด้วยคอมมาหรือรายการสตริง
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 API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

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