Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have our maps laid out using hydrography maps from NOAA. We had to run the graphics through several steps to create the water feature raster. I have a process that pulls in that raster, sets a start and end point, and computes a Polyline which provides my distance between points. But we were getting strange results that had to be figured out. I added the cost array to the map and it is a regular, circular growth from the target point out. In a few places it appears to follow rivers but mostly it ignores the existance of land.

It reports values as being between 0 and 17xx. I'm concerned about the cost value of 0 as I though no raster can have a value of 0. So is this because I need to convert 0 to NoData? And if that is the case how do I do the conversion?

share|improve this question

You can assign all '0' values to No Data in ArcObjects using the 'NoDataValue' property in IRasterProps. This is the easiest means of excluding a pixels containing a single value within a raster.

From the help, keep in mind:

These modifications only affect the in-memory raster representation and in no way change any of the raster dataset. You can persist the modifications to a new raster datast using ISaveAs::SaveAs or IRasterBandCollection::SaveAs

Outside of ArcObjects you can assign a no data value by exporting the raster file:

enter image description here

share|improve this answer
up vote 0 down vote accepted

Well it turns out that the problem was not in our code. We read each hydrography layer out of a raster database. I guess a number of us assumed that the raster database contained pointers to the external maps that we display. WRONG.

The raster database contained very old versions which we then had to rebuild with what is currently in the database. Once we did that our cost rasters properly followed the waterway!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.