Export.image.toDrive

สร้างงานแบบกลุ่มเพื่อส่งออกรูปภาพเป็นแรสเตอร์ไปยังไดรฟ์ คุณเริ่มงานได้จากแท็บ Tasks "crsTransform", "scale" และ "dimensions" ใช้ร่วมกันไม่ได้

การใช้งานการคืนสินค้า
Export.image.toDrive(image, description, folder, fileNamePrefix, dimensions, region, scale, crs, crsTransform, maxPixels, shardSize, fileDimensions, skipEmptyTiles, fileFormat, formatOptions, priority)
อาร์กิวเมนต์ประเภทรายละเอียด
imageรูปภาพรูปภาพที่จะส่งออก
descriptionสตริง ไม่บังคับชื่อของงานที่มนุษย์อ่านได้ อาจมีตัวอักษร ตัวเลข ขีดกลาง ขีดล่าง (ไม่มีช่องว่าง) ค่าเริ่มต้นคือ "myExportImageTask"
folderสตริง ไม่บังคับโฟลเดอร์ Google ไดรฟ์ที่จะมีไฟล์ที่ส่งออก หมายเหตุ: (ก) หากมีชื่อโฟลเดอร์ในระดับใดก็ตาม ระบบจะเขียนเอาต์พุตไปยังโฟลเดอร์นั้น (ข) หากมีชื่อโฟลเดอร์ที่ซ้ำกัน ระบบจะเขียนเอาต์พุตไปยังโฟลเดอร์ที่แก้ไขล่าสุด (ค) หากไม่มีชื่อโฟลเดอร์ ระบบจะสร้างโฟลเดอร์ใหม่ที่รูท และ (ง) ระบบจะตีความชื่อโฟลเดอร์ที่มีตัวคั่น (เช่น "path/to/file") เป็นสตริงตามตัวอักษร ไม่ใช่เส้นทางของระบบ ค่าเริ่มต้นคือรูทของไดรฟ์
fileNamePrefixสตริง ไม่บังคับคำนำหน้าชื่อไฟล์ อาจมีตัวอักษร ตัวเลข ขีดกลาง ขีดล่าง (ไม่มีช่องว่าง) ค่าเริ่มต้นคือคำอธิบาย
dimensionsNumber|String, ไม่บังคับขนาดที่จะใช้กับรูปภาพที่ส่งออก รับจำนวนเต็มบวกรายการเดียวเป็นมิติข้อมูลสูงสุด หรือ "WIDTHxHEIGHT" โดยที่ WIDTH และ HEIGHT เป็นจำนวนเต็มบวก
regionGeometry.LinearRing|Geometry.Polygon|String, ไม่บังคับLinearRing, Polygon หรือพิกัดที่แสดงภูมิภาคที่จะส่งออก โดยอาจระบุเป็นออบเจ็กต์ Geometry หรือพิกัดที่แปลงเป็นสตริง
scaleหมายเลข (ไม่บังคับ)ความละเอียดเป็นเมตรต่อพิกเซล ค่าเริ่มต้นคือ 1,000
crsสตริง ไม่บังคับCRS ที่จะใช้สำหรับรูปภาพที่ส่งออก
crsTransformList<Number>|String, ไม่บังคับการแปลงแบบแอฟฟินที่จะใช้กับรูปภาพที่ส่งออก ต้องกำหนด "crs"
maxPixelsหมายเลข (ไม่บังคับ)จำกัดจำนวนพิกเซลในการส่งออก โดยค่าเริ่มต้น คุณจะเห็นข้อผิดพลาดหากการส่งออกมีขนาดเกิน 1e8 พิกเซล การตั้งค่านี้อย่างชัดเจนจะช่วยให้คุณเพิ่มหรือลดขีดจำกัดนี้ได้
shardSizeหมายเลข (ไม่บังคับ)ขนาดเป็นพิกเซลของไทล์ที่จะใช้คำนวณรูปภาพนี้ ค่าเริ่มต้นคือ 256
fileDimensionsList<Number>|Number, ไม่บังคับขนาดในหน่วยพิกเซลของไฟล์ภาพแต่ละไฟล์ หากภาพมีขนาดใหญ่เกินกว่าจะใส่ในไฟล์เดียว อาจระบุตัวเลขเดียวเพื่อระบุรูปร่างสี่เหลี่ยมจัตุรัส หรืออาร์เรย์ของ 2 มิติเพื่อระบุ (ความกว้าง ความสูง) โปรดทราบว่าระบบจะยังคงตัดรูปภาพให้มีขนาดตามขนาดรูปภาพโดยรวม ต้องเป็นผลคูณของ shardSize
skipEmptyTilesบูลีน ไม่บังคับหากเป็นจริง ให้ข้ามการเขียนไทล์รูปภาพที่ว่างเปล่า (เช่น มาสก์ทั้งหมด) ค่าเริ่มต้นคือ false รองรับเฉพาะการส่งออก GeoTIFF
fileFormatสตริง ไม่บังคับรูปแบบไฟล์สตริงที่จะส่งออกรูปภาพ ปัจจุบันรองรับเฉพาะ "GeoTIFF" และ "TFRecord" โดยค่าเริ่มต้นจะเป็น "GeoTIFF"
formatOptionsImageExportFormatConfig (ไม่บังคับ)พจนานุกรมของคีย์สตริงสำหรับตัวเลือกที่เจาะจงรูปแบบ สำหรับ "GeoTIFF": "cloudOptimized" (บูลีน), "noData" (ลอย) สำหรับ "TFRecord" โปรดดู https://developers.google.com/earth-engine/guides/tfrecord#formatoptions
priorityหมายเลข (ไม่บังคับ)ลำดับความสำคัญของงานภายในโปรเจ็กต์ ระบบจะกำหนดเวลางานที่มีลำดับความสำคัญสูงกว่าให้เร็วขึ้น ต้องเป็นจำนวนเต็มระหว่าง 0 ถึง 9999 ค่าเริ่มต้นคือ 100

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

// A Landsat 8 surface reflectance image.
var image = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508')
  .select(['SR_B.']);  // reflectance bands

// A region of interest.
var region = ee.Geometry.BBox(-122.24, 37.13, -122.11, 37.20);

// Set the export "scale" and "crs" parameters.
Export.image.toDrive({
  image: image,
  description: 'image_export',
  folder: 'ee_demos',
  region: region,
  scale: 30,
  crs: 'EPSG:5070'
});

// Use the "crsTransform" export parameter instead of "scale" for more control
// over the output grid. Here, "crsTransform" is set to align the output grid
// with the grid of another dataset. To view an image's CRS transform:
// print(image.projection())
Export.image.toDrive({
  image: image,
  description: 'image_export_crstransform',
  folder: 'ee_demos',
  region: region,
  crsTransform: [30, 0, -2493045, 0, -30, 3310005],
  crs: 'EPSG:5070'
});

// If the export has more than 1e8 pixels, set "maxPixels" higher.
Export.image.toDrive({
  image: image,
  description: 'image_export_maxpixels',
  folder: 'ee_demos',
  region: region,
  scale: 30,
  crs: 'EPSG:5070',
  maxPixels: 1e13
});

// Export a Cloud Optimized GeoTIFF (COG) by setting the "cloudOptimized"
// parameter to true.
Export.image.toDrive({
  image: image,
  description: 'image_export_cog',
  folder: 'ee_demos',
  region: region,
  scale: 30,
  crs: 'EPSG:5070',
  formatOptions: {
    cloudOptimized: true
  }
});

// Define a nodata value and replace masked pixels with it using "unmask".
// Set the "sameFootprint" parameter as "false" to include pixels outside of the
// image geometry in the unmasking operation.
var noDataVal = -9999;
var unmaskedImage = image.unmask({value: noDataVal, sameFootprint: false});
// Use the "noData" key in the "formatOptions" parameter to set the nodata value
// (GeoTIFF format only).
Export.image.toDrive({
  image: unmaskedImage,
  description: 'image_export_nodata',
  folder: 'ee_demos',
  region: image.geometry(),  // full image bounds
  scale: 2000,  // large scale for minimal demo
  crs: 'EPSG:5070',
  fileFormat: 'GeoTIFF',
  formatOptions: {
    noData: noDataVal
  }
});

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

# A Landsat 8 surface reflectance image.
image = ee.Image(
    'LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508'
).select(['SR_B.'])  # reflectance bands

# A region of interest.
region = ee.Geometry.BBox(-122.24, 37.13, -122.11, 37.20)

# Set the export "scale" and "crs" parameters.
task = ee.batch.Export.image.toDrive(
    image=image,
    description='image_export',
    folder='ee_demos',
    region=region,
    scale=30,
    crs='EPSG:5070'
)
task.start()

# Use the "crsTransform" export parameter instead of "scale" for more control
# over the output grid. Here, "crsTransform" is set to align the output grid
# with the grid of another dataset. To view an image's CRS transform:
# print(image.projection().getInfo())
task = ee.batch.Export.image.toDrive(
    image=image,
    description='image_export_crstransform',
    folder='ee_demos',
    region=region,
    crsTransform=[30, 0, -2493045, 0, -30, 3310005],
    crs='EPSG:5070'
)
task.start()

# If the export has more than 1e8 pixels, set "maxPixels" higher.
task = ee.batch.Export.image.toDrive(
    image=image,
    description='image_export_maxpixels',
    folder='ee_demos',
    region=region,
    scale=30,
    crs='EPSG:5070',
    maxPixels=1e13
)
task.start()

# Export a Cloud Optimized GeoTIFF (COG) by setting the "cloudOptimized"
# parameter to true.
task = ee.batch.Export.image.toDrive(
    image=image,
    description='image_export_cog',
    folder='ee_demos',
    region=region,
    scale=30,
    crs='EPSG:5070',
    formatOptions={
        'cloudOptimized': True
    }
)
task.start()

# Define a nodata value and replace masked pixels with it using "unmask".
# Set the "sameFootprint" parameter as "false" to include pixels outside of the
# image geometry in the unmasking operation.
nodata_val = -9999
unmasked_image = image.unmask(value=nodata_val, sameFootprint=False)
# Use the "noData" key in the "formatOptions" parameter to set the nodata value
# (GeoTIFF format only).
task = ee.batch.Export.image.toDrive(
    image=unmasked_image,
    description='image_export_nodata',
    folder='ee_demos',
    region=image.geometry(),  # full image bounds
    scale=2000,  # large scale for minimal demo
    crs='EPSG:5070',
    fileFormat='GeoTIFF',
    formatOptions={
        'noData': nodata_val
    }
)
task.start()