I have a Geoeye 1 satellite photo that's a 4-band multispectral B,G,R,NIR, 11 bit raster.

Ultimately I want to publish this raster as a web service (using Mapserver). I opened up the raster in Qgis just to look at it and I noticed that it took an unusually long time to load it, which does not bode well for an quick and responsive web service.

So I concluded that it would be good if the raster could be transformed into a "normal" RGB raster.

Is it possible to process a RGB+NIR raster into a "standard" RGB raster? How can this be done?

Here's what gdalinfo reports on the bands of the raster http://pastebin.com/1bQ9Lh16 As you can see there's a fourth band with no color intepretation, yet if I would just remove this band I end up with a quite blue image. So somehow it seems to contribute to the visual appearance nevertheless.

  • 1
    Hi @Vincent, just as an aside, you should probably check your Geoeye image licence very carefully before publishing the data on the internet. I don't know about GeoEye exactly, but many satellite data providers have licence agreements that would restrict this type of 'external' publication and redistribution even in derived or modified forms. Better to be safe by checking first. – WhiteboxDev Aug 27 '14 at 12:27

the best way is to use vrt (virtual raster template). with gdalbuildvrt you can extract each band in a single vrt file using the -b option. Then you concatenate into a single stacked image using gdalbuildvrt -separate . If you wish, you can then create a tiff file using gdaltranslate (with the -co TILED=YES option), but this is not necessary as QGIS reads the vrt files.

For faster display, note that creating the pyramids (e.g. using gdal_retile) is more than usefull. It takes some time but it only need to be done once.

  • Hello @radouxju, I've tried the method which you describe but I don't end up with any good results. What I've done is: gdalbuildvrt -b N bandN.vrt raster.tif for each band gdalbuildvrt -separate stacked.vrt band1.vrt band2.vrt ... gdal_translate test.tif stacked.vrt The resulting image 'test.tif' appears very blue in Qgis, identical to an earlier attempt where I just removed the fourth band directly. Here's what gdalinfo thinks of the bands of test.tif pastebin.com/vQSSqU23 – Vincent Aug 28 '14 at 6:35
  • Blocksize and Colorinterp are not the same as your original. Normally, RGB has values between 0 and 255, the max values might be NODATA. You might have to set those values manually in the vrt.See also gis.stackexchange.com/questions/48034/… and lists.osgeo.org/pipermail/gdal-dev/2011-April/028455.html – AndreJ Aug 28 '14 at 6:59
  • you should not have four bands, but only three (don't take band4 in your new stack). Note that the color can be adjusted in QGIS : this is not a problem of content. – radouxju Aug 28 '14 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.