Export.image.toDrive
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک کار دستهای ایجاد میکند تا یک تصویر را به صورت رستر به Drive صادر کند. کارها را می توان از برگه 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 Drive که صادرات در آن قرار خواهد گرفت. توجه: (الف) اگر نام پوشه در هر سطحی وجود داشته باشد، خروجی در آن نوشته میشود، (ب) اگر نام پوشههای تکراری وجود داشته باشد، خروجی در پوشه اخیراً اصلاح شده نوشته میشود، (ج) اگر نام پوشه وجود نداشته باشد، یک پوشه جدید در ریشه ایجاد میشود، و (d) نام پوشهها بهعنوان «literepareg» تفسیر میشوند. رشته ها، نه مسیرهای سیستم. به طور پیش فرض درایو root است. |
fileNamePrefix | رشته، اختیاری | پیشوند نام فایل ممکن است شامل حروف، اعداد، -، _ (بدون فاصله) باشد. پیشفرض در توضیحات. |
dimensions | شماره|رشته، اختیاری | ابعاد مورد استفاده برای تصویر صادر شده یک عدد صحیح مثبت منفرد را به عنوان حداکثر بعد می گیرد یا "WIDTHxHEIGHT" که در آن WIDTH و HEIGHT هر کدام اعداد صحیح مثبت هستند. |
region | Geometry.LinearRing|Geometry.Polygon|رشته، اختیاری | یک حلقه خطی، چند ضلعی یا مختصاتی که نماینده منطقه برای صادرات است. اینها ممکن است به عنوان اشیاء هندسه یا مختصات سریالی شده به عنوان یک رشته مشخص شوند. |
scale | شماره، اختیاری | وضوح بر حسب متر بر پیکسل پیش فرض 1000 است. |
crs | رشته، اختیاری | CRS برای استفاده از تصویر صادر شده. |
crsTransform | List<Number>|رشته، اختیاری | برای استفاده از تصویر صادر شده، تبدیل را اضافه کنید. نیاز به تعریف "crs" دارد. |
maxPixels | شماره، اختیاری | تعداد پیکسل ها را در صادرات محدود کنید. بهطور پیشفرض، اگر خروجی بیش از 1e8 پیکسل باشد، با خطا مواجه میشوید. تنظیم این مقدار به صراحت به فرد امکان می دهد این حد را افزایش یا کاهش دهد. |
shardSize | شماره، اختیاری | اندازه بر حسب پیکسل کاشی هایی که این تصویر در آنها محاسبه می شود. پیش فرض 256 است. |
fileDimensions | List<Number>|شماره، اختیاری | ابعاد هر فایل تصویری بر حسب پیکسل، در صورتی که تصویر آنقدر بزرگ باشد که در یک فایل قرار نگیرد. ممکن است یک عدد برای نشان دادن یک شکل مربع یا آرایه ای از دو بعد برای نشان دادن (عرض، ارتفاع) مشخص کند. توجه داشته باشید که تصویر همچنان به ابعاد کلی تصویر بریده می شود. باید مضربی از shardSize باشد. |
skipEmptyTiles | بولی، اختیاری | اگر درست است، از نوشتن کاشی های تصویر خالی (یعنی کاملاً ماسک شده) صرف نظر کنید. پیش فرض به نادرست. فقط در صادرات GeoTIFF پشتیبانی می شود. |
fileFormat | رشته، اختیاری | فرمت فایل رشته ای که تصویر به آن صادر می شود. در حال حاضر فقط «GeoTIFF» و «TFRecord» پشتیبانی میشوند که پیشفرض «GeoTIFF» است. |
formatOptions | ImageExportFormatConfig، اختیاری است | فرهنگ لغت کلیدهای رشته ای برای قالب بندی گزینه های خاص. برای "GeoTIFF": "cloudOptimized" (Boolean)، "noData" (float). برای "TFRecord": https://developers.google.com/earth-engine/guides/tfrecord#formatoptions را ببینید |
priority | شماره، اختیاری | اولویت کار در پروژه. کارهای با اولویت بالاتر زودتر برنامه ریزی می شوند. باید یک عدد صحیح بین 0 و 9999 باشد. پیش فرض 100 است. |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// 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
}
});
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
# 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()
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis function exports an Earth Engine image as a raster to your Google Drive.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the export by specifying parameters like file name, folder, region, scale, and projection.\u003c/p\u003e\n"],["\u003cp\u003eFor large exports, you can control the tiling and pixel limits using parameters like \u003ccode\u003emaxPixels\u003c/code\u003e, \u003ccode\u003eshardSize\u003c/code\u003e, and \u003ccode\u003efileDimensions\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGeoTIFF and TFRecord are the supported export file formats with options for compression and NoData values.\u003c/p\u003e\n"],["\u003cp\u003eTasks are initiated from the 'Tasks' tab in the Earth Engine Code Editor and can be monitored for progress and completion.\u003c/p\u003e\n"]]],["This creates a batch task to export an image as a raster to Google Drive. Key parameters include the `image`, `description`, `folder`, `fileNamePrefix`, and `region`. Users can define `dimensions`, `scale`, `crs`, or `crsTransform` for output customization; these options are mutually exclusive. Additional settings involve `maxPixels`, `shardSize`, `fileDimensions`, `skipEmptyTiles`, `fileFormat`, `formatOptions`, and `priority`. Tasks can be initiated from the Tasks tab, allowing for control over the exported raster's properties and storage location.\n"],null,[]]