How to solve the problem that the Nodata value of the image exported by GEE cannot be displayed normally in ArcGIS?

Table of contents

01 ArcGIS's description of the Nodata value of the GEE mask image

02 Processing method

2.1 Method 1-GEE modify mask value

Arguments:

Returns: Image

2.2 Method 2-ArcGIS reassigns Nodata (recommended)


01 ArcGIS's description of the Nodata value of the GEE mask image

After masking in GEE, the image will be displayed in ArcGIS as shown in the figure:

 The surrounding background value is black, and the surrounding value is found to be Nodata by clicking on the recognition tool:
 

 Guess that ArcGIS can recognize this kind of Nodata, otherwise the recognition tool will not display its value as Nodata, but it may be different from the default Nodata value of ArcGIS, as shown in the figure below: Nodata value of normal mask image
:

Nodata value of GEE mask image:

(Guess that the Nodata here should be null or an empty value, instead of using a special value as the Nodata like the default Nodata of ArcGIS)

 

02 Processing method

2.1 Method 1-GEE modify mask value

After the mask, set the mask value (Nodata) to a specific value that is outside the normal range of values ​​for the image.

Here you need to use the unmask function to cancel the Nodata (NULL here) of the mask pixel, set it to other new values ​​such as -9999.0 in the case below, and return the new image.

Official website description

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

 After the above processing is completed, use the ArcGIS raster calculator (Raster Calculator) to reassign the new value you set, such as -9999.0, to the default Nodata value of ArcGIS. The operation is as follows:

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

It means that if there is a pixel value equal to -9999.0 in the masked.tif image, then set it to Nodata, otherwise it will be assigned the value of the corresponding pixel in the masked.tif image (that is, the original value, that is, the image not equal to -9999.0 element value is not processed);

For example:

 

2.2 Method 2-ArcGIS reassigns Nodata (recommended)

The GEE code is written normally, without using unmask, and directly uses ArcGIS for reassignment.

Source of ideas: Since the recognition tool can recognize the Nodata of GEE, but it cannot be displayed normally, then I may be able to solve the problem by reassigning these Nodata values ​​to Nodata, which is indeed the case.

Still use the raster calculator as follows:

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

It means that if there is a pixel in the masked.tif image whose value is Nodata, then it will be assigned as Nodata, otherwise it will be assigned the original value and will not be changed.

For example:

 

Guess you like

Origin blog.csdn.net/m0_63001937/article/details/131155346