ee.Feature.withinDistance
Returns true if and only if the geometries of two features are within a specified distance.
Usage | Returns |
---|
Feature.withinDistance(right, distance, maxError, proj) | Boolean |
Argument | Type | Details |
---|
this: left | Element | The feature containing the geometry used as the left operand of the operation. |
right | Element | The feature containing the geometry used as the right operand of the operation. |
distance | Float | The distance threshold. If a projection is specified, the distance is in units of that projected coordinate system, otherwise it is in meters. |
maxError | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |
proj | Projection, default: null | The projection in which to perform the operation. If not specified, the operation will be performed in a spherical coordinate system, and linear distances will be in meters on the sphere. |
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-12-06 UTC.
[null,null,["Last updated 2023-12-06 UTC."],[[["`withinDistance` determines if two geographic features are within a specified distance of each other, returning true if they are and false otherwise."],["The distance threshold can be defined in meters or in the units of a given projected coordinate system."],["This function considers the geometries of the features and can handle reprojection with a specified error margin if necessary."]]],["The core function determines if two feature geometries are within a specified distance. It takes two features (`left`, `right`) and a `distance` (in meters or specified projection units) as input, returning a Boolean. Optional arguments include `maxError` for reprojection tolerance and `proj` to define the projection. The operation checks if `left` is within the given `distance` of `right`, considering the provided projection or defaulting to a spherical coordinate system.\n"]]