[gdal-dev] NoData support in GIO

Frank Warmerdam warmerdam at p...
Tue Sep 11 09:53:25 EDT 2001


Andrew.Loughhead at f... wrote:
> hi,
> 
> GDAL, or more precisely GDALRasterBand::GetNoDataValue, does not
> currently get the NoData value associated with ESRI grids using
> the GIO / avgridio.dll driver. I'm hoping for a pointer towards
> what needs to be implemented where in order for a NoData value
> to be returned. 

Andrew,

I have just added nodata support to the AIGDataset code (in
aigdataset.cpp). Please feel free to do the same for giodataset.cpp.

Basically, you need to implement the GetNoDataValue() method on
GIORasterBand. Look at the implementation in aigdataset.cpp, and
copy it. You will need to return a different value for the nodata
value though. I am not exactly sure what it is supposed to be
when directly accessing through avgridio.dll. I guess you will
have to read up on it, or experiment.

> An associated issue is that GDAL seems to disregard the type of
> ESRI grid that is being opened. So the GDALRasterBand member
> eDataType is always set to GDT_Float32. That is appropriate for
> ESRI floating point grids, but not really for integer grids. 
> 
> I am struggling to see where to modify GDAL to address these issues
> so would appreciate pointers. I am fairly familiar with the
> avgridio library. 

In GIORasterBand::GIORasterBand() you will need to set eDataType to
the appropriate value (ie. GDT_Float32, GDT_Int32, GDT_Byte, ...).
Then update IReadBlock() to read appropriately. If you just support
Float32 and Int32, it might be sufficient to use the non-float version
of GetWindowRowFloat() if the layer is integer.

If you find it too difficult to update my code, let me know and I will do
the updates.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list