Showing results for 
Search instead for 
Do you mean 

Custom Layer Names in SML

by Technical Evangelist on ‎10-02-2015 12:24 PM - edited on ‎03-25-2016 02:54 AM by Anonymous (276 Views)

Question: Is it possible to create an output raster with personalized band names in spatial model, rather than having to use the ImageInfo for manual input?

Answer: Yes, thought it is not possible in a graphical model. One must generate an sml script and modify it in order to customly name output bands.


 

Custom Layer Names in SML

In the section of the SML script where variables declaration is supplied one usually see for a raster output a code similar to the following:

RASTER output FILE NEW "/usr/data/newfile.img";

This will create a new image file named /usr/data/newfile.img. The number of layers in the file, and the number of layers in the variable output will be determined when an assignment is made to the variable output. These names will be named according to the default pattern, i.e. Layer_1 for the first band, Layer_2 for the second band, and so forth for the entire list of output layers.

To customize the naming of the image output bands, the declarations for the raster output must include a layer portion at the end of the supplied output's full path name:

RASTER output FILE NEW "/usr/data/newfile.img(:Blue, :Green, :Red)";

 

In the above example the new file will consists of three layers, namely Blue, Green and Red respectively for the first, second and third band.

Note: Layer names cannot contain spaces, use underscores instead, e.g. "Blue_band".

Contributors