[gdal-dev] Re: TIFF write and comparison

Akhil Jaggarwal axj4159 at cs.rit.edu
Mon Sep 13 14:30:05 EDT 2010


Hi,

I've shortened my questions to exactly this part of the code:

 // read datasets, compare data and write
                       if ( (pafScanline2[j] > 6 || pafScanline3[j] > 950) &&
                                       pafScanline[j] == 2) {
                               GDALRasterIO( hDestDS, GF_Write, 0,0, i,j,
                                               change1, i, j, GDT_Byte, 0,0);
                       }
                       else if( (pafScanline4[j] < -700) &&
                                       pafScanline[j] == 6 ) {
                               GDALRasterIO( hDestDS, GF_Write, 0,0, i,j,
                                               change2, i, j, GDT_Byte, 0,0);
                       }
                       else if( (pafScanline2[j] > 6) && pafScanline[j] == 3 ) {
                               GDALRasterIO( hDestDS, GF_Write, 0,0, i,j,
                                               change2, i, j, GDT_Byte, 0,0);
                       }
                       else if((pafScanline3[j]>1500) && pafScanline[j] == 6) {
                               GDALRasterIO( hDestDS, GF_Write, 0,0, i,j,
                                               change1, i, j, GDT_Byte, 0,0);
                       }
                       else
                               GDALRasterIO( hDestDS, GF_Write, 0,0, i,j,
                                               &pafScanline[j], i, j,
GDT_Byte, 0,0);
               //      printf("%u\n", pafScanline[j]);


1) Am I writing pixels the correct way?

As of now I am getting just the exact copy of the input TIFF without
any pixel modifications. Where step am I doing wrong.

Any help would be great!

Thanks.


More information about the gdal-dev mailing list