After a great deal of research here is what is happening: We select two points on a hydrography map with an island inbetween. It is expected that the CostDistanceWithPolyline would return a line that traverses around the island. We are now finding that the Cost Array that is computed ignores the existance of SOME of our NoData areas, but not all of them! What is wrong here??? We cannot find the issue!!!
The hydrography map with island in question: note the value is NoData for a point I chose inside the island geometry.
The resulting shortest path. Kinda hard for a boat to do that!
The cost array and it's value at the island location.
The call is so stupid for getting a cost array that I cannot determine how the call could be messed up. As per code that ESRI did for us: we pass the hydrography map, the target point, and call GetCostDistanceFull
Here is our call to get the cost distance and backlink arrays.
private static IGeoDataset[] ComputeFullRaster(IFeatureClass origin, RasterDataset costArray, IGPMessages messages)
{
List<IGeoDataset> results = new List<IGeoDataset>();
IDistanceOp distanceOp = new RasterDistanceOpClass();
// Create the cost distance
messages.AddMessage("Creating the distance cost raster...");
object objectMissing = Type.Missing;
results.Add( distanceOp.CostDistanceFull(
(IGeoDataset)origin, (IGeoDataset)costArray,
true, false,
false, ref objectMissing, ref objectMissing) );
messages.AddMessage("Creating the backlink cost raster...");
results.Add(distanceOp.CostDistanceFull(
(IGeoDataset)origin, (IGeoDataset)costArray,
false, true,
false, ref objectMissing, ref objectMissing));
return results.ToArray();
}