/* based on newb, but variable buffer width /* we continue our effort to build a great DEM &if [show program] ne 'ARC' &then &return This must be started from ARC &set contcov elev &set elv_item elev_meters &set cellsize 5 /* this require setenv GRIDALLOCSIZE 177 &s width 5 /* width of stream buffer in meters &s rivitem riv_elv &s rivdepth 3 /* assume the river is 1 foot lower than contours imply /* But we neglected to update rivspot elevations after we finished determining /* endpoint elevations in splitrivs. So... &if ^ [iteminfo splitrivs -arc width -exists] &then additem splitrivs.aat splitrivs.aat width 4 4 i tables sel splitrivs.aat calc width = ( strahler ** 0.5 ) * 3 relate add fromarc splitrivs.aat info rivspots# FNODE# linear RO toarc splitrivs.aat info rivspots# TNODE# linear RO [unquote ''] sel rivspots.pat resel elv le 0 calc elv = fromarc//elvf resel elv le 0 calc elv = toarc//elvt quit buffer splitrivs rivbuff width # # 0.1 LINE ROUND FULL build rivbuff line &if ^ [iteminfo rivbuff -ARC %elv_item% -exists] &then; &do additem rivbuff.aat rivbuff.aat ELEV_METERS 8 8 N 2 additem rivbuff.aat rivbuff.aat JORDER 4 4 I additem rivbuff.aat rivbuff.aat SHREVE 4 4 I additem rivbuff.aat rivbuff.aat STRAHLER 2 2 I &end /* remove all temporary files from the INFO directory ARCEDIT kill $$temp* info yes QUIT &if [exists tmpcovb -cover] &then kill tmpcovb append tmpcovb line %contcov% rivbuff end clean tmpcovb tmpcovb2 0 .001 line Arcedit ec tmpcovb2 ef arc sel all unsplit %elv_item% sel %elv_item% = 0 put splitbufs nselect put splitcontsb QUIT &type The coverages splitbufs and splitcontsb have been created. INDEXITEM splitcontsb.aat TNODE# INDEXITEM splitcontsb.aat FNODE# INDEXITEM splitbufs.aat TNODE# INDEXITEM splitbufs.aat FNODE# relate add toto splitcontsb.aat info TNODE# TNODE# linear rw fromfrom splitcontsb.aat info FNODE# FNODE# linear rw tofrom splitcontsb.aat info TNODE# FNODE# linear rw fromto splitcontsb.aat info FNODE# TNODE# linear rw [unquote ''] Arcedit ec splitbufs ef arc additem elvt 4 12 F 3 additem elvf 4 12 F 3 /* calc most of the to elevations sel all calc elvt = -99 /* We don't want to be confused by shorelines calc elvt = toto//%elv_item% sel elvt = -99 &type [show number select] elvt not matched with the "to" relate. asel elvt = 0 &type No, [show number select] elvt not matched. &if [show number select] > 0 &then calc elvt = tofrom//%elv_item% /* this may not cover anything more /* calc most of the from elevations sel all calc elvf = -99 /* We don't want to be confused by shorelines calc elvf = fromfrom//%elv_item% sel elvf = -99 &type [show number select] elvf not matched with the "from" relate. asel elvf = 0 &type No, [show number select] elvf not matched. &if [show number select] > 0 &then calc elvf = fromto//%elv_item% /* this may not cover anything more resel elvf = 0 &if [show number select] > 0 &then calc elvf = elvt sel elvt = 0 &if [show number select] > 0 &then calc elvt = elvf sel elvf = 0;asel elvt = 0 &if [show number select] > 0 &then &RETURN some buffer arcs are not yet coded sel elvf = elvt &ty Deleting [show number select] constant elv buffer arcs delete sel elvf < elvt flip save /* snip out pieces of contours ec splitrivs ef arc sel all put SPLITCONTSB y quit clean SPLITCONTSB SPLITCONTSB2 .001 .001 line arcedit ec SPLITCONTSB2 ef arc sel SHREVE <> 0 asel connect delete quit y y /* lower the river (note: elevation still in feet) tables additem rivspots.pat %rivitem% 4 8 f 3 sel rivspots.pat calc %rivitem% = elv - %rivdepth% q topogrid unfilled %cellsize% point rivspots %rivitem% /* point bank %bankitem% /* point spot %elv_item% /* &if [exist spot -cover] &then /* point spot DXF-ELEVATION contour SPLITCONTSB2 %elv_item% stream splitrivs stream splitbufs end grid fill unfilled goodgrid