公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.cumulativeCost
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据包含遍历每个像素的费用的图片和包含来源位置的图片,计算累积费用地图。
每个输出频段表示相应输入费用频段的累计费用。
用法 | 返回 |
---|
Image.cumulativeCost(source, maxDistance, geodeticDistance) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:cost | 图片 | 表示遍历每个像素的费用的图片。无法遍历被遮盖的像素。在比较像素遍历费用时,我们使用波段级字典顺序。只有当主要频段上的路径成本相同时,系统才会考虑辅助频段。 |
source | 图片 | 表示来源的单波段图像。不同于 0 的像素值定义了源像素。 |
maxDistance | 浮点数 | 计算的最大距离(以米为单位)。 |
geodeticDistance | 布尔值,默认值:true | 如果值为 true,则使用沿曲面的大地测量距离,假设地球为半径 6378137.0 的球体。如果为 false,则使用地图投影的二维平面中的欧几里得距离(速度更快,但准确性较低)。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eGenerates a cumulative cost map indicating the cost of reaching each pixel from the nearest source.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a cost image and a source image to calculate cumulative costs.\u003c/p\u003e\n"],["\u003cp\u003eConsiders maximum distance and allows for both geodetic and Euclidean distance calculations.\u003c/p\u003e\n"],["\u003cp\u003eOutput image bands correspond to cumulative costs over the input cost bands.\u003c/p\u003e\n"],["\u003cp\u003eUntraversable areas are represented by masked pixels in the cost image.\u003c/p\u003e\n"]]],[],null,["# ee.Image.cumulativeCost\n\nComputes a cumulative cost map based on an image containing costs to traverse each pixel and an image containing source locations.\n\n\u003cbr /\u003e\n\nEach output band represents the cumulative cost over the corresponding input cost band.\n\n| Usage | Returns |\n|-------------------------------------------------------------------|---------|\n| Image.cumulativeCost`(source, maxDistance, `*geodeticDistance*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `cost` | Image | An image representing the cost to traverse each pixel. Masked pixels can't be traversed. When comparing pixel traversal costs, we use band-wise dictionary ordering. Ancillary cost bands are only considered when paths over primary bands are equal cost. |\n| `source` | Image | A single-band image representing the sources. A pixel value different from 0 defines a source pixel. |\n| `maxDistance` | Float | Maximum distance for computation, in meters. |\n| `geodeticDistance` | Boolean, default: true | If true, geodetic distance along the curved surface is used, assuming a spherical Earth of radius 6378137.0. If false, Euclidean distance in the 2D plane of the map projection is used (faster, but less accurate). |"]]