公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Feature.distance
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回两个地图项几何图形之间的最短距离。
用法 | 返回 |
---|
Feature.distance(right, maxError, proj, spherical) | 浮点数 |
参数 | 类型 | 详细信息 |
---|
this:left | 元素 | 包含用作运算左运算元的几何图形的特征。 |
right | 元素 | 包含用作运算右操作数的几何图形的地图项。 |
maxError | ErrorMargin,默认值:null | 执行任何必要的重新投影时允许的最大误差量。 |
proj | 投影,默认值:null | 用于执行操作的投影。如果未指定,系统将在球形坐标系中执行操作,并且线性距离将以球面上的米为单位。 |
spherical | 布尔值,默认值:false | 如果为 true,则在单位球面上执行计算。如果为 false,则计算将采用椭圆形,并考虑地球扁平化。如果指定了 proj,则忽略此字段。默认值为 false。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eMeasures the shortest distance between two geographical features.\u003c/p\u003e\n"],["\u003cp\u003eAccepts two features as input, along with optional parameters for error margin and projection.\u003c/p\u003e\n"],["\u003cp\u003eReturns the calculated distance as a floating-point number, representing the separation between the features.\u003c/p\u003e\n"],["\u003cp\u003eIf a projection is not specified, calculations default to a spherical coordinate system with distances in meters.\u003c/p\u003e\n"],["\u003cp\u003eAllows for specifying an error margin to manage the accuracy of calculations, particularly during reprojection.\u003c/p\u003e\n"]]],[],null,["# ee.Feature.distance\n\nReturns the minimum distance between the geometries of two features.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------|---------|\n| Feature.distance`(right, `*maxError* `, `*proj* `, `*spherical*`)` | Float |\n\n| Argument | Type | Details |\n|--------------|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `left` | Element | The feature containing the geometry used as the left operand of the operation. |\n| `right` | Element | The feature containing the geometry used as the right operand of the operation. |\n| `maxError` | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `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. |\n| `spherical` | Boolean, default: false | If true, the calculation will be done on the unit sphere. If false, the calculation will be elliptical, taking earth flattening into account. Ignored if proj is specified. Default is false. |"]]