' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: concgrid.ave 'Version: 1.0 'Date: 02/17/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' 'Modified: 02/28/97 ' Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' 1) changed the message box description to reflect the script ' 2) added purpose and description ' 3) changed pathname for the data file to be saved ' 4) took out error message of only one theme found ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'A concentration grid is computed for the land surface using the landuse cover which is linked 'to the EMC values. The resulting grid is called concgrid and is in mg/l. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' '----------------- '--- Get theme --- '----------------- ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "CONC GRID") exit end thefthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "ftheme") then thefthemes.add(thetheme) end end if (thefthemes.count = 0) then msgbox.error("No feature themes found", "CONC GRID") exit end theptheme = msgbox.listasstring(thefthemes, "Landuse theme", "CONC GRID") if (theptheme = nil) then exit end thepftab = theptheme.getftab thepshapef = thepftab.findfield("shape") thepshape = thepftab.returnvalue(thepshapef, 0) if (not (thepshape.getclass.getclassname = "polygon")) then msgbox.error("Theme needs to be a polygon theme", "CONC GRID") exit end ' '----------------- '--- Get field --- '----------------- ' thepfields = thepftab.getfields thecfield = msgbox.listasstring(thepfields, "Choose concentration field", "CONC GRID") ' '----------------- '--- Calculate --- '----------------- ' cellsize = number.makenull dummmy = grid.getanalysiscellsize(cellsize) extent = rect.makenull dummy = grid.getanalysisextent(extent) concgrid = grid.makefromftab(thepftab, prj.makenull, thecfield, {cellsize, extent}) 'exit concfilename = av.getproject.makefilename("concgrid", "") concgrid.savedataset("/home/ferdi/quenzer/trialrun/concgrid".asfilename) concgtheme = gtheme.make(concgrid) theview.addtheme(concgtheme) concgtheme.setvisible(true) ' 'final message to user ' message = "Concentration grid calculated." msgbox.info(message,"CONC GRID") ' '----------- '--- End --- '----------- '