/* ------------------------------------------------------------------------- /* GIS Laboratory /* Division of Geological and Planetary Sciences /* Caltech /* ------------------------------------------------------------------------- /* Program : DLG_TO_HYDRO-COV.AML /* Purpose : Convert 1:100,000 DLG data to hydrology coverages /* ------------------------------------------------------------------------- /* Calls : none /* Called by: none /* ------------------------------------------------------------------------- /* Arguments: prefix - prefix of each of the eight dlg files /* (e.g., mz1hyf0 for mz1hyf01) /* Globals : none /* ------------------------------------------------------------------------- /* Notes : /* ------------------------------------------------------------------------- /* History : 04/07/98 - Tony Soeller; program created /* ========================================================================= &args prefix /*. &s amlname = dlg_to_hydro-cov.aml &severity &error &routine run_away &if [null %prefix%] &then &return &inform Usage: &r dlg_to_hydro-cov /* Define the name of the coverage to process &do id = 1 &to 8 &s dlg_file %prefix%%id% &s cov hy%id% &if [exists %cov% -cover] &then &do &type Coverage %cov% does not exist. Terminating... &return &end dlgarc optional %dlg_file% %cov% build %cov% line additem %cov%.aat %cov%.aat major1 6 6 i additem %cov%.aat %cov%.aat minor1 6 6 i additem %cov%.aat %cov%.aat major2 6 6 i additem %cov%.aat %cov%.aat minor2 6 6 i relate add rel %cov%.acode info %cov%-id %cov%-id linear ro [unquote ' '] tables sel %cov%.aat calc major1 = rel//major1 calc minor1 = rel//minor1 &s item_list [listitem %cov%.acode -info] &if [quote %item_list%] cn 'MAJOR2' &then &do calc major2 = rel//major2 &end &else &do calc major2 = -99999 &end &if [quote %item_list%] cn 'MINOR2' &then &do calc minor2 = rel//minor2 &end &else &do calc minor2 = -99999 &end quit &end /* Append the eight coverages append hy line all hy1 hy2 hy3 hy4 hy5 hy6 hy7 hy8 end /* Project the appended coverage &ty Projecting hy to produce hy_ll project cover hy hy_ll utm11_to_geo.prj /* Generate a frequency report of the hydrology types &ty Generating frequency table hy.frq frequency hy.aat hy.frq major1 minor1 major2 minor2 end end &return /**************************************************************************** &routine run_away &s .error_flag 1 &s ok [close -all] &return &inform Error condition in routine (%amlname%)