Google Earth Engine (GEE) - use the kernel function to build a heat map, and then count the machine attribute information of the size within the specified range

The main purpose of this blog is how we can use the kernel function to build a heat map, and filter out the specified area according to the hotspot area. The main purpose of this blog is to obtain relevant attribute information within its hotspot range.

 After calculating the Euclidean distance between each patch, I want to retrieve the largest distance value and use it as an attribute value for each patch. Does anyone know how to implement it? Here is a simple example derived from the tutorial. I have calculated the distance between each patch and assigned each patch a unique identifier, how can I get the max distance [euclideanDist] and then set it as a property of each largePatches?

Original code:

// Import a Dynamic World land cover image and subset the 'label' band.
var lcImg = ee.Image(
  'GOOGLE/DYNAMICWORLD/V1/20210726T171859_20210726T172345_T14TQS')
  .select('label');
var targetImg = lcImg.eq(0);
var maxDistM = 10000;  // 10 km

// Euclidean distance.
var euclideanKernel = ee.Kernel.euclidean(maxDistM, 'meters');
var euclideanDist = targetImg.distance(euclideanKernel);
var vis = {min: 0, max: maxDistM};
Map.setCenter(-95.68, 46.46, 9);
Map.addLayer(euclideanDist, vis, 'Euclidean distance to target pixels');

// Uniquely label the image objects.
var objectId =

Guess you like

Origin blog.csdn.net/qq_31988139/article/details/130498520