[gdal-dev] creating multi banded imagery

Jared Rubin JARED.RUBIN at saic.com
Mon May 12 19:26:00 EDT 2008


Dear group,
  Is there a gdal format that allows for n-banded imagery? So something like 
the following in python in which I attempt to create a 10 banded image?
thanks

import sys,os,string,shutil
import osgeo.gdal
from osgeo.gdalconst import *
import numpy
from numpy import *

buf = zeros((10,10))
driver = osgeo.gdal.GetDriverByName('NITF')
dst = driver.Create('tmp.nitf', 10, 10, 1, osgeo.gdal.GDT_UInt16)
dst.GetRasterBand(1).WriteArray(buf)
dst.GetRasterBand(2).WriteArray(buf)
dst.GetRasterBand(3).WriteArray(buf)
dst.GetRasterBand(4).WriteArray(buf)
dst.GetRasterBand(5).WriteArray(buf)
dst.GetRasterBand(6).WriteArray(buf)
dst.GetRasterBand(7).WriteArray(buf)
dst.GetRasterBand(8).WriteArray(buf)
dst.GetRasterBand(9).WriteArray(buf)
dst.GetRasterBand(10).WriteArray(buf)


More information about the gdal-dev mailing list