[gdal-dev] Overview building broken
Benoît Andrieu
bea at ixsea.com
Wed Dec 10 08:02:15 EST 2008
Hi all !
I am using FWTools 2.2.6 and have some problems with the overview
building...
I just tried the 2.2.8 release, same result !
My software tries to build a x level overview pyramid on a GTiff.
I am using the following code :
CPLErr statut_generation_pyramidage =
gdal_dataset_copie->BuildOverviews("average", nb_pyramidage, anOverviewList,
0, NULL, NULL, NULL);
The function is returning CE_Failure and the console has a lot of messages
which appears on the call of the BuildOverviews' method.
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "Compression" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "ImageWidth" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "PlanarConfiguration" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "BitsPerSample" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "SamplesPerPixel" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "Compression" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "PhotometricInterpretation" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "SampleFormat" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "TileWidth" while writing
ERROR 1: TIFFSetField:f:\test_isdas\PIC_CONT_SS_F_4_8bit.TIF: Cannot modify
tag "TileLength" while writing
ERROR 1: GTIFFWriteDirectory:Can not write tiles to a stripped image
The complete call sequence is (without some instanciations) :
GDALDataset* gdal_dataset_copie = poDriver->CreateCopy(string_fileOut,
gdal_dataset, TRUE, options_, NULL, NULL);
char **options = 0;
GDALDriver *gdal_driver = GetGDALDriverManager()->GetDriverByName("MEM");
GDALDataset* gdal_dataset = gdal_driver->Create("", image->Get_Largeur(),
image->Get_Hauteur(), nbCanaux, depth, options);
gdal_dataset->FlushCache();
gdal_dataset->GetRasterBand(1)->SetColorInterpretation(GCI_GrayIndex);
//
// Filling the dataset with data
//
gdal_dataset->FlushCache();
GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName("GTIFF");
char **options_ = 0;
options_ = CSLSetNameValue( options, "INTERLEAVE", "PIXEL" );
gdal_dataset->SetProjection( string_WKT );
gdal_dataset->SetGeoTransform( m_P_D_TFW );
GDALDataset* gdal_dataset_copie = poDriver->CreateCopy(string_fileOut,
gdal_dataset, TRUE, options_, NULL, NULL);
gdal_dataset_copie->FlushCache();
CPLErr statut_generation_pyramidage =
gdal_dataset_copie->BuildOverviews("average", nb_pyramidage, anOverviewList,
0, NULL, NULL, NULL);
gdal_dataset_copie->GetRasterBand(index_band)->SetColorInterpretation(poBand->GetColorInterpretation());
gdal_dataset_copie->FlushCache();
delete gdal_dataset_copie;
delete gdal_dataset;
This code was working with FWTools 1.3.2. I don't know what to do now... I
don't want to close the dataset, reopen it, build overview, close the
dataset because of the loss of performance (which is really important).
Any idea ?
Thanks in advance !
Best regards,
Benoît Andrieu
+33.(0)1.30.08.95.21
bea at ixsea.com
More information about the gdal-dev
mailing list