/* geounits.aml /* creates lookup table of polygon units /* for a given composite-map coverage. /* /* modified by Ralph Haugerud, USGS Seattle, rhaugerud@usgs.gov, April 1998 /* from aml written by Patrick Showalter, U.S.G.S Menlo Park, 1/11/91 &args .incover &set .item = XUNIT /* edit line above to identify item name (should be CAPS) /* of unit item in your coverage(s) &if [null %.incover%] &then &return &warning Usage: GEOUNITS &s .incover [translate %.incover%] &s infofat PAT &if [iteminfo %.incover% -POLY %.item% -exists] NE .TRUE. &then &return &warning %.incover% Does not contain item %.item% &s cover [translate %.incover%] &s LUTNAME = %cover%.UNITS &if [exists %LUTNAME% -info] NE .false. &then &return &warning %LUTNAME% already exists in current workspace. G'bye &data arc info ARC DEFINE %LUTNAME% %.item%,[iteminfo %cover% -POLY %.item% -definition] [UNQUOTE ' '] SELECT [entryname %cover%].%infofat% SORT ON %.item% RELATE %LUTNAME% 2 %.item% INIT MOVE $2%.item% TO %.item% SORT ON [entryname %cover%]# SELECT %LUTNAME% EXPORT ../xxfred SDF DELETE %LUTNAME% Y Q STOP &end /** &data &sys tr -d \" %LUTNAME% &sys rm xxfred &return