[Qgis-developer] Re: Segmentation fault while reading raster maps
Peter Ersts
ersts at amnh.org
Thu Feb 12 13:21:46 EST 2009
Howdy JJL.
mColorShadingAlgorithm is an enum so it will always be initialized. Your
suggested fix works because you have effectively just "turned off"
shading. The little code snipped you sent in the previous message seems
to work fine with valid rasters, three band as well as paletted.
I am inclined to believe that the problem has to do with your data being
recognized as a paletted image, but the color table is missing, which we
should be able to gracefully deal with no matter. Any chance that one
of your layers has a .qml associated with it?
If you possible, could you send me a link to where I could get a copy of
one of your images that is causing the segfaults?
-pete
JJL wrote:
> Hello again,
>
> 2009/2/11 JJL <buggerone at gmail.com>:
>
>> I have a segmentation fault with a python plugin when I do some
>> multiples reading of raster maps.
>>
> I still have the problem with trunk but I think I found the bug in
> QgsRasterLayer class.
>
> mColorShadingAlgorithm is used uninitialized in
> setColorShadingAlgorithm() after the QgsRasterLayer instance is
> created. So if it has the same value as theShadingAlgorithm the
> setRasterShaderFunction() is not called on mRasterShader.
>
> If I simply add :
> mColorShadingAlgorithm = QgsRasterLayer::UndefinedShader;
> to the QgsRasterLayer constructor, I have no more crash. I'm not sure
> this is the right value to use for init.
>
> Should I fill a bug in trac for this to be included in next
> maintenance release ?
>
> Regards
> JJL
>
>
--
====================================
Peter J. Ersts, Project Specialist
American Museum of Natural History
Center for Biodiversity and Conservation
Central Park West at 79th Street
New York, New York 10024
Tel: Home Office (518)-632-4745 or NYC Office (212)-496-3488
Web: http://biodiversityinformatics.amnh.org
Web: http://cbc.amnh.org
Quantum GIS Raster Development Team. Visit http://www.qgis.org
to learn more about QGIS, a free and open source desktop GIS
Open Source,
...evolving through community cooperation to change the world bit by bit
More information about the Qgis-developer
mailing list