Select to view content in your preferred language

Cost Distance Output is Illogical

1990
3
01-16-2018 12:02 PM
DavidStone1
Emerging Contributor

I'm trying to use the Cost Distance spatial analyst tool in ArcGIS pro and getting results that are not logical/not returning the values that I'm looking for - namely the cost distances are a fraction of what they should be. I tested the process on a small subset of my data (and used simplified and uniform values) and found that incremental cost from one cell to the next was a consistent fraction of the intended cost. My process is as follows:

-The layer that holds the data for cost distance is a feature layer that I created, which consists of a grid of polygons (squares) that cover 1/2 - 1 square mile. They follow roads

-To get the source raster, I have used Polygon to Raster, and Polygon to Point (centroid) followed by Point to Raster. I use Set Null to remove any cells that do not move along the roads/my squares, and set all remaining cells to 1 (I've also tried various values)

-To get the cost raster I repeat the above process but instead include all cells and set the values to the relevant cost value

-I replace any 0's in the rasters to 1 (since the function supposedly does not work properly through 0's)

-I run the Cost Distance Function

I had suspected the issue was related to cell size. My first trials used cell sizes that created multiple cells encapsulated in the squares I created, so I assumed the value of the square was divided among the cells. However, after adjusting the cell size so that it was 1:1 with the squares, the issue persisted. Additionally, I used the Raster to Point function to confirm the number of cells (and their values). Interestingly, in the early trial where I used a small subset and uniform values, the total cost values of my data set appeared to be distributed over all pixels.

At this point, I've seemingly confirmed that the cell size is 1:1 with the squares (as desired), the values in the input cost raster are correct, and the final raster output from Cost Distance appears to be directionally correct, as the sections further from the source have higher costs.

Any ideas how to fix this issue/use Cost Distance effectively? Am I missing a nuance in the way that Rasters hold data or the conversion process, or the Cost Distance function?

Tags (1)
0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

show your rasters or your cost raster at least, I suspect you have loads of cells with nodata values in them which will effectively bring any cost path analysis to a grinding halt if there is no way to reach destinations from origins etc

0 Kudos
DavidStone1
Emerging Contributor

Thanks for the prompt response. That's correct - both of my rasters have many nodata values. However, I've evaluated the output in area directly adjacent to source and the numbers are still incorrect. Would the nodata values present in the layer somehow still impact the results?

0 Kudos
DanPatterson_Retired
MVP Emeritus

your point to raster step can create the origins  will do just that, but to create the distance from those locations, they must be located on cells that are not nodata, hence my question about nodata locations relative to the origins.  You can see what you have, but I don't know values your cost surface is comprised of (all 1's and nodata?) or its arrangement relative to the origins and how they accumulate directionally (considering sqrt(2) for the diagonals etc).

0 Kudos