Appendix 3 - All AML codes: /*-------------------------------------------------------------------------------------- /* appendbox.aml adds the Mercator projected, point generated, "box" coverage matching /* the CoastWatch map extent to all the vector coverages in a workspace /* written by Pat Trimble 02/14/97, modified 5/21/98 /* The output files, which are made of the digitized coverage plus the box coverage with /* a greater map extent) are designated with the letter 'a' after the usual name. /* /* The append command is executed for all coverages in as append cover'a', poly, all /* /* USAGE: append, coverage, box, return (the tilde) yes, yes /* /* Note: You should be in the workspace of the source coverages when running this program. /* In addition, the box coverage must be in the workspace where appendbox is executed. /*------------------------------------------------------------------------------------ &s count := [filelist *m covlist -cover] &if %count% = 0 &then &return No coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] &type &type Coverage is now being appended &type append %cover%a poly all %cover% box ~ y y &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /* -------------------------------------------------------------------------------------------- /* ascii_qc.aml /* /* Creates ASCII file of (.pat) to compare to original ASCII /* attribute file (.txt) /* ----------------------------------------------------------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else /* /* create temporary .pat file /* copyinfo %cov%.pat temp.pat /* /* start arcplot, select records, sort records by polygon-id /* ap reselect temp.pat INFO %cov%-id > 400 sort temp.pat info %cov%-id /* /* create output file /* &if [exists %cov%.asc -file] = .TRUE. &then &sys rm %cov%.asc listoutput %cov%.asc list temp.pat INFO %cov%-id ct ca cb cc sn sa sb sc sd fa fb fc n listoutput screen /* /* quit ap, start tables, kill temporary .pat file /* q tables $kill temp.pat q &return /*------------------------------------------------------------------------------------------------------------ /* attr_monthnum.aml written by Pat Trimble modified 5-22-98 /* /* Sets the workspace and operates an aml to alter the naming convention of the grids /* from the 3 character month designation to a 2 digit numerical designation for each /* of the 13 egg code ice attributes /* /*----------------------------------------------------------------------------------- &type &r /gis/LakeIce/amls/monthnumdec12.aml &r /gis/LakeIce/amls/monthnumjan01.aml &r /gis/LakeIce/amls/monthnumfeb02.aml &r /gis/LakeIce/amls/monthnummar03.aml &r /gis/LakeIce/amls/monthnumapr04.aml &r /gis/LakeIce/amls/monthnummay05.aml /* --------------------------------------------------------------------- /* build_after_append.aml by Pat Trimble 10/22/96 /* modified 5/21/98 /* /* Builds all polygon coverages "poly" that end in an 'a' in a workspace /* /* Note: User should be in the workspace of the source coverages. /* /* /*---------------------------------------------------------------------- &s count := [filelist *a covlist -cover] &if %count% = 0 &then &return No polygon coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] build %cover% poly &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /* ------------------------------------------------------------------ /* cio.aml /* formerly create_iat-old.aml /* /* creates ice attribute table (.iat) from ASCII attribute /* files (.txt) /* ---------------------------------------------------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &sv choice = [query quit] &if %choice% = .true. &then &return &type &goto new &end &else &if [exists %cov%.iat -INFO] &then &do &sv choice = [query [quote %cov%.iat already exits, delete %cov%.iat] .TRUE.] &if %choice% = .TRUE. &then &do tables $kill %cov%.iat quit &end &else &return &end /* /* copy info file and alter cover-id /* copyinfo /gis/LakeIce/ice_attr.iat %cov%.iat tables select %cov%.iat alter cover-id %cov%-id ~ ~ ~ add from %cov%.txt quit &return /* ------------------------------------------------------------------------ /* cleanreplace.aml /* /* cleanreplace.aml kills the origial coverage () and renames the /* cleaned coverage (_cl) to the original covearge name. /* ------------------------------------------------------------------------ &type &sv cov = [response 'Enter coverage name'] &if [exists %cov%_cl -cover] = .FALSE. &then &do &type &type Cleaned coverage %cov%_cl does not exist! &type &return &end &else &if [exists %cov% -cover] = .FALSE. &then &do &type &type Original coverage %cov% does not exits! &type &return &end &else kill %cov% all &type &type %cov%_cl renamed to %cov% &type rename %cov%_cl %cov% &return /*--------------------------------------------------------------------------------------- /* copycov.aml copies all coverages in area to new area /* copieruscov.aml by Ned Morse ( ) and Pat Trimble 10/22/96 /* /* Copies all polygon coverages beginning with a 'u' in workspace to a user defined destination /* /* Note: User should be in the workspace of the source coverages. /* &setvar dest := [response 'Enter the where you want to put ~ the new coverages. The default is the current workspace' .] &type &s count := [filelist * covlist -cover] &if %count% = 0 &then &return No polygon coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] &type copy %cover% %dest%/%cover% &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /* ----------------------------------------------------------------------- /* create_iat.aml /* /* Modified by Ned Morse 8/16/96 to work with numeric item types and new /* item names as estabilished by Dave Norton. /* /* Also will be made to run in batch mode on all .txt files in /* workspace to create an ice attribute table (.iat) for each /* cover in workspace. /* ----------------------------------------------------------------------- &s count := [filelist *.egg txtlist.myfile -file] &if %count% <= 0 &then &return No ~*.egg files found in the current workspace. &s unit := [open txtlist.myfile ok -read] &do I := 1 &to %count% &s thecover := [before [read %unit% ok] .egg] &if [exists %thecover%.iat -INFO] &then &do &sv choice = [query [quote %thecover%.iat already exits, delete %thecover%.iat] .TRUE.] &if %choice% = .TRUE. &then &do /* &messages &off tables $kill %thecover%.iat quit /* &messages &on &end &else &return &end /* /* copy info file and alter cover-id /* copyinfo /gis/LakeIce/ice_attr.iat %thecover%.iat &messages &off tables select %thecover%.iat alter cover-id %thecover%-id ~ ~ ~ add from /gis/LakeIce/can/%thecover%.egg quit &messages &on &end &s ok := [close %unit%] &s ok := [delete txtlist.myfile -file] &return /* ------------------------------------------------------------- /* dropitems.aml /* /* Drops linked items from .pat /* ------------------------------------------------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else /* /* drop items /* &do item &list ct ca cb cc sn sa sb sc sd fa fb fc n dropitem %cov%.pat %cov%.pat %item% &end &type &type Coverage %cov% is now ready to be edited and relinked &type &return /*------------------------------------------------------------------------------- /* fixcov.aml /* /* This AML is to be used after errors have been found and fixed during /* quality control. This AML will sometimes be doing some unnecessary /* work, depending on what you fixed, but this does not cause any /* problems and is very fast. To create this AML a BUILD was put in /* sequence with: dropitems.aml + create_us_iat2.aml + icelink2.aml + /* ascii_qc.aml + sys compare2.c /* David Norton September 12, 1997 /* ------------------------------------------------------------- /* /* dropitems.aml /* /* Drops linked items from .pat /* ------------------------------------------------------------- &label new &type &sv cov = [response 'Enter coverage name'] /* build inserted here build %cov% poly &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else /* /* drop items /* &do item &list ct ca cb cc sn sa sb sc sd fa fb fc n dropitem %cov%.pat %cov%.pat %item% &end &type &type Coverage %cov% is now ready to be edited and relinked &type /* create_us_iat2.aml in abbreviated form follows tables $kill %cov%.iat quit /* /* copy info file and alter cover-id /* copyinfo /gis/LakeIce/ice_attr.iat %cov%.iat tables select %cov%.iat alter cover-id %cov%-id ~ ~ ~ /* Use the local txt file. add from %cov%.txt quit &type %cov%.iat created /* icelink2.aml follows /* /* Make sure there is a pat file. /* &if [exists %cov%.pat -INFO] = .FALSE. &then &do &type &type There is no %cov%.pat file! &type &type Exiting the program. &type &return &end /* /* Make sure there is an iat file. /* &if [exists %cov%.iat -INFO] = .FALSE. &then &do &type &type There is no %cov%.iat file! &type &type Exiting the program. &type &return &end /* /* join .iat to .pat /* joinitem %cov%.pat %cov%.iat %cov%.pat %cov%-id %cov%-id /* ----------------------------------------------------------------------- /* ascii_qc.aml included here /* /* Creates ASCII file of (.pat) to compare to original ASCII /* attribute file (.txt) /* ----------------------------------------------------------------------- /* /* create temporary .pat file /* copyinfo %cov%.pat temp.pat /* /* start arcplot, select records, sort records by polygon-id /* ap reselect temp.pat INFO %cov%-id > 400 sort temp.pat info %cov%-id /* /* create output file /* &if [exists %cov%.asc -file] = .TRUE. &then &sys rm %cov%.asc listoutput %cov%.asc list temp.pat INFO %cov%-id ct ca cb cc sn sa sb sc sd fa fb fc n listoutput screen /* /* quit ap, start tables, kill temporary .pat file /* quit tables $kill temp.pat quit /* /* use system compare2 /* &sys /gis/LakeIce/compare2 %cov% &type %cov% finished &return /*------------------------------------------------------------------------------- /* fixnica1.aml change basin and islands to Ct = -1 /* fixnica.aml Change ice polygon id's to 400+, and process coverages /* into *.pol and *.lab files. Processes all coverages in the area. /* The export NIC coverages (*.e00) must be processed with importer.aml /* before using this aml. &type &s count := [filelist g* covlist -cover] &if %count% = 0 &then &return No polygon coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cov := [read %unit% ok] /* /* start INFO and add 400 to the polygon id's with ice codes. /* &data arc info ARC SELECT [translate %cov%].PAT RESELECT ICECODE EQ 'NODATA' CALCULATE ICECODE = 'CT-1' SAVE [UPCASE %cov%].PAT INIT Q STOP &end &data arc info ARC SELECT [translate %cov%].PAT RESELECT ICECODE NE ' ' /*CALCULATE [translate %cov%]-ID = [translate %cov%]-ID + 400 CALCULATE [UPCASE %cov%]-ID = [UPCASE %cov%]-ID + 400 /*SAVE ALL YES SAVE [UPCASE %cov%].PAT INIT EXPORT /gis/LakeIce/norton/nic/%cov%.nic SDF NORMAL INIT [UPCASE %cov%]-ID,ICECODE Q STOP &end /* IDEDIT id required here to match up the new 400+ id's in the %cov%.pat /* to the pat.adf. If this is not done, BUILD will do the reverse and eliminate /* the new id's replacing them with the old ones. idedit %cov% poly /* break coverage into components &if [exists %cov%.pol -file] &then &do rm %cov%.pol &end &if [exists %cov%.lab -file] &then &do rm %cov%.lab &end ungenerate line %cov% %cov%.pol ungenerate point %cov% %cov%.lab &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /*------------------------------------------------------------------------------------- /* gd2ascii2.aml USES FILELIST INSTEAD OF LISTFILE /*--------------------------------------------------------------------------- /* gd2ascii.aml by Ned Morse 6/25/96 /* /* Modified by Pat Trimble 1-22-97 5-22-98 /* /* Converts grids in current directory to ascii. /* /* Allows user to determine the destination directory of the newly created files. /* /* Makes ascii grids for each item in the grid after count. /* /* Calls and runs the c program sp2i5 that sets cells into space delimited /* format. /* /*-------------------------------------------------------------------------------/* ============================================== /* Make sure there are grids in current workspace /* ============================================== &s count := [filelist * outfile -grid] &if [null %count%] &then &return No grids found in the current workspace! &s unit := [open outfile ok -read] /* ============================== /* query user for destination dir /* ============================== &s dest := [response 'Enter the where you want to put ~ the ascii files. The default is the current workspace. Type q to quit' .] &if %dest% = q &then &return &type /* ================ /* start main loop /* ================ &do I := 1 &to %count% /* Read cover name from file &sv cover := [read %unit% readstatus] &if %readstatus% < 100 &then &goto next &else &type End of input. &goto conversion &end &label next /* ======================================== /* first make sure grid has a VAT file /* ======================================== &if [exists %cover%.vat -info] = .FALSE. &then &do &type &type %cover%.vat not found. &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type Moving on to next conversion ... &end &else /* ==================================== /* make an ascii from each item in grid /* ==================================== &do &sv itemlist = [listitem %cover%.vat -info] &s numitems := [token %itemlist% -count] /* ========================================= /* For grids with only VALUE and COUNT items /* ========================================= &if %numitems% = 2 &then &do &type /* ====================================== /* avoid overwriting existing ascii files /* ====================================== &if [exists %dest%/[before %cover% grd]value] = .TRUE. &then &do &type &type The file %dest%/[before %cover% grd]value &type already exists. &type &type File cannot be overwritten. Move or remove the existing file &type before recreating it. If you want to convert other grids to ascii &type do exit. &type &type &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type &type Moving on to next conversion ... &end &else &do &type Creating %dest%/[before %cover% grd]value &type from %cover% ... gridascii %cover% %dest%/[before %cover% grd]value value &end &end /* if /* ================================ /* For grids with additional items /* ================================ &else &do J := 3 &to %numitems% &type /* ====================================== /* avoid overwriting existing ascii files /* ====================================== &if [exists %dest%/[before %cover% grd][extract %j% %itemlist%]] = .TRUE. &then &do &type &type The file %dest%/[before %cover% grd][extract %j% %itemlist%] &type already exists. &type &type File cannot be overwritten. You must move/remove the existing file &type before recreating it. If you want to convert other grids to ascii &type do exit. &type &type &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type &type Moving on to next conversion ... &end &else &do /* ====================== /* Convert to ascii here /* ====================== &type Creating %dest%/[before %cover% grd][extract %j% %itemlist%] &type from %cover% ... gridascii %cover% %dest%/[before %cover% grd][extract %j% %itemlist%] [extract %j% %itemlist%] &end &end /* else j loop &end /* main else &end /* i loop &label conversion &sys sp2i5 *value &return /*-------------------------------------------------------------------------------- /* gd2ascii4.aml Uses an existing list of input files, gd2ascii3.txt /*---------------------------------------------------------------------- /* gd2ascii.aml by Ned Morse 6/25/96 /* /* Modified by Pat Trimble 1-22-97 5-22-98 /* /* Converts grids in current directory to ascii. /* /* Allows user to determine the destination directory of the newly created files. /* /* Makes ascii grids for each item in the grid after count. /* /* Calls and runs the c program sp2i5 that sets cells into space delimited format. /* /*----------------------------------------------------------------------------- /* ============================================== /* Make sure there are grids in current workspace /* ============================================== /*&s count := [filelist c8* outfile -grid] /*&if [null %count%] &then /* &return No grids found in the current workspace! &sv unit := [open gd2ascii3.txt openstatus -read] &if %openstatus% <> 0 &then &return &warning Error opening file. /* ============================== /* query user for destination dir /* ============================== /*&s dest := [response 'Enter the where you want to put ~ /*the ascii files. The default is the current workspace. Type q to quit' .] /*&if %dest% = q &then &return /*&type /*&s dest := ' ' /* ================ /* start main loop /* ================ &do I := 1 &to 1000 /* Read cover name from file &sv cover := [read %unit% readstatus] &if %readstatus% < 100 &then &goto next &else &type End of input. &goto conversion &end &label next /* ======================================== /* first make sure grid has a VAT file /* ======================================== &if [exists %cover%.vat -info] = .FALSE. &then &do &type &type %cover%.vat not found. &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type Moving on to next conversion ... &end &else /* ==================================== /* make an ascii from each item in grid /* ==================================== &do &sv itemlist = [listitem %cover%.vat -info] &s numitems := [token %itemlist% -count] /* ========================================= /* For grids with only VALUE and COUNT items /* ========================================= &if %numitems% = 2 &then &do &type /* ====================================== /* avoid overwriting existing ascii files /* ====================================== &if [exists [before %cover% grd]value] = .TRUE. &then &do &type &type The file [before %cover% grd]value &type already exists. &type &type File cannot be overwritten. You must move/remove the existing file &type before recreating it. If you want to convert other grids to ascii &type do exit. &type &type &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type &type Moving on to next conversion ... &end &else &do &type Creating [before %cover% grd]value &type from %cover% ... gridascii %cover% [before %cover% grd]value value &end &end /* if /* ================================ /* For grids with additional items /* ================================ &else &do J := 3 &to %numitems% &type /* ====================================== /* avoid overwriting existing ascii files /* ====================================== &if [exists [before %cover% grd][extract %j% %itemlist%]] = .TRUE. &then &do &type &type The file [before %cover% grd][extract %j% %itemlist%] &type already exists. &type &type File cannot be overwritten. You must move/remove the existing file &type before recreating it. If you want to convert other grids to ascii &type do exit. &type &type &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type &type Moving on to next conversion ... &end &else &do /* ====================== /* Convert to ascii here /* ====================== &type Creating [before %cover% grd][extract %j% %itemlist%] &type from %cover% ... gridascii %cover% [before %cover% grd][extract %j% %itemlist%] [extract %j% %itemlist%] &end &end /* else j loop &end /* main else &end /* i loop &label conversion &sys sp2i5 *value &return /* ---------------------------------------------------------------- /* get.aml /* /* Transfers a coverage from the /gis/LakeIce/ workspace to /* editing directory /* ---------------------------------------------------------------- &type &type NAMING CONVENTION - (C{Canada}/U{U.S.})
&type EXAMPLE - c82dec21 FOR CANADAIAN CHART DATE DEC 21, 1982 &type &label new &sv cov = [response 'Enter name of coverage to transfer to editing directory'] &if [exists /gis/LakeIce/%cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end copy /gis/LakeIce/%cov% %cov% &return /* ------------------------------------------------------------------ /* icedig.aml /* /* Allows users to digitize ice coverage hardcopy maps /* Starts arcedit and sets the digitizer and editing parameters /* Uses a digitizing menu to make editing selections from the puck /* /* Written by Brad Hibner July 26, 1995 /* /* CHANGES: /* /* Modified to allow using previous tic locations when restarting. /* If the program bombs, it will quit to arcedit. This will allow /* the user to use the previous tic locations and menu locations /* for easier restarting (8-11-95). /* /* NOTE- See tolerances for latest updates /* ------------------------------------------------------------------- &severity &error &routine bomb /* --------------------------- /* Check if AE is running /* --------------------------- &sv pro = [show program] &if %pro% = ARCEDIT &then &type Starting icedig.aml &else &do &type Starting icedig.aml from arc &stat 9999 arcedit &end &label new /* ---------------------------- /* new coverage name definition /* ---------------------------- &type &type NAMING CONVENTION - (C{Canada}/U{U.S.})
&type EXAMPLE - c82dec21 FOR CANADAIAN CHART DATE DEC 21, 1982 &label newname &type &sv cov = [response 'Enter name of new coverage to be digitized'] &if [exists %cov% -cover] = .TRUE. &then &do &type &type Coverage name already exist! &type &label select &sv select = [response 'Select 1 to edit coverage or 2 to enter new coverage name'] &type &if [type %select%] ne -1 &then &do &type &type Integer value expected! &type &goto select &end &if [type %select%] eq 1 &then &do &type &type Integer value expected! &type &goto select &end &if %select% ne 1 and %select% ne 2 &then &do &type &type Must select 1 or 2! &type &goto select &end &if %select% = 1 &then &goto digsetup &if %select% = 2 &then &goto newname &end /* ----------------------------- /* basemap projection definition /* ----------------------------- &label protype &type &type Select 1,2 or 3 to indicate icecover basemap projection type. &type &sv basepro = [response '1= Albers, 2= Lambert, 3= Mercator'] &type &if [type %basepro%] ne -1 &then &do &type Integer value expected! &goto protype &end &if [type %basepro%] eq 1 &then &do &type Integer value expected! &goto protype &end &if %basepro% ne 1 xor %basepro% ne 2 xor %basepro% ne 3 &then &do &type Must select 1, 2, or 3! &goto protype &end &if %basepro% = 1 &then arcplot arc copy /gis/LakeIce/basealb %cov% &if %basepro% = 2 &then arcplot arc copy /gis/LakeIce/baselam %cov% &if %basepro% = 3 &then arcplot arc copy /gis/LakeIce/basemer %cov% /* --------------------------- /* digitizer and arcedit setup /* --------------------------- &label digsetup &type &sv choice = [query 'Input new tics? Y or N'] &if %choice% = .TRUE. &then &do &type &type Input tick marks from icecover map on digitizer. &type coordinate digitizer %cov% &pause &sec 5 &end &else &do &type &type Using previous tic locations for %cov% &type coordinate digitizer &end mape %cov% edit %cov% /* ----------------------------------------- /* enhanced linesymbols /* ----------------------------------------- lineset /gis/LakeIce/spec.lin setdrawsymbol 9 drawe arcs draw editf arc new cal $symbol = 11 &messages &on /* --------------------------------------------- /* tolerances /* /* snaporder changed (9-26-95) from segment vertex improve /* snapping performace /* /* --------------------------------------------- intersectarcs all duplicatearcs no snapcoverage %cov% snapfeatures nodes arcs snaporder vertex segment snapping closest 2500 nodesnap closest 500 /* --------------------- /* digitizer menu set up /* --------------------- &type /* changed 11/6/95 for test /* &menu digmenu.menu &menu /gis/LakeIce/digmenu2.menu /* ------------ /* exit program /* ------------ &s stat = [show status change] &if %stat% = .TRUE. &then &do &sv choice = [query 'Save changes? Y or N'] &if %choice% = .TRUE. &then &do save &type &type Changes saved, exiting icedig2.aml &type &end &else &do &type &type Changes not saved, exiting icedig2.aml &type &end &end &else &return &return /* ------------ /* bomb routine /* ------------ &routine bomb &type &type Program bombed! &type &s stat = [show status change] &if %stat% = .TRUE. &then &do save &type &type All changes to %cov% saved &type &end &if %stat% = .FALSE. &then &do &type &type No changes were made to %cov% &type &end &sv choice = [query 'To start over press [return], to quit enter QUIT' .TRUE.] &if %choice% = .TRUE. &then &do &type &type Restarting icedig.aml &pause &sec 2 &goto new &end &else &stop &return /* ---------------------------------------------------------------------- /* iceedit.aml /* /* iceedit.aml sets the edit coverage and controls /* the editing environment for ice coverage editing /* /* Written by Don Meyer and Brad Hibner /* /* last update 8-3-95 /* ---------------------------------------------------------------------- /* ------------------- /* setup /* ------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else &station 9999 arcedit edit %cov% /* ----------------------------------------------------------------------- /* Edit tolerances /* ----------------------------------------------------------------------- intersectarcs all duplicatearcs no snapcoverage %cov% snapfeatures nodes arcs snaporder vertex segment snapping closest 2500 nodesnap closest 500 grain 20 weedtolerance 20 /* ---------------------------------------------------- /* set edit feature, draw environment /* ---------------------------------------------------- editf arcs drawe arcs nodes dangle draw &return /* -------------------------------------------------- /* iceeditalb.aml /* /* iceeditalb.aml sets the edit coverage (with an alber base) and controls /* the editing environment for ice coverage editing /* /* Written by Don Meyer and Brad Hibner /* /* last update 8-3-95 /* -------------------------------------------------- /* ------------------- /* setup /* ------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else &station 9999 arcedit edit %cov% /* ------------------------------------------------------------------------- /* Edit tolerances /* ------------------------------------------------------------------------- intersectarcs all duplicatearcs no snapcoverage %cov% snapfeatures nodes arcs snaporder vertex segment snapping closest 2500 nodesnap closest 500 grain 20 weedtolerance 20 /* ---------------------------------------------------- /* set edit feature, draw environment /* ---------------------------------------------------- editf arcs drawe arcs nodes dangle backcov /gis/LakeIce/basealb 2 backe arc draw &return /* ------------------------------------------------------------------------ /* iceeditlam.aml /* /* iceeditlam.aml sets the edit coverage (with a lambert base) and controls /* the editing environment for ice coverage editing /* /* Written by Don Meyer and Brad Hibner /* /* last update 8-3-95 /* -------------------------------------------------- /* ------------------- /* setup /* ------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else &station 9999 arcedit edit %cov% /* ------------------------------------------------------------------------- /* Edit tolerances /* ------------------------------------------------------------------------- intersectarcs all duplicatearcs no snapcoverage %cov% snapfeatures nodes arcs snaporder vertex segment snapping closest 2500 nodesnap closest 500 grain 20 weedtolerance 20 /* ---------------------------------------------------- /* set edit feature, draw environment /* ---------------------------------------------------- editf arcs drawe arcs nodes dangle backcov /gis/LakeIce/baselam 2 backe arc draw &return /* ------------------------------------------------------------------------- /* iceeditmer.aml /* /* iceeditmer.aml sets the edit coverage (with a mercator base) and controls /* the editing environment for ice coverage editing /* /* Written by Don Meyer and Brad Hibner /* /* last update 8-3-95 /* -------------------------------------------------- /* ------------------- /* setup /* ------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else &station 9999 arcedit edit %cov% /* ------------------------------------------------------------------------- /* Edit tolerances /* ------------------------------------------------------------------------- intersectarcs all duplicatearcs no snapcoverage %cov% snapfeatures nodes arcs snaporder vertex segment snapping closest 2500 nodesnap closest 500 grain 20 weedtolerance 20 /* ---------------------------------------------------- /* set edit feature, draw environment /* ---------------------------------------------------- editf arcs drawe arcs nodes dangle backcov /gis/LakeIce/basemer 2 backe arc draw &return /* --------------------------------------------------------------- /* iceeditpara.aml /* /* /* sets parameters for editing when using arctools /* use the "commands" command of edit tools to run iceeditpara.aml /* /* Written by Brad Hibner, March 23, 1995 /* --------------------------------------------------------------- /* -------------------------------------------------- /* Enter edit coverage and check that coverage exists /* -------------------------------------------------- &label new &type &sv cov = [response 'Enter snap cover '] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end &else &type &type Setting editing parameters... &type /* ----------------------------------------------- /* parameters, same as iceedit.aml edit parameters /* ----------------------------------------------- intersectarcs all duplicatearcs no snapcoverage %cov% snapfeatures nodes arcs snaporder vertex segment snapping closest 2500 nodesnap closest 500 grain 20 weedtolerance 20 /* -------------------------------------------------- /* display dangling node errors /* -------------------------------------------------- drawe arcs nodes dangle backcov /gis/LakeIce/baselam 2 backe arc draw &type &type done! &type &return /* --------------------------------------------------------------------------- /* icelink2.aml /* /* links the .iat info file to the .pat /* /* modified by d. lee 9/12/97 to eliminate creation and use of /* a .bak file /* ---------------------------------------------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &sv choice = [query [Quote Exit program] .TRUE.] &if %choice% = .TRUE. &then &return &goto new &end &else /* /* Make sure there is a pat file. /* &if [exists %cov%.pat -INFO] = .FALSE. &then &do &type &type There is no %cov%.pat file! &type &type Exiting the program. &type &return &end /* /* Make sure there is an iat file. /* &if [exists %cov%.iat -INFO] = .FALSE. &then &do &type &type There is no %cov%.iat file! &type &type Exiting the program. &type &return &end /* /* Inform user if this program has been run for the coverage /* /*&if [exists %cov%.bak -INFO] &then /* &do /* &type /* &type Since there is already a %cov%.bat file, the iat file has /* &type probably already been linked to the .pat INFO file. /* &type /* &type To avoid an error caused by linking an already linked file, /* &type this time the old, unlinked .bak file will be linked to the /* &type current iat file. /* &type /* &end /* /* Make a backup of the unlinked .pat file, if has not yet been made. /* /*&if [exists %cov%.bak -INFO] = .FALSE. &then /* &do /* copyinfo %cov%.pat %cov%.bak /* &type /* &type Creating a %cov%.bak unlinked backup INFO file. /* &type /* &end /* /* join .iat to .pat /* joinitem %cov%.pat %cov%.iat %cov%.pat %cov%-id %cov%-id &return /* ----------------------------------------------------------------------------- /* icelinkbatch.aml /* /* Created from icelink2.aml by Ned Morse 8/16/96. /* /* links the .iat info file to the .pat /* for all polygon covers in workspace. /* ---------------------------------------------------------- &s count := [filelist u* polylist.myfile -cover -poly] &if %count% <= 0 &then &return No polygon covers found in the current workspace! &s unit := [open polylist.myfile ok -read] &do I := 1 &to %count% &s cov := [before [read %unit% ok] .txt] &if [exists %cov% -poly] = .FALSE. &then &do &type &type Polygon coverage does not exist! &type &sv choice = [query [Quote Exit program] .TRUE.] &if %choice% = .TRUE. &then &return &goto new &end &else /* /* Make sure there is a pat file. /* &if [exists %cov%.pat -INFO] = .FALSE. &then &do &type &type There is no %cov%.pat file! &type &type Exiting the program. &type &return &end /* /* Make sure there is an iat file. /* &if [exists %cov%.iat -INFO] = .FALSE. &then &do &type &type There is no %cov%.iat file! &type &type Exiting the program. &type &return &end /* /* Inform user if this program has been run for the coverage /* &if [exists %cov%.bak -INFO] &then &do &type &type Since there is already a %cov%.bat file, the iat file has &type probably already been linked to the .pat INFO file. &type &type To avoid an error caused by linking an already linked file, &type this time the old, unlinked .bak file will be linked to the &type current iat file. &type &end /* /* Make a backup of the unlinked .pat file, if has not yet been made. /* &if [exists %cov%.bak -INFO] = .FALSE. &then &do copyinfo %cov%.pat %cov%.bak &type &type Creating a %cov%.bak unlinked backup INFO file. &type &end /* /* join .iat to .pat /* joinitem %cov%.bak %cov%.iat %cov%.pat %cov%-id %cov%-id &end &s ok := [close %unit%] &s ok := [delete polylist.myfile -file] &return /*--------------------------------------------------------------------------------------- /* importer.aml converts NIC export ".e00" files to coverages /* Use fixnica1.aml next &type &s count := [filelist *.e00 covlist -file] &if %count% = 0 &then &return No export coverages found in the current workspace. /* Read export coverage names, strip off .e00 extension &s unit := [open covlist ok -read] &s cov = [read %unit% ok] &s cov = [before %cov% .e] /* THIS COULD ALSO BE COMBINED INTO ONE LINE, AS BELOW: /*&s cov := [before [read %unit% ok] .e] &do &until %ok% = 102 &if [exists %cov% -cover] &then &do kill %cov% all &end import auto %cov% %cov% /* YOU DON'T NEED .e00 EXTENTION FOR IMPORT FILE &s cov := [before [read %unit% ok] .e] &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /*--------------------------------------------------------------------------------------- /* killcovcan.aml by Ned Morse ( ) 7/8/96 /* &type WARNING: ALL c* COVERS IN WORKSPACE WILL BE DELETED by KILLCOVCAN.AML ! &sv choice = [query [Quote Continue] .FALSE.] &if %choice% = .FALSE. &then &return &type &s count := [filelist c* covlist -file] &if %count% <= 0 &then &return No polygon coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] &type Killing %cover% ... kill %cover% all &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /*-------------------------------------------------------------------------- /* poly_gid1.aml, abbreviated form by David Norton /* poly_gid.aml /* Sentha Shanmugam /* Date: Fri, 26 Mar 1999 incident #31477 /* ESRI modification to yield only the .GID files. /*-------------------------------------------------------------------------- /* polygrid.aml by Pat Trimble 8/14/96 + 5/22/98 /* /* Converts polygon coverages in current directory to grids. /* /* Allows user to determine the destination directory of the newly /* created grids. /* /* Items in the .PAT are used to create separate grids. /* /* Creates a separate grid for each attribute of the ice chart. /* /* Sets cell size so that grid is 510 columns wide by 516 columns across. /* /* Cell size is 2550 meters. /* /* Will not overwrite grids already in existence in user defined destination. /* /* Items in the .PAT are used to create separate grids. /* /*---------------------------------------------------------------------------- &type /*get list of covers &s covlist := [listfile *a -cover -polygon] &if [null %covlist%] &then &return No polygon coverages found in the current workspace! /*get destination directory &s dest := [response 'Enter the where you want to put ~ the grids. The default is the current workspace. Type q to quit' .] &if %dest% = q &then &return /*set cell size &s cellsize := [response 'Enter the cell size. 2500 for Icemappers Data, ~ 500 for Ice Atlas, 2550 for Coast Watch. Default is 2550' 2550] /*for every cover in list /*create a grid &do cover &list %covlist% &type &type Creating grids from %cover%... &type &type Using a cell size of %cellsize%. &type polygrid %cover% %dest%/%cover%gid %cover%-id %cellsize% y /*if VAT file is not created, inform user &if [exists %dest%/%cover%gid.vat -info] = .FALSE. &then &do &type &type %cover%gid.vat was not created. &type &type &sv choice = [query [Quote Exit Program] .TRUE.] &if %choice% = .TRUE. &then &return &type... &type &end &end &return /*---------------------------------------------------------------------------- /* monthnumdec12.aml renames all the coverages in a workspace by substituting /* numerals for the 3 letter characters to designate month /* written by Pat Trimble 02/14/97 trimble@glerl.noaa.gov /*---------------------------------------------------------------------------- &s count := [filelist c*dec* covlist -cover] &if %count% = 0 &then &return No DEC coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] &type &type Substituting 12 for DECember designation rename %cover% [substr %cover% 1 3]12[substr %cover% 7 8] &end &s ok := [close %unit%] &s ok := [delete covlist -file] /*-------------------------------------------------------------------------- /* projectmercan.aml uses the project command to convert Canadian Lambert /* ice charts to Mercator (Ice chart parameter) projection /* written by Pat Trimble 2-17-97 /*-------------------------------------------------------------------------- &s count := [filelist c* covlist -cover] &if %count% = 0 &then &return No coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] project cover %cover% %cover%m /gis/LakeIce/amls/icelam2icemer_prjfile.txt &type &type Coverage projected to mercator &type &end &s ok := [close %unit%] &s ok := [delete covlist -file] /*------------------------------------------------------------------------------ /* projectmerus.aml uses the project command to convert US Albers /* ice charts to Mercator (Ice chart parameter) projection /* written by Pat Trimble 2-17-97 /*------------------------------------------------------------------------------ &s count := [filelist u* covlist -cover] &if %count% = 0 &then &return No coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] project cover %cover% %cover%m /gis/LakeIce/amls/icealb2icemer_prjfile.txt &type &type Coverage projected to mercator &type &end &s ok := [close %unit%] &s ok := [delete covlist -file] /* ------------------------------------------------------------------ /* put.aml /* /* Replaces the coverage in /gis/LakeIce/ with an edited coverage /* from the users editing directory /* ------------------------------------------------------------------- &type &type NAMING CONVENTION - (C{Canada}/U{U.S.})
&type EXAMPLE - c82dec21 FOR CANADAIAN CHART DATE DEC 21, 1982 &type &label new &sv cov = [response 'Enter name of coverage to transfer to /gis/LakeIce'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end /* kill kill /gis/LakeIce/%cov% /* copy coverage copy %cov% /gis/LakeIce/%cov% &return /* ------------------------------------------------------------------ /* putus.aml /* /* Replaces the coverage in /gis/LakeIce/us with an edited coverage /* from the users editing directory /* ------------------------------------------------------------------- &type &type NAMING CONVENTION - (C{Canada}/U{U.S.})
&type EXAMPLE - c82dec21 FOR CANADAIAN CHART DATE DEC 21, 1982 &type &label new &sv cov = [response 'Enter name of coverage to transfer to /gis/LakeIce/us/'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end /* kill kill /gis/LakeIce/us/%cov% /* copy coverage copy %cov% /gis/LakeIce/us/%cov% &return /* ----------------------------------------------------------------------- /* qc.aml is a combination of icelink2.aml + ascii_qc.aml + sys compare2.c /* icelink2.aml /* /* links the .iat info file to the .pat /* ----------------------------------------------------------------------- &label new &type &sv cov = [response 'Enter coverage name'] &if [exists %cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &sv choice = [query [Quote Exit program] .TRUE.] &if %choice% = .TRUE. &then &return &goto new &end &else /* /* Make sure there is a pat file. /* &if [exists %cov%.pat -INFO] = .FALSE. &then &do &type &type There is no %cov%.pat file! &type &type Exiting the program. &type &return &end /* /* Make sure there is an iat file. /* &if [exists %cov%.iat -INFO] = .FALSE. &then &do &type &type There is no %cov%.iat file! &type &type Exiting the program. &type &return &end /* /* join .iat to .pat /* joinitem %cov%.pat %cov%.iat %cov%.pat %cov%-id %cov%-id /* ----------------------------------------------------------------------- /* ascii_qc.aml included here /* /* Creates ASCII file of (.pat) to compare to original ASCII /* attribute file (.txt) /* ----------------------------------------------------------------------- /* /* create temporary .pat file /* copyinfo %cov%.pat temp.pat /* /* start arcplot, select records, sort records by polygon-id /* ap reselect temp.pat INFO %cov%-id > 400 sort temp.pat info %cov%-id /* /* create output file /* &if [exists %cov%.asc -file] = .TRUE. &then &sys rm %cov%.asc listoutput %cov%.asc list temp.pat INFO %cov%-id ct ca cb cc sn sa sb sc sd fa fb fc n listoutput screen /* /* quit ap, start tables, kill temporary .pat file /* quit tables $kill temp.pat quit /* /* use system compare2.c program written by Tim Hunter /* &sys /gis/LakeIce/compare2 %cov% &type %cov% finished &return &return /*--------------------------------------------------------------------------------------- /* renameCAPS.aml adds a ".txt" in place of the TXT suffix /* to all the US coverages in a workspace /* written by Pat Trimble 02/14/97 /* /* &s count := [filelist *.TXT covlist -file] &if %count% = 0 &then &return No coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] mv %cover% u[substr %cover% 2 8]txt &end &s ok := [close %unit%] &s ok := [delete covlist -file] /*--------------------------------------------------------------------------------------- /* renamegg.aml adds a ".asc" in place of the egg suffix /* to all the coverages in a workspace /* written by Pat Trimble 02/14/97 /* /* &s count := [filelist * covlist -file] &if %count% = 0 &then &return No coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] mv %cover% [substr %cover% 1 10].asc &end &s ok := [close %unit%] &s ok := [delete covlist -file] /* ----------------------------------------------------------------- /* replace.aml /* THE USE OF THIS AML CAN CAUSE PROBLEMS. DAVE NORTON /* /* Replaces the linked and corrupted .pat file with the back-up .pat /* (.bak) to allow error correction and relinking /* ----------------------------------------------------------------- &label new &sv cov = [response 'Enter coverage name'] &if [exists /gis/LakeIce/%cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end tables $kill %cov%.pat quit copyinfo %cov%.bak %cov%.pat tables $kill %cov%.bak quit &type &type Coverage %cov% is now ready to be edited and relinked &type &return /* ----------------------------------------------------------------- /* replaceus.aml /* THE USE OF THIS AML WILL TEND TO CAUSE PROBLEMS. EDITED COVERAGES /* ARE LOST, REPLACED WITH UNEDITED COVERAGES... DAVE NORTON /* /* Replaces the linked and corrupted .pat file with the back-up .pat /* (.bak) to allow error correction and relinking /* ----------------------------------------------------------------- &label new &sv cov = [response 'Enter coverage name'] &if [exists /gis/LakeIce/us/%cov% -cover] = .FALSE. &then &do &type &type Coverage does not exist! &type &goto new &end tables $kill %cov%.pat quit copyinfo %cov%.bak %cov%.pat tables $kill %cov%.bak quit &type &type Coverage %cov% is now ready to be edited and relinked &type &return /*------------------------------------------------------------------------ /* scriptext.aml prints a copy of the aml script to the laser printer /* in room 211. /* written by Pat Trimble 06/12/97 /* /*------------------------------------------------------------------------ &s count := [filelist *.aml covlist -file] &if %count% = 0 &then &return No coverages found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] lp -dhp4m211 %cover% &end &s ok := [close %unit%] &s ok := [delete covlist -file] /*--------------------------------------------------------------------------------------- /* tapereadbatch.aml by Ned Morse and Pat Trimble /* /* Reads from Tape a series of export files in workspace /* /* Note: User should be in the workspace of the source coverages. /* /* &setvar dest := [response 'Enter the where you want to put ~ the new coverages. The default is the current workspace' .] &type &s count := [filelist /d5/ice/can-tx/c80*.e00 covlist -file] /*&if %count% = 0 &then /* &return No export files found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] &type &type Writing export file %cover% ... /*&if [exists %dest%/%cover%] = .TRUE. &then /*&do /* &type /* &type The file %dest%/%cover%.e00 already exists! /* &type /* &type This file cannot be overwritten. /* &type /* &sv choice = [query [Quote Exit Program] .TRUE.] /* &if %choice% = .TRUE. &then &return /* &type /* &type Moving on to next cover ... /*&end /*&else export cover %cover% %dest%/%cover% full taperead /dev/rmt/0mn gis/LakeIce/trimble/canexport/%cover% &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return /*-------------------------------------------------------------------------------/* tapewritebatch.aml by Ned Morse and Pat Trimble /* /* Sends export files in workspace to Data Cartridges /* /* Note: User should be in the workspace of the source coverages. /* /*-------------------------------------------------------------------------------/*&setvar dest := [response 'Enter the where you want to put ~ /*the new coverages. The default is the current workspace' .] &type &s count := [filelist *.e00 covlist -file] &if %count% = 0 &then &return No export files found in the current workspace. &s unit := [open covlist ok -read] &do I := 1 &to %count% &s cover := [read %unit% ok] &type &type Writing export file %cover% ... /*&if [exists %dest%/%cover%] = .TRUE. &then /*&do /* &type /* &type The file %dest%/%cover%.e00 already exists! /* &type /* &type This file cannot be overwritten. /* &type /* &sv choice = [query [Quote Exit Program] .TRUE.] /* &if %choice% = .TRUE. &then &return /* &type /* &type Moving on to next cover ... /*&end /*&else export cover %cover% %dest%/%cover% full tapewrite /dev/rmt/0mn %cover% &end &s ok := [close %unit%] &s ok := [delete covlist -file] &return