[gdal-dev] Return from Set/GetNoDataValue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Return from Set/GetNoDataValue

Andrew Bell
Perhaps this is a documentation issue, but I ran into:

double BTRasterBand::GetNoDataValue( int* pbSuccess /*= NULL */ )
{
    if(pbSuccess != NULL)
        *pbSuccess = TRUE;

    return -32768;
}

CPLErr BTRasterBand::SetNoDataValue( double )

{
    return CE_None;
}

It seems as if you can't set or fetch a nodata value, an error should be returned.  In this case, the code indicates no error.  How is one supposed to know (other than reading the code) that you can't set a value if success is returned if this operation isn't supported?

Thanks,

--
Andrew Bell
[hidden email]

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Return from Set/GetNoDataValue

Even Rouault-2

Hi Andrew,

 

> Perhaps this is a documentation issue,

 

I think this is mostly an implementation issue in a niche driver. The changeset that introduced this ( https://trac.osgeo.org/gdal/changeset/21821 ) isn't very verbose of the motivation. I suspect that the intent was to benefit from PAM for a few things, but not wanting to generate a .aux.xml file when SetNoDataValue() is called.

 

I've changed this in https://trac.osgeo.org/gdal/changeset/40003 to use the PAM .aux.xml file to laod non-default nodata value on GetNoDataValue(), and write into PAM on SetNoDataValue() if the value is different than the default one. Should be a reasonable compromise on the presumed original intent.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev