Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

in Qgis i set Min/Max values of rasterband, to apply the chnage to the image channels i developpe this code in c++ but no thing has changed in image:

GDALDataset *ptRasterDataSet;
ptRasterDataSet = ( GDALDataset * ) GDALOpen ( m_ptRasterLayer->source ().toStdString 
).c_str (), GA_Update );

for ( int iIterator = 1; iIterator <= ptRasterDataSet->GetRasterCount (); ++ iIterator )
    {
        GDALRasterBand *ptRasterBand = ptRasterDataSet->GetRasterBand ( iIterator );

ptRasterBand->SetStatistics ( m_ptRasterLayer->minimumValue ( iIterator ), m_ptRasterLayer->maximumValue ( iIterator ), dMean, dStdDev ) ;
}

dMean is mean value and dStdDev is standard deviation calculated using histogram values after change

share|improve this question
Suggestion: write in the QGIS developer mailing list. Another suggestion: write plugins in python instead of C++ unless you are going to contribute it upstream in the main QGIS code. There are a lot of examples of good C++ plugins that weren't contributed upstream and simply died in a short time. – Giovanni Manghi Aug 23 '12 at 8:24

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.