/* Name: con2.aml /* Function: Set NODATA value for all grids in the folder /* Author: Maxim Dubinin /* sim@gis-lab.info /* Created 04/20/2006 /* Last Update: 05/18/2006 /* Notes: /****************** THIS AML MUST BE RUN IN ARC/INFO WORKSTATION ***************************** &args sourcedir outputdir /* Usage error handling &if [null %sourcedir%] &then &do &type &type Usage: &r setnull {output folder} &type &ret &end &workspace %sourcedir% &type Workspace set to %sourcedir% grid /* If user specified the current directory, get a list of all file names to use &do &s inf = covs.lst &if [filelist * covs.lst -grid] < 0 &then &ret Error creating grids list &end /* Open list file if able &s infile := [open %inf% status -read] &s addleter := 'z' &if %status% <> 0 &then &return &warning Error opening file. &setvar current := [read %infile% readstatus] &if %readstatus% <> 0 &then &return &warning Could not read file. /* Select each import file from list, if coverage exists, project it &do &while %readstatus% = 0 &if [exists %current% -grid] &then &do &sv output = [UNQUOTE %addleter%]%current% &if %outputdir% <> null &then &do &s output := [UNQUOTE %outputdir%]%output% &end /* &type Convert GRID %current% to new GRID %output% &type %output% = con(%current% >= 32768, %current% - 65536, %current%) %output% = setnull(%current% <= -3000, %current%) kill %current% /* Read next line. &setvar current := [read %infile% readstatus] &end &end q /* Close file. &if [close %infile%] <> 0 &then &type Unable to close %infile%. &if [delete %inf%] <> 0 &then &type Unable to delete %inf%. &return Finished