Hi i have code loke belov. I set NoData value to my pRaster (IRaster2) as value - 9999. but when i use GetPixelValue(0, x, y) at pixel location whit NoData i have value = 0. do anybody know where is mistake? Or how to set my NoData Value correctly ?
dim pRaster as IRaster2 . . pRasPropsIn = CType(pRaster, IRasterProps) pRasPropsIn.NoDataValue = -9999 'urcovanie hodnoty no data . . dim pValue as Single pValue = pRaster.GetPixelValue(0, x, y)
Having set the NoData value have you tried to save the raster first using ISaveAs to commit the change? The help file says
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.