[Gdal-dev] Warping GeoTIFF colour image - beginner question(s)

Frank Warmerdam fwarmerdam at gmail.com
Mon May 2 14:25:53 EDT 2005


On 5/2/05, Ilya Serebrianik <predator2448 at hotmail.com> wrote:
> psWarpOptions->panSrcBands = (int *) CPLMalloc(sizeof(int) *
> psWarpOptions->nBandCount);
> psWarpOptions->panSrcBands[0] = 1;
> psWarpOptions->panSrcBands[1] = 1;
> psWarpOptions->panSrcBands[2] = 1;
> psWarpOptions->panDstBands = (int *) CPLMalloc(sizeof(int) *
> psWarpOptions->nBandCount);
> psWarpOptions->panDstBands[0] = 1;
> psWarpOptions->panDstBands[1] = 1;
> psWarpOptions->panDstBands[2] = 1; 

Ilya, 

I think you want the src and dst bands to be:

> psWarpOptions->panSrcBands[0] = 1;
> psWarpOptions->panSrcBands[1] = 2;
> psWarpOptions->panSrcBands[2] = 3;
> psWarpOptions->panDstBands[0] = 1;
> psWarpOptions->panDstBands[1] = 2;
> psWarpOptions->panDstBands[2] = 3; 

This would explain why you are getting greyscale output.
I'm less clear on this squishing effect you are seeing.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list