公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.ImageCollection.distance
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
生成一个 DOUBLE 图像,其中每个像素都是从像素中心到集合中最近的 Point、LineString 或多边形边界的距离(以米为单位)。请注意,距离也是在多边形的内部测量的。不在几何图形“searchRadius”米范围内的像素将被遮盖。
距离是在球面上计算的,因此存在一个与每个像素和最近几何图形之间的纬度差成正比的小误差。
用法 | 返回 |
---|
ImageCollection.distance(searchRadius, maxError) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:features | FeatureCollection | 用于获取特征的要素集合,这些特征用于计算像素距离。 |
searchRadius | 浮点数,默认值:100000 | 查找边缘时,每个像素的最大距离(以米为单位)。除非在此距离内有边缘,否则像素将被遮盖。 |
maxError | 浮点数,默认值:100 | 以米为单位的最大重投影误差,仅当输入折线需要重投影时使用。如果提供“0”,则在需要投影时,此操作将失败。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCalculates the distance from each pixel to the nearest geometry (point, line, or polygon) in a collection, measured in meters.\u003c/p\u003e\n"],["\u003cp\u003eOutput is a double image where pixel values represent distances, masked for pixels beyond a specified search radius.\u003c/p\u003e\n"],["\u003cp\u003eDistances are calculated on a sphere, introducing minor errors based on latitude differences.\u003c/p\u003e\n"],["\u003cp\u003eAccepts a FeatureCollection as input and offers parameters to control search radius and reprojection error.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.distance\n\nProduces 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.\n\n\u003cbr /\u003e\n\nDistances are computed on a sphere, so there is a small error proportional to the latitude difference between each pixel and the nearest geometry.\n\n| Usage | Returns |\n|-------------------------------------------------------------|---------|\n| ImageCollection.distance`(`*searchRadius* `, `*maxError*`)` | Image |\n\n| Argument | Type | Details |\n|------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `features` | FeatureCollection | Feature collection from which to get features used to compute pixel distances. |\n| `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. |\n| `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. |"]]