5

When I export an image in Google Earth Engine the resulting raster does not match the original. When I import the export back into Google Earth Engine the is an spatial misalignment between the original (orange in picture below) and the exported version (green in the picture below). The direction as size of the misalignment varies across the image. A solution appears to be to set the scale of the image below its native resolution, in this instance 1m as opposed to 30m; however this will hugely increase the size of the image. Am I missing something in the export call

enter image description here

Export.image.toDrive({
  image: landsat,
  description: 'imageExport',
  scale: 30,
  crs: 'EPSG:3857',
  maxPixels: 800000000000
});

2 Answers 2

2

If you export by specifying a scale for Landsat images, you are explicitly overriding the non-integer affine transform with an integer one, and introducing a 1/2 pixel shift.

You may want to try Exporting with the original image.projection() instead of creating a new one from scratch.

3
  • 1
    I'm still not clear what to set the scale to? Even if I don't specify the scale in the code, it is a parameter "Scale (m/px)" in the "Task: Initiate image export" popup under resolution, other options are "maximum dimension (px)" or "dimension (px)". Oct 10, 2017 at 13:46
  • I'm still unable to get this to work. I have set the scale using var scale = mangrove.projection().nominalScale().getInfo() and the projection using var projection = mangrove.projection().getInfo() which equates to crs: EPSG:4326. I can't believe this is impossible Oct 31, 2017 at 16:45
  • 1
    You shouldn't need to fiddle with the scale at all if you use crs: image.select(0).first().projection(). Be sure that image is straight out of the collection, not some computed thing (e.g. composite of images). I'm led to believe it's computed because EPSG:4326 is not the native projection of any landsat scene that I'm aware of. Oct 31, 2017 at 23:39
1

The original post was awhile back but answering to help others since I could not find the solution elsewhere. I had a similar issue: on the export, the Landsat image was shifted by 15 m in the x and y (1/2 pixel in each direction). I had already projected the Landsat image collection earlier in the script (EPSG:32613) and realized I didn't need to specify the crs on the export. However, I left the scale as is and it worked fine:

Export.image.toDrive({
image: ndmi_stats_MR.toFloat(),
  description: 'NM_MR_L8_ndmi' + '_' + startyearL8.getInfo(), 
  folder: 'NM_GEE',
  region: project_aoi.geometry(),
  scale: 30,
  //crs: 'EPSG:32613', //UTM WGS84 Z13North  
  maxPixels: 1e13,
  skipEmptyTiles:true 
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.