Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment
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
add comment

Your Answer

 
discard

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.