如何解决GEE导出影像的Nodata值在ArcGIS中无法正常显示?

目录

01 ArcGIS对于GEE掩膜影像的Nodata值的说明

02 处理方法

2.1 方法1-GEE修改掩膜值

Arguments:

Returns: Image

2.2 方法2-ArcGIS重新赋值Nodata(推荐)


01 ArcGIS对于GEE掩膜影像的Nodata值的说明

当在GEE中进行掩膜后,将影像在ArcGIS中显示如图:
如何解决GEE导出影像的Nodata值在ArcGIS中无法正常显示?_第1张图片

 周围的背景值为黑色,通过识别工具点击发现周围值为Nodata:
 

 猜测ArcGIS可以识别该种Nodata否则识别工具也不会将其值显示为Nodata,但是其和ArcGIS默认的Nodata值可能存在差别,如下图:
正常掩膜影像的Nodata值:
如何解决GEE导出影像的Nodata值在ArcGIS中无法正常显示?_第2张图片

GEE掩膜影像的Nodata值 :

(猜测此处的Nodata应该null即空值,而非像ArcGIS默认的Nodata是使用某一特殊值作为Nodata)
如何解决GEE导出影像的Nodata值在ArcGIS中无法正常显示?_第3张图片

 

02 处理方法

2.1 方法1-GEE修改掩膜值

在掩膜之后,将掩膜值(无效值/Nodata)设置为特别的数值,该数值不在影像的正常数值范围内。

这里需要使用到unmask函数,将掩码像素的Nodata(此处为NULL)取消,设置为其它新值例如下方案例中的-9999.0,并将新的影像返回。

官网说明

unmask(valuesameFootprint)

Replaces mask and value of the input image with the mask and value of another image at all positions where the input mask is zero. The output image retains the metadata of the input image. By default, the output image also retains the footprint of the input, but setting sameFootprint to false allows to extend the footprint.

Arguments:

this:input (Image):

Input image.

value (Image, default: null):

New value and mask for the masked pixels of the input image. If not specified, defaults to constant zero image which is valid everywhere.

sameFootprint (Boolean, default: true):

If true (or unspecified), the output retains the footprint of the input image. If false, the footprint of the output is the union of the input footprint with the footprint of the value image.

Returns: Image

// 一般而言
var gpm_precip = ee.ImageCollection("NASA/GPM_L3/IMERG_V06")
      .map(function(img){
        return mask(img)  // mask为自定义的掩膜函数
      })  // 掩膜
// 将掩膜值设置为非正常数值
var gpm_precip = ee.ImageCollection("NASA/GPM_L3/IMERG_V06")
      .map(function(img){
        return mask(img).unmask(-9999.0)  // mask为自定义的掩膜函数
      })  // 掩膜
// 通过unmask函数将Nodata值设置为-9999.0

 以上处理完毕之后,使用ArcGIS的栅格计算器(Raster Calculator)将-9999.0等你设置的新值重新赋值为ArcGIS的默认Nodata值。操作如下:

SetNull("masked.tif" == -9999.0, "masked.tif")

其表示,若masked.tif影像中有像元值等于 -9999.0, 那么将其设置为Nodata,否则赋值为masked.tif影像对应像元的值(即原值,也就是不等于的-9999.0的像元值不做处理) ;

例如:
如何解决GEE导出影像的Nodata值在ArcGIS中无法正常显示?_第4张图片

 

2.2 方法2-ArcGIS重新赋值Nodata(推荐)

GEE代码正常写,无需使用unmask,直接使用ArcGIS进行重新赋值。

思路来源:既然识别工具能够将GEE的Nodata识别,只是无法正常显示,那么我将这些Nodata值再重新赋值为Nodata或许可以解决问题,事实确实如此。

依然使用栅格计算器如下:

SetNull(IsNull("masked.tif"), "masked.tif")

其表示若masked.tif影像中有像元值为Nodata,那么将其赋值为Nodata,否则赋值为原值即不做改动。

例如:

如何解决GEE导出影像的Nodata值在ArcGIS中无法正常显示?_第5张图片

 

你可能感兴趣的:(GEE,arcgis,arcgis)