Google Earth Engine(GEE)——导出后的影像像素不同于原始Landsat影像的分辨率(投影差异)

问题:
我在谷歌地球引擎中有一个Landsat 7的镶嵌图,在网络应用的地图窗口中显示时(导出前)看起来没有问题。但是,当我导出它时,有些像素变窄了,有些变宽了。基本上有一些南北向的长度,其像素宽度为22米,而不是30米。

原始代码链接:https://code.earthengine.google.com/3ecceca28e81cc3d0c304281f08b4619

原始代码:

// Define study site geometry:
var box = ee.Geometry.Rectangle(14.91081234991633, 68.28371077192794, 14.965572329164377, 68.30250393637535);
Map.centerObject(box);

// Filter image collection by time and area.
var landsat_7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR") // 
  .filterBounds(box)
  .filterDate('2000-07-01','2000-08-31');

// Make median mosaic from collection:  
var landsat_7_mosaic = landsat_7.median()
  .select('B.+'); // Keep only bands containing B

var visuals = {bands: ["B1","B2","B3"],
    gamma: 1,
    max: 2737.5867438745377,
    min: 2040.6889200176545,
    opacity: 1};

// Add the image to the map window
Map.addLayer(landsat_7_mosaic, visuals, 'Landsat 7 mosaic');
             
Export.image.toDrive({image: landsat_7_mosaic,
                       description:'imageToDriveExample',
                       scale:30,
                       region: box,
                       maxPixels:1e13});

问题是:为什么会发生这种情况?有什么办法可以避免吗?

调查:
我调查了在QGIS中的输出,但如果我把导出的图像上传到Earth Engine中,这种差异仍然存在,所以这似乎不是一个与平台有关的问题。

如果我使用检查器功能,导出前和导出后的文件在重叠变形的地方有不同的像素值,所以这不仅仅是一个显示错误。

如果我对同一集合的图像做同样的事情(只有原始图像,没有马赛克),导出的文件看起来与原始文件完全一样。

我试着用不同的坐标参考导出,如WGS84和不同的UTM-zone。这些都不影响结果。

思考:
首先我想,马赛克和原始图像之间的差异可能意味着,不规则是马赛克操作试图将空间位置略有不同的像素装入同一光栅的结果。但如果是这样,我就不明白为什么在输出前的光栅渲染中没有显示出来。


默认情况下,GEE以EPSG:4326导出图像,这导致在这个纬度上出现矩形的像素。最好的办法是在导出时将图像重新投射到本地投影--在你的例子中是EPSG:32633。这应该可以解决这个问题:

修改后的代码:

// Define study site geometry:
var box = ee.Geometry.Rectangle(14.91081234991633, 68.28371077192794, 14.965572329164377, 68.30250393637535);
Map.centerObject(box);
Map.addLayer(box)

// Filter image collection
var landsat_7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR") // Use var to make an object containing the landsat 5 catalogue.
  .filterBounds(box)
  .filterDate('2000-07-01','2000-08-31');

// Make median mosaic from collection:  
var landsat_7_mosaic = landsat_7.median()
  .select('B.+'); // Keep only bands containing B
print(landsat_7)
var visuals = {bands: ["B1","B2","B3"],
    gamma: 1,
    max: 2737.5867438745377,
    min: 2040.6889200176545,
    opacity: 1};

// Add the image to the map window
Map.addLayer(landsat_7_mosaic, visuals, 'Landsat 7 mosaic');

             
Export.image.toDrive({image: landsat_7_mosaic.select(["B1","B2","B3"]),
                       description:'mosaic_epsg4326',
                       scale:30,
                       region: box,
                       maxPixels:1e13});
                       
var proj = landsat_7.first().select(0).projection();
print(proj)
Export.image.toDrive({image: landsat_7_mosaic.select(["B1","B2","B3"]).reproject(proj),
                       description:'mosaic_reproj_epsg32633',
                       scale:30,
                       region: box,
                       maxPixels:1e13});

 

猜你喜欢

转载自blog.csdn.net/qq_31988139/article/details/131236481