/* dlg.aml 11/18/93 Program designed by W Beeman USGS Lakewood, CO. /* This program was designed to pull data from USGS digital line graph files /* (DLG) and convert them to ARC/INFO coverages. This is a simple program /* that is provided as a template for anyone contemplating converting DLG /* files into ARC/INFO coverages. It was originally designed for Amy Hessl, /* who is compiling a 1:100000 coastline of the U.S. in an ARC/INFO format. /* The files that are the basis for the data for her project are hydrography /* files, and the final five digits for each file name contain the character /* sequence hyf, for hydrography file, and the two digit sequence of 01 through /* 08 to reflect the position of each section in the 1/4 quad. The first two /* characters are a code for the quad, and the third digit is a code for the /* position of the 1/4 quad. This program is prompted by the first three /* digits - the unique identifiers for each 1/4 quad - to look for any of /* the eight sections that might exist in the workspace. Any existing files /* are then converted into ARC/INFO coverages, and the coverage built for /* lines. An item called lcode is added to the attribute table, and the minor1 /* code is put into it from the .acode info file. This allows for the eight /* individual coverages to be appended while still keeping the minor1 code /* attached to the lines. The resulting coverage can then have reselect /* commands executed to remove the neatlines (rpoly# = 1 or lpoly# =1) or to /* pull out any of the coded lines. Those commands are removed from this /* aml to leave it a more basic program that can be altered for more /* specific uses (adding other aat categories, building for polygons and /* attaching .pcode attributes, for example). This aml can also be put into /* a batch process to convert many coverages at one time. /* This aml has been used effectively for converting DLG files into ARC /* coverages and attaching the minor1 code, but no warranty is attached to /* its use. This aml was designed and used in Arc version 6.1.1. /* wbeeman@greenwood.cr.usgs.gov &args var1 &echo &on &severity &error &ignore &sv var2 := [translate %var1%] &if [exists %var1%hyf01 -file] &then &do dlgarc optional %var1%hyf01 %var1%_01 build %var1%_01 line additem %var1%_01.aat %var1%_01.aat lcode 6 6 i &end &if [exists %var1%hyf02 -file] &then &do dlgarc optional %var1%hyf02 %var1%_02 build %var1%_02 line additem %var1%_02.aat %var1%_02.aat lcode 6 6 i &end &if [exists %var1%hyf03 -file] &then &do dlgarc optional %var1%hyf03 %var1%_03 build %var1%_03 line additem %var1%_03.aat %var1%_03.aat lcode 6 6 i &end &if [exists %var1%hyf04 -file] &then &do dlgarc optional %var1%hyf04 %var1%_04 build %var1%_04 line additem %var1%_04.aat %var1%_04.aat lcode 6 6 i &end &if [exists %var1%hyf05 -file] &then &do dlgarc optional %var1%hyf05 %var1%_05 build %var1%_05 line additem %var1%_05.aat %var1%_05.aat lcode 6 6 i &end &if [exists %var1%hyf06 -file] &then &do dlgarc optional %var1%hyf06 %var1%_06 build %var1%_06 line additem %var1%_06.aat %var1%_06.aat lcode 6 6 i &end &if [exists %var1%hyf07 -file] &then &do dlgarc optional %var1%hyf07 %var1%_07 build %var1%_07 line additem %var1%_07.aat %var1%_07.aat lcode 6 6 i &end &if [exists %var1%hyf08 -file] &then &do dlgarc optional %var1%hyf08 %var1%_08 build %var1%_08 line additem %var1%_08.aat %var1%_08.aat lcode 6 6 i &end arcedit &if [exists %var1%_01 -ARC] &then &do editcover %var1%_01 editfeature arc &if [exists %var1%_01.acode -INFO] &then &do relate add temp1 %var1%_01.acode INFO %var1%_01-id %var1%_01-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_02 -ARC] &then &do editcover %var1%_02 editfeature arc &if [exists %var1%_02.acode -INFO] &then &do relate add temp1 %var1%_02.acode INFO %var1%_02-id %var1%_02-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_03 -ARC] &then &do editcover %var1%_03 editfeature arc &if [exists %var1%_03.acode -INFO] &then &do relate add temp1 %var1%_03.acode INFO %var1%_03-id %var1%_03-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_04 -ARC] &then &do editcover %var1%_04 editfeature arc &if [exists %var1%_04.acode -INFO] &then &do relate add temp1 %var1%_04.acode INFO %var1%_04-id %var1%_04-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_05 -ARC] &then &do editcover %var1%_05 editfeature arc &if [exists %var1%_05.acode -INFO] &then &do relate add temp1 %var1%_05.acode INFO %var1%_05-id %var1%_05-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_06 -ARC] &then &do editcover %var1%_06 editfeature arc &if [exists %var1%_06.acode -INFO] &then &do relate add temp1 %var1%_06.acode INFO %var1%_06-id %var1%_06-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_07 -ARC] &then &do editcover %var1%_07 editfeature arc &if [exists %var1%_07.acode -INFO] &then &do relate add temp1 %var1%_07.acode INFO %var1%_07-id %var1%_07-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end &if [exists %var1%_08 -ARC] &then &do editcover %var1%_08 editfeature arc &if [exists %var1%_08.acode -INFO] &then &do relate add temp1 %var1%_08.acode INFO %var1%_08-id %var1%_08-id ordered rw ~ select all calculate lcode = temp1//minor1 relate drop temp1 ~ &end &end q y y &data ARC INFO ARC &if [exists %var2%_01.ACODE -INFO] &then &do SELECT %var2%_01.ACODE ERASE %var2%_01.ACODE Y &end &if [exists %var2%_02.ACODE -INFO] &then &do SELECT %var2%_02.ACODE ERASE %var2%_02.ACODE Y &end &if [exists %var2%_03.ACODE -INFO] &then &do SELECT %var2%_03.ACODE ERASE %var2%_03.ACODE Y &end &if [exists %var2%_04.ACODE -INFO] &then &do SELECT %var2%_04.ACODE ERASE %var2%_04.ACODE Y &end &if [exists %var2%_05.ACODE -INFO] &then &do SELECT %var2%_05.ACODE ERASE %var2%_05.ACODE Y &end &if [exists %var2%_06.ACODE -INFO] &then &do SELECT %var2%_06.ACODE ERASE %var2%_06.ACODE Y &end &if [exists %var2%_07.ACODE -INFO] &then &do SELECT %var2%_07.ACODE ERASE %var2%_07.ACODE Y &end &if [exists %var2%_08.ACODE -INFO] &then &do SELECT %var2%_08.ACODE ERASE %var2%_08.ACODE Y &end &if [exists %var2%_01.PCODE -INFO] &then &do SELECT %var2%_01.PCODE ERASE %var2%_01.PCODE Y &end &if [exists %var2%_02.PCODE -INFO] &then &do SELECT %var2%_02.PCODE ERASE %var2%_02.PCODE Y &end &if [exists %var2%_03.PCODE -INFO] &then &do SELECT %var2%_03.PCODE ERASE %var2%_03.PCODE Y &end &if [exists %var2%_04.PCODE -INFO] &then &do SELECT %var2%_04.PCODE ERASE %var2%_04.PCODE Y &end &if [exists %var2%_05.PCODE -INFO] &then &do SELECT %var2%_05.PCODE ERASE %var2%_05.PCODE Y &end &if [exists %var2%_06.PCODE -INFO] &then &do SELECT %var2%_06.PCODE ERASE %var2%_06.PCODE Y &end &if [exists %var2%_07.PCODE -INFO] &then &do SELECT %var2%_07.PCODE ERASE %var2%_07.PCODE Y &end &if [exists %var2%_08.PCODE -INFO] &then &do SELECT %var2%_08.PCODE ERASE %var2%_08.PCODE Y &end Q STOP &end append %var1%_all line all %var1%_01 %var1%_02 %var1%_03 %var1%_04 %var1%_05 %var1%_06 %var1%_07 %var1%_08 end build %var1%_all line kill %var1%_01 all kill %var1%_02 all kill %var1%_03 all kill %var1%_04 all kill %var1%_05 all kill %var1%_06 all kill %var1%_07 all kill %var1%_08 all &echo &off &return