I have tested and successfully exported files from Google Colab to Google Drive, however, I am trying to export a file of data (as a .tif) after I've performed calculations on Landsat data in Google Colab and I get a green checkmark after running the code but then there is no file in Drive. Why do I get the green check mark if the code is not executing? Or am I trying to export the information incorrectly? I have tried the two options below based on this .
# Export the image, specifying scale and region.
class1export=class1.select('field')
task = ee.batch.Export.image.toDrive(**{
'image': class1export,
'description': 'class1export',
'folder':'GEE_Colab',
'scale': 30,
'region': shp
})
task.start()
# Export the image, specifying scale and region.
class1export=class1export.select('field')
task = ee.batch.Export.image.toDrive(
image=class1export,
scale=30,
fileFormat='GeoTIFF',
description='class1export.tif',
folder='GEE_Colab',
maxPixels=1e9)
task.start()
In case anyone else is experiencing this issue, I found a solution.
shp = ee.FeatureCollection('users/xyz/shp')
out_dir = os.path.join(os.path.expanduser('~'), 'Downloads')
filename = os.path.join(out_dir, 'class1export.tif')
roi=shp.geometry()
geemap.ee_export_image(class1export, filename=filename, scale=30, region=roi, file_per_band=False)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.