ee.ImageCollection.distance
Produces a DOUBLE image where each pixel is the distance in meters from the pixel center to the nearest Point, LineString, or polygonal boundary in the collection. Note distance is also measured within interiors of polygons. Pixels that are not within 'searchRadius' meters of a geometry will be masked out.
Distances are computed on a sphere, so there is a small error proportional to the latitude difference between each pixel and the nearest geometry.
Usage | Returns | ImageCollection.distance(searchRadius, maxError) | Image |
Argument | Type | Details | this: features | FeatureCollection | Feature collection from which to get features used to compute pixel distances. |
searchRadius | Float, default: 100000 | Maximum distance in meters from each pixel to look for edges. Pixels will be masked unless there are edges within this distance. |
maxError | Float, default: 100 | Maximum reprojection error in meters, only used if the input polylines require reprojection. If '0' is provided, then this operation will fail if projection is required. |
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 pixel to the nearest geometry (point, line, or polygon) in a collection, measured in meters."],["Output is a double image where pixel values represent distances, masked for pixels beyond a specified search radius."],["Distances are calculated on a sphere, introducing minor errors based on latitude differences."],["Accepts a FeatureCollection as input and offers parameters to control search radius and reprojection error."]]],[]]