Select to view content in your preferred language

Setting a Raster Band to Null

792
4
05-03-2013 04:49 AM
DavidMartin
Frequent Contributor
I am creating a series of multi-band rasters. Each band represents a variable and so band number is important - it will be used to identify the variable.

But sometimes, data for a variable might be completely missing (i.e. I have no raster for the variable, and so have nothing with which to create the relevant band). Missing out this band would mean that the order of the subsequent bands would be altered, which compromises identification of the variable by band number.

So can I set a band to Null? Or would I have to generate a Null Raster and use that? If the latter, what would be the most efficient way to generate the Null Raster Band?
0 Kudos
4 Replies
DuncanHornby
MVP Notable Contributor
David,

I'm not really a raster "guru" so maybe giving you bad advice but for the record I've just tested this scenario. I created 4 constant value rasters first was 1, second was 2, third was NODATA and fourth was 3. I used the Composite Bands tool to combine them and it created a 4 band raster where the 3 band was just NODATA values, so it can be done. I just don't know what implications this would have on display or processing?

Duncan
0 Kudos
DavidMartin
Frequent Contributor
Thanks for testing it! However, one of my issues is that I don't know until runtime what the extent of the multi-band raster will be. Meanwhile, to create my NODATA raster, I'd clearly need an extent (and I guess I might also need to ensure that its cell size is the same as the other bands??). If the variable that should go in Band 1 is missing, then I don't yet have any other bands to refer to in order to get the extent or cell size... which is why I was hoping that it might be possible simply to have a "missing" band...
0 Kudos
RobertBorchert
Honored Contributor
Open the layer properties for your raster layer.

Click the symbology tab

If you raster is displayed as RGB Composite

Where is says display background value :(R,G,B)

Check the box.  There are values there for RGB, either select 0,0,0 or where is shows as and the color selector choose no color.  Where is shows Display NoData as choose no color. 

If it is diplayed as Stretched check the Display Background Value make it 0 and the rest is the same


that way you won't have the banding where there is not data.

I am creating a series of multi-band rasters. Each band represents a variable and so band number is important - it will be used to identify the variable.

But sometimes, data for a variable might be completely missing (i.e. I have no raster for the variable, and so have nothing with which to create the relevant band). Missing out this band would mean that the order of the subsequent bands would be altered, which compromises identification of the variable by band number.

So can I set a band to Null? Or would I have to generate a Null Raster and use that? If the latter, what would be the most efficient way to generate the Null Raster Band?
0 Kudos
DavidMartin
Frequent Contributor
Thanks, although that would only affect the display of the raster after it has been created. I'm faced with trying to create multi-band rasters with, say, 10 bands. Each band represents an environmental variable. I will later want to apply an Extract Band Raster Function to these rasters in order to pull out specific environmental variables, and so each variable must correspond to a constant band number. But if, when I'm creating the raster, I have a missing variable, then omitting it could affect the band numbers of all the other bands, UNLESS I can in some way have a "missing" band (or a quick and simple way of filling it with NODATA).

And as stated above, I have the difficulty that if the variable for the first band is missing, then I don't yet know the extent or cell size of my raster in order to create a suitable constant raster that is filled with NODATA.
0 Kudos