[gdal-dev] Re: Rasterlite / WSGI problem

Radim Blazek radim.blazek at gmail.com
Wed Nov 30 07:34:45 EST 2011


On Wed, Nov 30, 2011 at 11:28 AM, Even Rouault
<even.rouault at mines-paris.org> wrote:
>> BTW, if RasterliteBand::IReadBlock fails, it does not return an error
>> and silently sets image to black (rasterlitedataset.cpp:98):
>>
>>     OGRLayerH hSQLLyr = OGR_DS_ExecuteSQL(poGDS->hDS, osSQL.c_str(),
>> NULL, NULL);
>>     if (hSQLLyr == NULL)
>>     {
>>         memset(pImage, 0, nBlockXSize * nBlockYSize * nDataTypeSize);
>>         return CE_None;
>>     }
>>
>> Is it OK?
>
> Perhaps CE_Failure would be more appropriate indeed. In the event of an empty
> result set, this should return a valid layer, so NULL is definitely when
> something is wrong. You can try returning CE_Failure and if it works as you
> expect, feel free to commit the change.

I have tried to set error message with CPLError and return CE_Failure,
but the error message set here is lost and mapserver gets something
like "error reading block 0 0 ..".

Sorry, I have lost already too much time on this, so I am not going to
work on it more.

Radim


More information about the gdal-dev mailing list