RGB_to_GeoTIFF_Export.sml

  Download

More scripts: Import & Export

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
#  RGB_to_GeoTIFF_Export.sml
#
#  This is a simple example showing how to set up a HASH of RVC_OBJITEMS for use in the 
#  function "DlgGetObjectSet()" and the method "MieHANDLE::ExportObjects()".  When run,
#  the script will prompt the user to select the 3 R-G-B bands, and then export them to a single
#  GeoTIFF file also selected by the user.
#
#  Date Written:  12 December 2006
#  Written By:  Dave Breitwisch
#
#  Requires TNTmips2006:72 
#
clear();
class RVC_OBJITEM objitemlist[];
class RVC_DESCRIPTOR descriptor;
descriptor.SetName("Red");
objitemlist[1].SetDescriptor(descriptor);
descriptor.SetName("Green");
objitemlist[2].SetDescriptor(descriptor);
descriptor.SetName("Blue");
objitemlist[3].SetDescriptor(descriptor);
class STRINGLIST labels;
labels.AddToEnd("Red");
labels.AddToEnd("Green");
labels.AddToEnd("Blue");
DlgGetObjectSet("Select Input RGB bands", "Raster", labels, objitemlist, "ExistingOnly,AllowAutoName"); 
class FILEPATH tgtpath = GetOutputFileName("c:/test.tif", "Select Output GeoTIFF file", "tif");
class MieGeoTIFF geotiff;
geotiff.ExportObjects(objitemlist, tgtpath);