ee.Image.fastDistanceTransform

Returns the distance, as determined by the specified distance metric, to the nearest non-zero valued pixel in the input. The output contains values for all pixels within the given neighborhood size, regardless of the input's mask. Note: the default distance metric returns squared distance.

UsageReturns
Image.fastDistanceTransform(neighborhood, units, metric)Image
ArgumentTypeDetails
this: imageImage

The input image.

neighborhoodInteger, default: 256

Neighborhood size in pixels.

unitsString, default: "pixels"

The units of the neighborhood, currently only 'pixels' are supported.

metricString, default: "squared_euclidean"

Distance metric to use: options are 'squared_euclidean', 'manhattan' or 'chebyshev'.