## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

# Path Calculation in Euclidean Distance and Cost Distance

It is worth mentioning that the straight-line distance from a given cell produced by Euclidean distance compared with the least-cost path generated by cost distance are quite different; they are calculated in completely different ways. Euclidean distance calculates the direct, straight-line distance from each cell center to the closest source cell center, regardless of how this path slices through intervening cells. The cost distance path, however, must pass through cell centers, frequently generating a sequence of line segments that change direction at the center of each cell.

Therefore, even when crossing a cost surface where each cell cost is 1, so that a straight line would be the least-cost path, cost distance will usually produce a slightly longer path—because the path proceeds from cell center to adjacent cell center. This sort of “connect the dots” behavior will not result in a much longer path than the straight-line distance, but observing it illustrates the difference in the ways the two output rasters are calculated. In cost distance, the path proceeds from one cell center to the center of one of the eight adjacent cells, always with the aim of minimizing the cost of getting to the source cell. In other words, except for a few special cases (e.g., due north, straight southwest), the path generated by cost distance will not be a straight line, but will zigzag so as to take in the cell centers along the way. See ...

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required