Introducing Geographic Information Systems with ArcGIS: A Workbook Approach to Learning GIS, 3rd Edition
by Michael D. Kennedy
Understanding How Total Costs Are Calculated
Calculating cost distance is somewhat involved. Take as an example a cell, size 10, that costs $1.15 per unit distance to cross. What is the cost of traveling from the center of such a cell directly to its southern edge? See Figure 8-18. The length of this segment is 5 (half the total distance of 10 across the cell). The cost associated with the cell is 1.15 per unit of distance. The cost of this segment, then, is the product of the distance and the cost per unit distance: 5 * 1.15 = 5.75.
FIGURE 8-18 Cost of traversing a cell from its center to a side
When the path goes from cell corner to corner, the distance is longer than if the path goes from the side of a cell to the opposite side. How much longer? Multiply the side-to-side distance by the square root of 2, which is approximately 1.41421356237, which we will round to 1.414. See Figure 8-19.
FIGURE 8-19 Cost of traversing a cell from a corner to the opposite corner
For example, the cost to go diagonally across a 10 unit cell that had a toll of $1.15 would be
10 * 1.414 * 1.15 = 16.261
Each possible path from the source cell to each other cell is either calculated or considered in some way. That can be a lot of paths. This type of calculation may take place several times for each ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access