Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.Image.cumulativeCost
Stay organized with collections
Save and categorize content based on your preferences.
Computes a cumulative cost map based on an image containing costs to traverse each pixel and an image containing source locations.
Each output band represents the cumulative cost over the corresponding input cost band.
Usage | Returns | Image.cumulativeCost(source, maxDistance, geodeticDistance) | Image |
Argument | Type | Details | 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. |
source | Image | A single-band image representing the sources. A pixel value different from 0 defines a source pixel. |
maxDistance | Float | Maximum distance for computation, in meters. |
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). |
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 2024-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[[["\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). |"]]