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".
Usage | Returns |
---|
Image.directionalDistanceTransform(angle, maxDistance, labelBand) | Image |
Argument | Type | Details |
---|
this: source | Image | The source image. |
angle | Float | The angle, in degrees, at which to search for non-zero pixels. |
maxDistance | Integer | The maximum distance, in pixels, over which to search. |
labelBand | String, default: null | If 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. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Calculates the distance from each zero-valued pixel to the nearest non-zero pixel in a specified direction."],["Returns a single-band image (\"distance\") containing these calculated distances as floating point values."],["Allows specifying the search angle, maximum search distance, and an optional label band for multi-band images."]]],["The `directionalDistanceTransform` function calculates the distance from each zero-valued pixel in a source image to the nearest non-zero pixel along a specified angle. It returns an image containing these floating-point distances. The search is performed up to a maximum distance. Optionally, a specific band can be defined as the target for the search, while preserving the other bands with the values found at searched pixel locations.\n"]]