ee.Image.directionalDistanceTransform

For each zero-valued pixel in the source, get the distance to the nearest non-zero pixels in the given direction.

Returns a band of floating point distances called "distance".

UsageReturns
Image.directionalDistanceTransform(angle, maxDistance, labelBand)Image
ArgumentTypeDetails
this: sourceImageThe source image.
angleFloatThe angle, in degrees, at which to search for non-zero pixels.
maxDistanceIntegerThe maximum distance, in pixels, over which to search.
labelBandString, default: nullIf provided, multi-band inputs are permitted and only this band is used for searching. All other bands are returned and populated with the per-band values found at the searched non-zero pixels in the label band.