/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* /* Program: sdts2cov.aml /* /* Version: 2.0 /* /* Purpose: This AML is used to convert SDTS 1:24K, 1:100K, and 1:2M DLG-3 /* data into ARC coverages. It joins all of the attribute modules to /* the coverage's feature attribute tables. /* /* Without this AML, the ARC command SDTSIMPORT produces coverages /* that have feature attributes residing in separate "normalized" /* tables, some of which contain "one to many" relationships. /* Although this is an efficient way of storing the attributes, it /* makes retrieving the attributes tedious and the manual processing /* can be very complicated for the novice ARC/INFO user. This AML /* simplifies or "denormalizes" the attribute structure by attaching /* all of the attributes from the attribute modules directly to the /* feature attribute tables. This is not as efficient, because many /* of the attributes get duplicated, but it makes accessing the /* attributes much easier. /* /* Usage: &run sdts2cov {-COMBINE} /* {-DEFINE} {-DROPITEMS} {-LAYERS } /* /* - a four character prefix common to all /* files in the SDTS transfer. The prefix may include a pathname /* to a directory. If no directory pathname is given, the files /* in the transfer will be read from the current workspace. /* /* - up to six character prefix that will be /* common to all coverages produced from the SDTS transfer. This /* value can NOT contain a path to another workspace. All /* will be created in the workspace you are in when you run the /* AML. The two character DLG theme abbreviation will be /* appended to the prefix to create the output coverage name. /* For transfers that contain multiple layers per theme, the /* layer number will be appended after the DLG theme /* abbreviation. For transers that contain multiple themes, each /* theme will be numbered separately starting at 01, so the /* coverage layer number may not be the same as the layer number /* in the transfer. For example, there is a "TRANSPORTATION" /* (TR) transfer containing three themes: "PIPE & TRANS LINES" /* (MT), "ROADS AND TRAILS" (RD), and "RAILROADS" (RR). There /* are 12 total layers (four per theme), so each output coverage /* created will be numbered from 01 to 04 for each of the three /* themes. Point coverages created will be suffixed with an 'x'. /* /* {-COMBINE} - an optional argument used to combine all specified /* layers into a single polygon-arc-node coverage for each /* category contained in the transfer. The neatlines between the /* adjacent layers are removed and the duplicate label points /* left after the lines are removed are also deleted. The point /* coverages (if they exist) are also combined for each category. /* The actual combination of the layers occurs last, after the /* individual layer coverages have been created. The individual /* layer coverages are not removed by the AML. The combined /* coverages are named in the following format (the 'c' stands /* for combined): /* /* c (polygon-arc-node) /* /* cx (point) /* /* {-DEFINE} - an optional argument used to join an item called /* ENTITY_DEF to the feature attribute tables, which is the short /* definition of the 7 digit DLG code contained in the /* ENTITY_LABEL item. A special INFO table called ENTDEF.TAB is /* required for this option to work. This table can be /* downloaded from the same site as this AML in ARC export format /* (entdef.e00). You should either place the entdef.e00 export /* file in the same directory as sdts2cov.aml so that it can be /* automatically imported into your workspace whenever it is /* needed, or you can import it into your workspace manually. To /* import it manually the syntax is: /* /* IMPORT INFO entdef.e00 entdef.tab /* /* The full definition of the ENTITY_LABEL code is contained in /* the master data dictionary INFO tables created by the ARC /* command SDTSIMPORT. These definitions can be accessed by /* setting up relates from the FAT to the DDDF table and from the /* DDDF table to the DDDF2 table. Most of the definitions are /* several records long, so you will have to use a cursor to get /* the entire definition. /* /* {-DROPITEMS} - an optional argument used to drop any items /* joined to the feature attribute tables that contain "Not /* Applied" values for the entire coverage. For character items, /* the "Not Applied" value is represented by a blank. For /* numeric items, it is the smallest number that can be used /* according to the item definition, which will be a negative /* value containing all nines. /* /* {-LAYERS } - an optional argument used to specify /* which transfer layers (if multiple layers exist) are to be /* imported. The default is to import ALL layers in the /* transfer, so it is NOT necessary to use this option unless /* you only want some of the layers. The is a list /* of layer numbers that are separated by commas and are in /* ascending order. This list can NOT contain blank spaces. /* You may also specify a range by using two periods between a /* lower and a higher number. The layers specified in the layer /* list must exist in the SDTS transfer. The following examples /* are equivalent: /* /* EXAMPLE 1: -LAYERS 1..4,6,8,11,14..18,21 /* /* EXAMPLE 2: -LAYERS 1,2,3,4,6,8,11,14,15,16,17,18,21 /* /* NOTES: The arguments contained within the < > symbols are required /* and must be specified in the correct order. The hyphenated /* arguments contained within the { } symbols are optional and /* can be specified in any order. /* /* If a coverage name used by the AML already exists in the /* workspace, the AML will create a workspace under the /* current workspace, prefixed by the word save, and attempt /* to move the coverage there. /* /* This AML contains one system call that is used when running /* on UNIX to validate the entered. I /* had no way of testing this call on every ARC/INFO supported /* UNIX platform, so if this line causes you problems, you may /* have to correct it or comment it out. If a problem occurs, /* please contact me so I can try to resolve the problem for /* everyone. Thanks. /* /* Scott B. Whitaker, Computer Specialist /* U.S. Geological Survey, Mid-Continent Mapping Center, Rolla, MO /* phone: 573-308-3516 fax: 573-308-3652 /* swhit@usgs.gov /* /* Language: Arc/Info AML 7.1 or higher (should run in 7.0 for every theme /* except for transportation) /* /* System: Windows NT or any Arc/Info supported Unix platform /* /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> HISTORY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* /* AUTHOR SITE DATE EVENT /* ------ ---- ---- ----- /* S.B.Whitaker USGS-MCMC-RTA-SES 10/01/98 Original coding. Based on the /* sdtshelp.aml written by /* S.L.SILCH & S.B.Whitaker. /* " " 10/06/98 Corrected one to many relate /* bug. /* " " 10/08/98 Corrected 24K bug. /* " " 10/08/98 Modified to run in ARC/INFO 7.0 /* for every theme except for /* transportation. /* " " 10/14/98 Added -DEFINE option. /* " " 10/16/98 Added -DROPITEMS option. /* " " 10/26/98 Added support for 2000K data. /* " " 11/17/98 Added more documentation. /* " " 11/19/98 Misc. bug fixes. /* " " 12/22/98 Corrected layercount bug. /* " " 01/22/99 Added -COMBINE option. /* " " 02/08/99 Corrected elev. unit bug. /* " " 02/11/99 Added out_cover_prefix check. /* /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DISCLAIMER >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* /* Although this program has been used by the U.S. Geological Survey (USGS), /* no warranty, expressed or implied, is made by the USGS as to the accuracy /* and functioning of the program and related program material, nor shall /* the fact of distribution constitute any such warranty, and no /* responsibility is assumed by the USGS in connection therewith. /* /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* /* See end of program for list of variables used. /* /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /*>>>>>>>>>>>>>>>>>>>>>>>>>>>> MAIN PROGRAM BODY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* &args itp ocp options:rest /* Initialize variables. /************************ &s crlist = [unquote ' '] &s svlist = [unquote ' '] &s usg = /&USAGE: &run sdts2cov &s usg = %usg%/& {-COMBINE} {-DEFINE} {-DROPITEMS} &s usg = %usg%/& {-LAYERS } &s numopts = 5 &s nt = [calc [upcase [extract 1 [show &os]]] = WINDOWS_NT] &s home = [show workspace] &s prec = [show precision] &s disp = [show display] &s cct = 0 &s ctglist = {'bd','hp','hy','ms','mt','nv','pl','rd','rr','sc','sm','tr'} &s pfat = .pat &s afat = .aat &s nfat = .nat &s xfat = .pat &s runit = m &s tunit = ft &s pkbmsp = populated_place &s pkbmta = airport &s pkbgrl = land_grant &s pkbfpc = county &s pkbfps = state &s fmtstr = '%1,11% %2,13% %3,-10%' /* Set severity. /**************** &severity &error &routine bailout &severity &warning &ignore /* Check current program and version. /************************************* &if [upcase [show program]] ^= ARC &then &return &warning /&>> This AML Must Be Run From ARC &s vrs = [substr [quote [show version]] 1 3] &if %vrs% < 7.0 &then &return &warning /&>> This AML Must Be Run From ARC/INFO version 7.0 Or Higher /* Check for null required arguments. /************************************* &if [null %itp%] | [null %ocp%] &then &return &warning %usg% /* Extract transfer prefix and category and expand path. /******************************************************** &s fullitp = [pathname %itp%] &s path = [dir %fullitp%] &s itp = [upcase [entryname %fullitp%]] &if [length %itp%] ^= 4 &then &return &warning /&>> Invalid Transfer Prefix: %itp% &s fullitp = [joinfile %path% %itp% -file] &s ctg = [unquote [locase [substr %itp% 1 2]]] &s num = [unquote [locase [substr %itp% 3 2]]] &if ^ [quote %ctg%] in %ctglist% | [type %num%] ^= -1 &then &do &s ctg = %num% &if ^ [quote %ctg%] in %ctglist% &then &return &warning /&>> Invalid Transfer Prefix: %itp% &end &if %vrs% = 7.0 & %ctg% = 'tr' &then &do &type /&>> ARC/INFO version 7.1 or Higher Required For Transportation Theme &return &warning &end /* Check out_cover_prefix. /************************** &if [index %ocp% '/'] > 0 | [index %ocp% '\'] > 0 &then &return &warning /&>> Invalid : %ocp% /* Check transfer directory and prefix and look for masterdd directory. /*********************************************************************** &if ^ [exists %path% -directory] &then &return &warning /&>> Invalid Transfer Directory: %path% &s out = [scratchname -prefix tct -suffix .tmp -file -full] &if %nt% &then &s tct = [filelist %fullitp%* %out% -file] &else &do &workspace %path% &sys echo '&return; &s tct '`ls -1 | grep -ci %itp%` > %out% &workspace %home% &r %out% &end &s dlok = [delete %out% -file] &if %tct% < 1 &then &return &warning /&>> Invalid Transfer Prefix: %itp% &if ^ [exists %path%/../masterdd -directory] &then &return &warning /&>> Unable To Locate The Master Data Dictionary /* Get first 6 characters in . /************************************************ &if [length %ocp%] > 6 &then &do &s tocp = [substr %ocp% 1 6] &type /&>> : %ocp% Truncated to: %tocp% &s ocp = %tocp% &end /* Count and identify layers in transfer. /***************************************** &call layercount /* Evaluate optional arguments. /******************************* &call argeval /* Evaluate layers argument and build layer list. /************************************************* &call layerlist /* Set to double precision. /*************************** precision double double /* Loop through layers in layerlist. /************************************ &do lyr &list %layerlist% /* Build layer name. /******************** &if %layerct% = 1 &then &s layer = [unquote ' '] &else &if %lyr% < 10 &then &s layer = 0%lyr% &else &s layer = %lyr% /* Build cover name. /******************** &if %ctg% = 'tr' &then &do &s cat = [extract 1 [value layer%lyr%]] &if [value %cat%ct] = 1 &then &s cover = %ocp%%cat% &else &s cover = %ocp%%cat%[extract 2 [value layer%lyr%]] &end &else &do &s cat = %ctg% &s cover = %ocp%%cat%%layer% &end /* Import SDTS transfer. /************************ &if ^ [exists %home% -workspace] &then createworkspace . &do cvr &list %cover% %cover%x &call covexist &end sdtsimport %fullitp% %cover% %cover%x %layer% &s crlist = %crlist% %cover% &s points = [exists %cover%x -cover] &if %points% &then &s crlist = %crlist% %cover%x /* Build lines, nodes, polys, and points. /***************************************** build %cover% (!line node poly!) &if %points% &then build %cover%x point /* Delete obsolete files. /************************* &call cleanup /* Join attribute modules to FATs and resolve any one to many /* relationships. Loop through polygons, arcs, nodes, and points. /****************************************************************** &do t &list p a n x &s cov = %cover% &if %t% = 'x' &then &s cov = %cov%x /* FAT exists. /************** &if [exists %cov%[value %t%fat] -info] &then &do /* Join table exists. /************************ &if [exists %cov%.%t%join -info] &then &do /* Join existing attribute modules to FAT. /****************************************** &call jointab /* Drop unused items. /********************* &call itemdrop /* Join secondary attribute modules. /************************************ &call joinsec /* Join entity label definitions. /********************************* &call joindef &end /* No join table. /***************** &else &do /* Check for MODN_ID item in FAT. /********************************* &if [iteminfo %cov%[value %t%fat] -info modn_id -exists] &then &do /* Join the primary attribute module to the FAT. /************************************************ &call joinmod /* Drop unused items. /********************* &call itemdrop /* Join secondary attribute modules. /************************************ &call joinsec /* Join entity label definitions. /********************************* &call joindef &end &end &end &end /* Store created coverage information. /************************************** &s cct = %cct% + 1 &s cvrg%cct% = %cover% &s ccat%cct% = %cat% &describe %cover% &s cply%cct% = %dsc$polygons% &s carc%cct% = %dsc$arcs% &s cnod%cct% = %dsc$max_node% &if %points% &then &do &describe %cover%x &s cpnt%cct% = %dsc$points% &end &else &s cpnt%cct% = -1 &end /* Combine layers if -COMBINE option specified. /*********************************************** &call combine /* Cleanup obsolete files. /************************** &call cleanup /* Reset precision and display settings. /**************************************** precision %prec% display %disp% /* Print out created coverage information. /****************************************** &if ^ [null %svlist%] &then &do &s out = [scratchname -suffix .sav -file] &s sav = [filelist [joinfile %savdir% * -file] %out% -cover] &if %sav% > 0 &then &do &type /&>> %sav% Coverages Moved To Directory: %savdir% &type >> To Avoid Being Overwritten &end &s dlok = [delete %out% -file] &end &if %cct% > 0 &then &do &type /&>> OUTPUT COVERAGES CREATED &type >> ------------------------/&>> &type >> Coverage Feature Class # Features &type >> =========== ============= ========== &do i = 1 &to %cct% &type >> [format %fmtstr% [value cvrg%i%] Polygons [value cply%i%]] &type >> [format %fmtstr% ' ' Arcs [value carc%i%]] &type >> [format %fmtstr% ' ' Nodes [value cnod%i%]] &if ^ [value cpnt%i%] < 0 &then &type >> [format %fmtstr% [value cvrg%i%]x Points [value cpnt%i%]] &end &end &else &type /&>> NO OUTPUT COVERAGES CREATED &return &inform /&>> sdts2cov Finished! /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ROUTINES >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /**************************************************** /* argeval - Routine to evaluate optional arguments. /**************************************************** &routine argeval /* Extract options. Temporarily replace commas with another character so /* layer list can be extracted as one element. /************************************************************************* &s options = [unquote [subst %options% ',' '?']] &do i = 1 &to %numopts% &s opt%i% = [unquote [subst [extract %i% %options%] '?' ',']] &end /* Set default values then loop through extracted options. /********************************************************** &s all = .TRUE. &s combine = .FALSE. &s define = .FALSE. &s dropitems = .FALSE. &s more = .TRUE. &s o = 1 &do &while %more% & %o% <= %numopts% &if [null [value opt%o%]] &then &s more = .FALSE. &else &do &select [upcase [value opt%o%]] /* COMBINE option. /****************** &when -COMBINE &do &if %layerct% > 1 &then &do &if ^ %combine% &then &s combine = .TRUE. &else &return &warning %usg% &end &else &do &type /&>> %fullitp% Does Not Contain Multiple Layers &type >> -COMBINE Option Ignored ... &end &end /* DEFINE option. /***************** &when -DEFINE &do &if ^ %define% &then &do /* Check for entity definition table. /************************************* &if ^ [exists entdef.tab -info] & ^ [exists [joinfile ~ [dir %aml$fullfile%] entdef.e00 -file] -file] &then &return &warning /&>> Unable To Locate Entity Definition Table &s define = .TRUE. &end &else &return &warning %usg% &end /* DROPITEMS option. /******************** &when -DROPITEMS &do &if ^ %dropitems% &then &s dropitems = .TRUE. &else &return &warning %usg% &end /* LAYERS option. /***************** &when -LAYERS &do &if %o% = %numopts% &then &return &warning %usg% &s all = .FALSE. /* Get layer list. /****************** &s o = %o% + 1 &s layers = [value opt%o%] &end /* Invalid option. /****************** &otherwise &do &type /&>> Invalid Option: [value opt%o%] &return &warning %usg% &end &end &s o = %o% + 1 &end &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /*************************************************************** /* bailout - Routine to exit AML gracefully if an error occurs. /*************************************************************** &routine bailout &severity &error &ignore &workspace %home% /* If still in a program then return to ARC. /******************************************** &select [upcase [show program]] &when APPEND end &when ARCEDIT quit no &when TABLES quit &end /* Remove temporary files made during execution of the AML. /*********************************************************** &call cleanup /* Kill coverages made during import that may be incomplete. /************************************************************ &if [variable crlist] &then &do &if ^ [null %crlist%] &then &do cvr &list %crlist% kill %cvr% all &end &end /* Move any saved coverages back to original location. /****************************************************** &if [variable svlist] &then &do &if ^ [null %svlist%] &then &do &do cvr &list %svlist% copy [joinfile %savdir% %cvr% -sub] %cvr% &end deleteworkspace %savdir% &end &end /* Reset precision and display back to original settings. /********************************************************* &if [variable prec] &then precision %prec% &if [variable disp] &then display %disp% &return &warning /&>>ERROR OCCURRED - Bailing Out of sdts2cov.aml ... /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /*********************************************** /* cleanup - Routine to cleanup obsolete files. /*********************************************** &routine cleanup /* Delete files made during execution of AML that are no longer needed. /*********************************************************************** &s dlok = [delete tct.tmp -file] &s dlok = [delete sdtsinfo.wat -file] &do t &list p a n x &do s &list f m r t &s dlok = [delete %t%acoi.join -info] &s dlok = [delete %t%acoi.save -info] &if [variable cat] &then &do &s dlok = [delete %t%a%cat%%s%.join -info] &s dlok = [delete %t%a%cat%%s%.save -info] &end &end &end &s cmb = [listfile cmb* -cover] &if ^ [null %cmb%] &then &do del &list %cmb% &s sfx = [locase [substr %del% [calc [length %del%] - 1] 2]] &if %sfx% = '_p' | %sfx% = '_x' &then kill %del% all &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /***************************************************************************** /* combine - Routine to combine coverages for transfers with multiple layers. /***************************************************************************** &routine combine &if %cct% < 2 | ^ %combine% &then &return /* Create a separate coverage list for each category and create working /* copies of each coverage. /*********************************************************************** &s catlist = [unquote ' '] &s curcat = ' ' &do i = 1 &to %cct% &if [value ccat%i%] ^= %curcat% &then &s curcat = [value ccat%i%] &if ^ [variable cct%curcat%] &then &do &s catlist = %catlist% %curcat% &s cct%curcat% = 1 &end &else &s cct%curcat% = [value cct%curcat%] + 1 &s sn = [scratchname -prefix cmb -suffix _p -directory] &s cvrg%curcat%[value cct%curcat%] = %sn% copy [value cvrg%i%] %sn% &s cpnt%curcat%[value cct%curcat%] = [value cpnt%i%] &if [value cpnt%i%] ^= -1 &then copy [value cvrg%i%]x [subst %sn% _p _x] &end /* Loop through each category. /****************************** &do c &list %catlist% &s pnts%c% = .FALSE. /* Make sure FAT items match for all coverages. /* Loop through each feature type. /*********************************************** &do t &list p a n x &if %t% = 'x' &then &do &s covct = 0 &do i = 1 &to [value cct%c%] &if [value cpnt%c%%i%] > -1 &then &do &s covct = %covct% + 1 &s covlist%covct% = [subst [value cvrg%c%%i%] _p _x] &end &end &s pnts%c% = [calc %covct% > 1] &end &else &do &s covct = [value cct%c%] &do i = 1 &to %covct% &s covlist%i% = [value cvrg%c%%i%] &end &end &if %covct% > 1 &then &do i = 1 &to [calc %covct% - 1] &s curfat = [value covlist%i%][value %t%fat] &s nxtfat = [value covlist[calc %i% + 1]][value %t%fat] &s strt = [upcase [value covlist%i%]]-ID &s ilist = [unquote [after [quote [listitem %curfat% -info]] %strt%]] &if ^ [null %ilist%] &then &do &s strt = [upcase [value covlist[calc %i% + 1]]]-ID &do item &list %ilist% &if ^ [iteminfo %nxtfat% -info %item% -exists] &then &do &s idef = [iteminfo %curfat% -info %item% -definition] &s iw = [extract 1 %idef%] &s ow = [extract 2 %idef%] &s ty = [extract 3 %idef%] &s dp = [extract 4 %idef%] &if %dp% = 0 &then &s dp = # &s idef = %iw% %ow% %ty% %dp% additem %nxtfat% %nxtfat% %item% %idef% %strt% &if %ty% ^= 'C' &then &do &s nitem = %item% &call noapval &if ^ [null %nav%] &then &do tables select %nxtfat% calculate %item% = %nav% quit &end &end &end &s strt = %item% &end &end &s strt = [upcase [value covlist[calc %i% + 1]]]-ID &s ilist = [unquote [after [quote [listitem %nxtfat% -info]] %strt%]] &if ^ [null %ilist%] &then &do &do item &list %ilist% &if ^ [iteminfo %curfat% -info %item% -exists] &then &do &s idef = [iteminfo %nxtfat% -info %item% -definition] &s iw = [extract 1 %idef%] &s ow = [extract 2 %idef%] &s ty = [extract 3 %idef%] &s dp = [extract 4 %idef%] &if %dp% = 0 &then &s dp = # &s idef = %iw% %ow% %ty% %dp% &do j = %i% &to 1 &by -1 &s prvfat = [value covlist%j%][value %t%fat] &if [index %strt% '-ID'] > 0 &then &s strt = [upcase [value covlist%j%]]-ID additem %prvfat% %prvfat% %item% %idef% %strt% &if %ty% ^= 'C' &then &do &s nitem = %item% &call noapval &if ^ [null %nav%] &then &do tables select %prvfat% calculate %item% = %nav% quit &end &end &end &end &s strt = %item% &end &end &end &end /* Flag neatlines. Do not include lines on the neatline that contain /* attributes. /********************************************************************* &do i = 1 &to [value cct%c%] additem [value cvrg%c%%i%].aat [value cvrg%c%%i%].aat flag 1 1 i tables select [value cvrg%c%%i%].aat reselect lpoly# = 1 | rpoly# = 1 &if [show number select] > 0 &then &do &s strt = [upcase [value cvrg%c%%i%]]-ID &s ilist = [listitem [value cvrg%c%%i%].aat -info] &s ilist = [unquote [before [after [quote %ilist%] %strt%] FLAG]] &do item &list %ilist% &while [show number select] > 0 &if [upcase [extract 3 [iteminfo [value cvrg%c%%i%].aat -info ~ %item% -definition]]] = 'C' &then reselect %item% = ' ' &else &do &s nitem = %item% &call noapval &if ^ [null %nav%] &then reselect %item% = %nav% &end &end &if [show number select] > 0 &then calculate flag = 1 &end quit &end /* Combine coverages. /********************* &do cvr &list %ocp%%c%c %ocp%%c%cx &call covexist &end mapjoin %ocp%%c%c poly line node &do i = 1 &to [value cct%c%] [value cvrg%c%%i%] &end [unquote ' '] y y &s crlist = %crlist% %ocp%%c%c &if [value pnts%c%] &then &do append %ocp%%c%cx point &do i = 1 &to [value cct%c%] &if [value cpnt%c%%i%] ^= -1 &then [subst [value cvrg%c%%i%] _p _x] &end [unquote ' '] y y &s crlist = %crlist% %ocp%%c%cx build %ocp%%c%cx point &end /* Add redefined item to PAT which is a combination of all attributes. /********************************************************************** &s table = %ocp%%c%c.pat &call lastitem &s polyatts = [calc %lastitem% ^= [upcase %ocp%%c%c]-ID] &if %polyatts% &then &do &s sdef = [iteminfo %table% -info %ocp%%c%c-id -fulldef] &s scol = [extract 1 %sdef%] + [extract 2 %sdef%] &s ldef = [iteminfo %table% -info %lastitem% -fulldef] &s iwid = [extract 1 %ldef%] + [extract 2 %ldef%] - %scol% &end tables select %table% &if %polyatts% &then &do redefine %scol% allatt %iwid% %iwid% c [unquote ' '] &end quit /* Remove internal neatlines where the polygons on either side of the /* of the arcs have matching attributes and get rid of extra label points. /************************************************************************** &s dobuild = .FALSE. display 0 arcedit edit %ocp%%c%c arc select flag = 1 reselect lpoly# ^= 1 & rpoly# ^= 1 &if [show number select] > 0 &then &do &if %polyatts% &then &do relate add lpnum %ocp%%c%c.pat info lpoly# %ocp%%c%c# link rw rpnum %ocp%%c%c.pat info rpoly# %ocp%%c%c# link rw [unquote ' '] reselect lpnum//allatt = rpnum//allatt &end &if [show number select] > 0 &then &do delete build nodups &s dobuild = .TRUE. &end &if %polyatts% &then &do relate drop lpnum rpnum [unquote ' '] &end &end quit yes /* Rebuild topology if needed. /************************************************** &if %dobuild% &then build %ocp%%c%c (!line node poly!) /* Drop extra items and kill working temp coverages. /************************************************** dropitem %ocp%%c%c.aat %ocp%%c%c.aat flag &if %polyatts% &then dropitem %ocp%%c%c.pat %ocp%%c%c.pat allatt &do i = 1 &to [value cct%c%] kill [value cvrg%c%%i%] all &if [value cpnt%c%%i%] > -1 &then kill [subst [value cvrg%c%%i%] _p _x] all &end /* Capture created coverage information. /**************************************** &s cct = %cct% + 1 &s cvrg%cct% = %ocp%%c%c &describe %ocp%%c%c &s cply%cct% = %dsc$polygons% &s carc%cct% = %dsc$arcs% &s cnod%cct% = %dsc$max_node% &if [exists %ocp%%c%cx -cover] &then &do &describe %ocp%%c%cx &s cpnt%cct% = %dsc$points% &end &else &s cpnt%cct% = -1 &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /**************************************************************************** /* covexist - Routine to save coverages that already exist and have the same /* as a coverage produced by the AML. /**************************************************************************** &routine covexist &if [exists %cvr% -directory] &then &do &if [exists %cvr% -cover] &then &do &if [null %svlist%] &then &do &s savdir = [scratchname -prefix save -directory -full] createworkspace %savdir% &end copy %cvr% [joinfile %savdir% %cvr% -sub] kill %cvr% all &s svlist = %svlist% %cvr% &end &else &do &type /&>> New Coverage Name: %cvr% &type >> Coincides With An Existing Directory Name &call bailout &end &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /**************************************************************************** /* dupitems - Routine to check for duplicate items between the FAT table and /* the attribute module. /**************************************************************************** &routine dupitems &s itemlist = [listitem %jointab% -info] &s itemlist = [unquote [after [quote %itemlist%] [extract 1 %itemlist%]]] &s dups = .FALSE. &do it &list %itemlist% &while ^ %dups% &s dups = [iteminfo %table% -info %it% -exists] &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /************************************************************** /* getoutput - Routine to capture screen output from commands. /************************************************************** &routine getoutput /* Save echo, watch, and fullscreen settings. /********************************************* &s echo = [locase [show &echo]] &s watch = [locase [show &watch]] &s fullscreen = [show &fullscreen] /* Turn off echo, watch, and screen paging and open temp watch file. /******************************************************************** &echo &off &if %watch% ^= &off &then &do &watch &off &s watch = %watch% &append &end &fullscreen &nopaging &s gofile = [scratchname -prefix go -suffix .wat -file] &watch %gofile% /* Issue command then turn off temp watch file. /*********************************************** %gocmd% &watch &off /* Reset echo, watch, and fullscreen settings. /********************************************** &echo %echo% &watch %watch% &fullscreen %fullscreen% &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /**************************************************************************** /* itemdrop - Routine to drop items that are "Not Applied" for any record in /* the FAT. /**************************************************************************** &routine itemdrop &if ^ %dropitems% &then &return tables select %cov%[value %t%fat] /* Loop through all items in the FAT after ENTITY_LABEL. /******************************************************** &do it &list [unquote [after [quote [listitem %cov%[value %t%fat] -info]] ~ 'ENTITY_LABEL']] &s itemok = .TRUE. /* If item is numeric then get "not applied" value. /*************************************************** &if [upcase [extract 3 [iteminfo %cov%[value %t%fat] -info %it% ~ -definition]]] ^= 'C' &then &do &s nitem = %it% &call noapval &if [null %nav%] &then &s itemok = .FALSE. &end /* Item is character. /********************* &else &s nav = ' ' /* If item is empty for entire coverage then drop it. /***************************************************** &if %itemok% &then &do reselect %it% ^= %nav% &if [show number select] = 0 &then &do select dropitem %cov%[value %t%fat] %it% select %cov%[value %t%fat] &end &else aselect &end &end quit &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /********************************************************** /* joindef - Routine to join attribute definitions to FAT. /********************************************************** &routine joindef &if ^ %define% &then &return &if ^ [exists entdef.tab -info] &then import info [joinfile [dir %aml$fullfile%] entdef.e00 -file] entdef.tab joinitem %cov%[value %t%fat] entdef.tab %cov%[value %t%fat] entity_label ~ entity_label ordered &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /********************************************************************* /* joinmod - Routine to join the primary attribute module to the FAT. /********************************************************************* &routine joinmod /* Find attribute module. /************************* &if [exists %cov%.a%cat%f -info] &then &s attmod = %cov%.a%cat%f &else &s attmod = %cover%.a%cat%f /* Join attribute module to FAT. /******************************** &s table = %cov%[value %t%fat] &call lastitem joinitem %cov%[value %t%fat] %attmod% %cov%[value %t%fat] ~ modn_id %lastitem% ordered /* Assign "not applied value to non-matching numeric items. /*********************************************************** &s primkey = modn_id &call nomatch /* Drop modn_id from FAT. /************************* dropitem %cov%[value %t%fat] %cov%[value %t%fat] modn_id &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /******************************************************************** /* joinotm - Routine to resolve one to many relationships by joining /* additional attributes to the FAT. /******************************************************************** &routine joinotm /* Get list of items in attribute module. /***************************************** &s items = [listitem %attmod% -info] &s items = [unquote [after [quote %items%] [extract 1 %items%]]] /* Get definitions for each item. /********************************* &s itm = 0 &do item &list %items% &s itm = %itm% + 1 &s item%itm% = %item% &s strt%itm% = %item% &s idef = [iteminfo %attmod% -info %item% -definition] &s iw = [extract 1 %idef%] &s ow = [extract 2 %idef%] &s ty = [extract 3 %idef%] &s dp = [extract 4 %idef%] &if %dp% = 0 &then &s dp = # &s idef%itm% = %iw% %ow% %ty% %dp% &end /* Define table relationships. /****************************** tables relate add r1; %t%%tab%.join; info; %cov%-id; %cov%-id; ordered; rw r2; %attmod%; info; modn_id; modn_id; ordered; ro [unquote ' '] /* Purge records from copy of attribute module that have already been /* joined. /********************************************************************* select %t%%tab%.save reselect flag = 1 purge y /* Loop until all records in attribute module are joined and purged. /******************************************************************** &s add = 1 &do &while [show number select] > 0 /* The first time through, append the number 1 to the names of the /* original joined items. /****************************************************************** &if %add% = 1 &then &do c = 1 &to %itm% &if ^ [iteminfo %cov%[value %t%fat] -info [value item%c%]1 ~ -exists] &then &do select %cov%[value %t%fat] alter [value item%c%],[value item%c%]1,,,,, &s strt%c% = [value strt%c%]1 &end &end quit /* Add new items to be joined to the FAT with the counter number appended /* to the original item name. /************************************************************************* &s add = %add% + 1 &do c = 1 &to %itm% &if ^ [iteminfo %cov%[value %t%fat] -info [value item%c%]%add% ~ -exists] &then &do additem %cov%[value %t%fat] %cov%[value %t%fat] [value item%c%]%add% ~ [value idef%c%] [value strt%c%] &s strt%c% = [value item%c%]%add% &end &end /* Create a copy of the join table containing only the records to be /* joined. /******************************************************************** &call uniqueids /* Join attributes from attribute module to FAT. /************************************************ tables select %cov%[value %t%fat] reselect r1//modn_name = [quote [upcase %tab%]] &if [show number select] > 0 &then &do c = 1 &to %itm% &if [upcase [extract 3 [value idef%c%]]] = 'C' &then move r1//r2//[value item%c%] to [value item%c%]%add% &else calculate [value item%c%]%add% = r1//r2//[value item%c%] &end /* Assign "not applied" value to non-matching records. /****************************************************** nselect &if [show number select] > 0 &then &do c = 1 &to %itm% &if [upcase [extract 3 [value idef%c%]]] ^= 'C' &then &do &s nitem = [value item%c%] &call noapval &if ^ [null %nav%] &then calculate [value item%c%]%add% = %nav% &end &end /* Purge records from copy of attribute module that have already been /* joined. /********************************************************************* select %t%%tab%.save reselect flag = 1 purge y &end relate drop r1 r2 [unquote ' '] quit &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /******************************************************************** /* joinsec - Routine to join secondary attribute modules to the FAT. /******************************************************************** &routine joinsec /* Loop through each module, joining those tables that exist and have a /* primary key in the FAT. /*********************************************************************** &do stab &list bmsp bmta bgrl bfpc bfps &if [iteminfo %cov%[value %t%fat] -info [value pk%stab%] -exists] & ~ [exists %cov%.%stab% -info] &then &do joinitem %cov%[value %t%fat] %cov%.%stab% %cov%[value %t%fat] ~ [value pk%stab%] [value pk%stab%] ordered /* Assign "not applied" value to non-matching numeric items. /************************************************************ &s attmod = %cov%.%stab% &s primkey = [value pk%stab%] &call nomatch /* Drop modn_id from FAT. /************************* dropitem %cov%[value %t%fat] %cov%[value %t%fat] modn_id &end &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /******************************************************************** /* jointab - Routine to join existing attribute modules to the FATs. /******************************************************************** &routine jointab /* Loop through possible attribute modules to join. /*************************************************** &do tab &list a%cat%f a%cat%m a%cat%r a%cat%t acoi /* Check for existence of attribute module. /******************************************* &s domod = .TRUE. &if [exists %cov%.%tab% -info] &then &s attmod = %cov%.%tab% &else &if [exists %cover%.%tab% -info] &then &s attmod = %cover%.%tab% &else &s domod = .FALSE. /* Join module. &if %domod% &then &do /* Initialize variables. /************************ &s sfx = [substr %tab% 4 1] &s ftab = [calc %sfx% = 'f'] &s rtab = [calc %sfx% = 'r'] &s ttab = [calc %sfx% = 't'] /* If joining the elevation module then append the units to the /* elevation item name. /*************************************************************** tables &if %rtab% | %ttab% &then &do select %attmod% alter elevation,elevation_[value %sfx%unit],,,,, &end /* Create a copy of the join table containing only records for the /* current attribute module. /****************************************************************** copy %cov%.%t%join %t%%tab%.join select %t%%tab%.join reselect modn_name ^= [quote [upcase %tab%]] purge y quit /* Create an additional copy of the join table containing a flag item /* if there is a possibility of a one to many relationship between the /* FAT and the join table. /********************************************************************** &if ^ %ftab% &then &do copyinfo %t%%tab%.join %t%%tab%.save additem %t%%tab%.save %t%%tab%.save flag 1 1 i &call uniqueids &end /* Join the join table to the FAT. /********************************** &s table = %cov%[value %t%fat] &call lastitem joinitem %cov%[value %t%fat] %t%%tab%.join %cov%[value %t%fat] ~ %cov%-id %lastitem% ordered /* If items from the attribute module do not already exist in the FAT /* then join the attribute module to the FAT. /********************************************************************* &s jointab = %attmod% &call dupitems &if ^ %dups% &then &do &call lastitem joinitem %cov%[value %t%fat] %attmod% %cov%[value %t%fat] modn_id ~ %lastitem% ordered &end /* Set up relate environment and create an item list. /***************************************************** tables relate add join; %attmod%; info; modn_id; modn_id; ordered; ro [unquote ' '] &s itemlist = [listitem %attmod% -info] &s itemlist = [unquote [after [quote %itemlist%] ~ [extract 1 %itemlist%]]] /* Select records in FAT that have a matching record in attribute /* module. /***************************************************************** select %cov%[value %t%fat] reselect join//modn_id > 0 /* If items already existed in FAT then assign value from attribute /* module. /******************************************************************* &if %dups% & [show number select] > 0 &then &do it &list %itemlist% &if [upcase [extract 3 [iteminfo %attmod% -info %it% ~ -definition]]] = 'C' &then move join//%it% to %it% &else calculate %it% = join//%it% &end /* Assign "not applied" value to non-matching records. /****************************************************** nselect &if [show number select] > 0 &then &do it &list %itemlist% &if [upcase [extract 3 [iteminfo %attmod% -info %it% ~ -definition]]] ^= 'C' &then &do &s nitem = %it% &call noapval &if ^ [null %nav%] &then calculate %it% = %nav% &end &end /* Drop relate and join file items. /*********************************** relate drop join [unquote ' '] quit dropitem %cov%[value %t%fat] %cov%[value %t%fat] modn_name; modn_id; end /* If possible one to many relationships exists then resolve them. /****************************************************************** &if ^ %ftab% &then &call joinotm /* Append units to elevation item name. /*************************************** &if %rtab% | %ttab% &then &do tables select %attmod% alter elevation_[value %sfx%unit],elevation,,,,, quit &end &end &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /************************************************** /* lastitem - Routine to get last item in a table. /************************************************** &routine lastitem &do li &list [listitem %table% -info] &s lastitem = %li% &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /***************************************************************** /* layercount - Routine to count and identify layers in transfer. /***************************************************************** &routine layercount /* Get sdtsinfo command output. /******************************* &s gocmd = sdtsinfo %fullitp% &call getoutput /* Read layer information from output file. /******************************************* &s sif = [open %gofile% opok -read] &if %opok% ^= 0 &then &call layererror /* Extract number of layers in transfer. /**************************************** &s irec = [quote [unquote [read %sif% rdok]]] &s found = .FALSE. &do &while %rdok% = 0 & ^ %found% &if ^ [null %irec%] &then &do &if ( [quote [unquote [substr %irec% 2 16]]] = ~ 'Number of layers' ) | ~ ( [quote [unquote [substr %irec% 2 22]]] = ~ 'Number of data layers:' ) &then &s found = .TRUE. &end &if ^ %found% &then &s irec = [quote [unquote [read %sif% rdok]]] &end &if %found% &then &s layerct = [unquote [substr %irec% 25]] &else &call layererror /* If theme is transportation then extract category for each layer. /******************************************************************* &if %ctg% = 'tr' &then &do &s mtct = 0 &s rdct = 0 &s rrct = 0 &s trct = 0 &do l = 1 &to %layerct% &s lnam%l% = [trim [unquote [read %sif% rdok]] -both] &end &do l = 1 &to %layerct% &s irec = [quote [unquote [read %sif% rdok]]] &s found = .FALSE. &do &while %rdok% = 0 & ^ %found% &if ^ [null %irec%] &then &do &if [quote [unquote [substr %irec% 2]]] = ~ [quote Layer: [value lnam%l%]] &then &s found = .TRUE. &end &s irec = [quote [unquote [read %sif% rdok]]] &end &if %found% &then &do &select [unquote [substr %irec% 9]] &when PIPE & TRANS LINES &s lcat = mt &when ROADS AND TRAILS &s lcat = rd &when RAILROADS &s lcat = rr &otherwise &s lcat = tr &end &s %lcat%ct = [value %lcat%ct] + 1 &if [value %lcat%ct] < 10 &then &s lct = 0[value %lcat%ct] &else &s lct = [value %lcat%ct] &if %layerct% = 1 &then &s lnam%l% = 1 &s layer[calc [value lnam%l%] * 1] = %lcat% %lct% &end &else &call layererror &end &end &s clok = [close %sif%] &s dlok = [delete %gofile% -file] &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /************************************************************************** /* layererror - Routine to exit AML if an error occurs while reading layer /* information. /************************************************************************** &routine layererror &s clok = [close %sif%] &s dlok = [delete sdtsinfo.wat -file] &return &warning /&>> Error Reading Layer Information /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /************************************************************************* /* layerlist - Routine to evaluate the layers argument and create a layer /* list. /************************************************************************* &routine layerlist &s layerlist = [unquote ' '] /* Generate list for all layers in transfer. /************************************************** &if %all% &then &do l = 1 &to %layerct% &s layerlist = %layerlist% %l% &end /* Generate list for specified layers. /************************************** &else &do &s ill = /&>> Invalid Layer List &if [null %layers%] &then &return &warning %usg% &s lmax = 0 &s layers = [unquote [subst %layers% ',' ' ']] /* Loop through each list element. /********************************** &do lay &list %layers% /* List element is a range. /*************************** &if [index %lay% '..'] > 0 &then &do &s lo = [before %lay% '..'] &s hi = [after %lay% '..'] &if [null %lo%] | [null %hi%] &then &return &warning %ill% &if [type %lo%] ^= -1 | [type %hi%] ^= -1 &then &return &warning %ill% &if %lo% <= %lmax% | %hi% > %layerct% | %lo% >= %hi% &then &return &warning %ill% &do l = [calc %lo% * 1] &to %hi% &s layerlist = %layerlist% %l% &end &s lmax = %hi% &end /* List element is a single value. /********************************** &else &do &if [null %lay%] &then &return &warning %ill% &s lay = [unquote %lay%] &if [type %lay%] ^= -1 &then &return &warning %ill% &if %lay% <= %lmax% &then &return &warning %ill% &s layerlist = %layerlist% %lay% &s lmax = %lay% &end &end &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /************************************************************************** /* noapval - Routine to determine the "Not Applied" value for a particular /* numeric item. /************************************************************************** &routine noapval &if [before %nitem% '_'] = 'ELEVATION' &then &s nitem = ELEVATION &select %nitem% &when LANES, ORIGIN_OF_SURVEY, POPULATION_CLASS, TRACKS &s nav = -9 &when AGENCY, ROAD_WIDTH, ROTATION_ANGLE &s nav = -99 &when WIDTH &s nav = -999 &when RIVER_MILE &s nav = -999.9 &when ELEVATION &s nav = -9999.99 &when POPULATION &s nav = -999999999 &otherwise &s nav = [unquote ' '] &end &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /***************************************************************************** /* nomatch - Routine to assign a "not applied" value to numeric items with no /* matching record in the attribute module. /***************************************************************************** &routine nomatch /* Start tables and add the join relate. /**************************************** tables relate add join; %attmod%; info; %primkey%; %primkey%; ordered; ro [unquote ' '] /* Get list of items in attribute module. /***************************************** &s itemlist = [listitem %attmod% -info] &s itemlist = [unquote [after [quote %itemlist%] [extract 1 ~ %itemlist%]]] /* Check for records in FAT with no match in attribute module. /************************************************************** select %cov%[value %t%fat] reselect join//modn_id > 0 nselect /* Non-matching records exist. /****************************** &if [show number select] > 0 &then &do it &list %itemlist% /* Item is numeric. /******************* &if [upcase [extract 3 [iteminfo %attmod% -info %it% ~ -definition]]] ^= 'C' &then &do /* Assign "not applied" value to selected records. /************************************************** &s nitem = %it% &call noapval &if ^ [null %nav%] &then calculate %it% = %nav% &end &end /* Drop the join relate and quit tables. relate drop join [unquote ' '] quit &return /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /**************************************************************************** /* uniqueids - Routine to create a join table containing only the first /* record for each id from the original join table, allowing an ordered join /* to be used where there was a one to many relationship. /**************************************************************************** &routine uniqueids &workspace info &data info ARC SELECT [upcase %t%%tab%.join] PURGE Y SELECT [upcase %t%%tab%.save] RELATE [upcase %t%%tab%.join] 1 BY [upcase %cov%-ID] INIT CALCULATE $1MODN_ID = 0 SELECT [upcase %t%%tab%.join] RELATE [upcase %t%%tab%.save] 1 BY [upcase %cov%-ID] MOVE $1MODN_NAME TO MODN_NAME CALCULATE MODN_ID = $1MODN_ID CALCULATE $1FLAG = 1 Q STOP &end &workspace %home% &return /* /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END OF PROGRAM >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> VARIABLES >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* /* add - count of items added /* afat - arc feature attribute table extension /* all - true if all layers are to be imported /* attmod - attribute module name /* c - loop counter /* carc[n] - array of coverage arc counts /* cat - DLG category /* catlist - list of categories in the transfer /* ccat[n] - array of created coverage categories /* cct - created coverage counter /* cct[c] - coverage counter for a specific category /* cexist - true if coverage to import already exists /* clok - status variable for close function /* cmb - list of objects with a cmb prefix /* cnod[n] - array of coverage node counts /* combine - true if -COMBINE option specified /* cov - coverage name /* covct - coverage count /* cover - coverage name /* covlist[n] - array of coverage names /* cply[n] - array of coverage polygon counts /* cpnt[n] - array of coverage point counts /* cpnt[c][n] - array of coverage point counts for a specific category /* crlist - list of coverages created by the AML /* ctg - DLG category /* ctglist - list of valid DLG categories /* curcat - current category /* curfat - current feature attribute table /* cvr - coverage name /* cvrg[n] - array of created coverage names /* cvrg[c][n] - array of coverage names for a specific category /* define - true if -DEFINE option specified /* del - object to delete /* dlok - status variable for delete function /* domod - true if attribute module exists /* dp - item decimal places /* disp - saved display settings /* dropitems - true if -DROPITEMS option specified /* dups - true if duplicate items exist /* echo - saved &echo settings /* fmtstr - format string for format function /* found - true if record found /* ftab - true if attribute module suffix is "f" /* fullitp - input transfer prefix with fully expanded path /* fullscreen - saved &fullscreen settings /* gocmd - command string for getoutput routine /* gofile - file name for getoutput watch file /* hi - higher layer value in a range /* home - starting directory /* i - loop counter /* idef - item definition /* idef[n] - array of item definitions /* ilist - item list /* ill - error string for invalid layer list /* irec - record read from file /* it - item in attribute module item list /* item - item in attribute module /* item[n] - array of items in attribute module /* itemlist - list of items in attribute module /* itemok - item has a "not applied" value /* items - list of items in attribute module /* itm - count of items in attribute module /* itp - input transfer prefix /* iw - item width /* j - loop counter /* jointab - name of attribute module to join to the FAT /* l - loop counter /* lastitem - last item in FAT /* lay - layer parsed from layer list /* layer - layer name /* layer[n] - array of layer names and category layer counts /* layerct - number of data layers in transfer /* layerlist - list of layers to import /* layers - layer list specified with -LAYERS option /* lcat - layer category /* lct - category layer count /* li - item in list of FAT items /* lmax - maximum layer value /* lnam[n] - array of layer names /* lo - lower layer value in a range /* lyr - layer parsed from layer list /* more - true if more options exist /* mtct - number of MT layers in transfer /* nav - "not applied" value /* nfat - node feature attribute table extension /* nitem - numeric item /* nt - true if operating system is Windows NT /* num - last two characters of transfer prefix /* numopts - number of possible command line options /* nxtfat - next feature attribute table /* o - option counter /* ocp - output coverage prefix /* opok - status variable for open function /* opt[4] - array of options /* options - unparsed option string /* out - name of temp AML used to determine "tct" when OS is UNIX /* ow - item output width /* path - path to input transfer /* pfat - polygon feature attribute table extension /* pkbfpc - primary key for bfpc module /* pkbfps - primary key for bfps module /* pkbgrl - primary key for bgrl module /* pkbmsp - primary key for bmsp module /* pkbmta - primary key for bmta module /* pnts[c] - number of points for a specific category /* points - true if a points cover was created /* prec - saved precision settings /* primkey - primary key of attribute module /* prvfat - previous feature attribute table /* rdct - number of RD layers in transfer /* rdok - status variable for read function /* rrct - number of RR layers in transfer /* rtab - true if attribute module suffix is "r" /* runit - A??R module units /* s - attribute module suffix /* sav - number of coverages saved /* savdir - save directory name /* sfx - attribute module suffix /* sif - file unit for sdtsinfo watch file /* sn - scratch name for an object /* stab - secondary attribute module /* strt - start item name /* strt[n] - array of start items for joinitem /* svlist - list of coverages saved by the AML /* t - feature type abreviation /* tab - attribute module extension /* table - FAT name /* tct - count of input transfer .DDF files /* tocp - truncated output coverage prefix /* trct - number of TR layers in transfer /* ttab - true if attribute module suffix is "t" /* tunit - A??T module units /* ty - item type /* usg - usage string /* vrs - ARC/INFO version number /* watch - saved &watch settings /* xexist - true if point coverage to import already exists /* xfat - point feature attribute table extension /* /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>