'**** View.LoadDRG '**** loads an ERDAS GIS image and assigns the colormap according to the '**** USGS DRG standard palette: ' Digital Number Color Red Green Blue ' ' 0 Black 0 0 0 ' 1 White 255 255 255 ' 2 Blue 0 151 164 ' 3 Red 203 0 23 ' 4 Brown 131 66 37 ' 5 Green 201 234 157 ' 6 Purple 137 51 128 ' 7 Yellow 255 234 0 ' 8 Light Blue 167 226 226 ' 9 Light Red 255 184 184 ' 10 Light Purple 218 179 214 ' 11 Light Grey 209 209 209 ' 12 Light Brown 207 164 142 pl = {{ 0, 0, 0}, {255, 255, 255}, { 0, 151, 164}, {203, 0, 23}, {131, 66, 37}, {201, 234, 157}, {137, 51, 128}, {255, 234, 0}, {167, 226, 226}, {255, 184, 184}, {218, 179, 214}, {209, 209, 209}, {207, 164, 142}} theView = av.GetActiveDoc theIFN = FileDialog.Show("*.gis","GIS Files","Pick ERDAS Image to open") if (theIFN = nil) then return nil end theISrc = ISrc.Make(theIFN.AsString.AsSrcName) theITheme = ITheme.Make(theISrc) IL = IdentityLookup.Make CM = ColorMap.MakeNominal(13) i = 0 for each rgb in pl theColor = cm.Get(i) theColor.SetRgbList(rgb) i = i + 1 end SBL = SingleBandLegend.Make(0,IL,CM) theITheme.SetLegend(SBL) theView.AddTheme(theITheme)