[Qgis-developer] Re: Problem loading ECW file type in code examples while ECW support is enabled!

forum account omgforum2012 at gmail.com
Sat Feb 25 10:13:55 EST 2012


Hi again,

I could solve my problem. After commenting these three lines ECW file type
loaded successfully, however DEM file type will be shown in gray.

//  myLayer->setDrawingStyle( QgsRasterLayer::SingleBandPseudoColor );
//  myLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColorShader );
//
myLayer->setContrastEnhancementAlgorithm(QgsContrastEnhancement::StretchToMinimumMaximum,
false );

hope this help somebody in future.

Cheers,

-Sam

On Wed, Feb 22, 2012 at 7:22 PM, forum account <omgforum2012 at gmail.com>wrote:

> Hi,
>
> I'm new to QGIS. I was able to compile GDAL 1.8.1 with ecw support on
> ubuntu, then I built QGIS from source and now I'm able to load ECW file
> types.
> To create my own gis application I started looking into code examples
> available at https://svn.osgeo.org/qgis/trunk/code_examples/
> I tried 1_hello_world_qgis_style and it worked fine for SHP file types.
> Then I tried 4_adding_rasters_to_canvas and built it from source in
> QtCreator.
> I'm able to load TIFF and DEM file types but I can't load ECW file types.
> I traced QGIS source code but I couldn't find any special difference
> between QGIS and the example code. Should I add some extra code to the
> example project to enable ECW support?!
> I really appreciate your help in advance.
>
> PS: I'm sending this email to both user and developer mailing list, so I'm
> sorry if you receive this email more than once.
>
> -Sam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120225/037f9323/attachment-0001.html


More information about the Qgis-developer mailing list