I used the following script to export an image from Earth Engine. I am trying to specify the crs_transform
parameter argument in the Export.image.toDrive
function using the "transform" property of the image's ee.Projection
object. I can see that when I print the image's projection object that there is a field for "transform" containing a valid array element, but the export function throw's an error:
Invalid "argument, crs transform was not a string or array"
How can I retrieve the image's CRS transform?
var geometry = ee.Geometry.Rectangle([-114.3, 51.2, -113.8, 50.8]);
var S2_collection = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
.filterDate('2019-08-01', '2019-08-30')
.filterBounds(geometry)
// ...map a cloud masking function
var S2_mosaic = S2_collection.median()
var projection = S2_mosaic.projection();
print(projection)
Export.image.toDrive({
image: S2_mosaic,
description: 'imageToDriveExample_transform',
crs: projection.crs,
crsTransform: projection.transform, // <-- here's the problem
region: geometry
});