WATERSHED, STREAM NETWORK, AND DRAINAGE AREA DELINEATION IN GRID

/* COMMANDS FOR PRE-PROCESSING THE DEM

%gunzip <dem_name> -v
/*unzip the DEM file. Use
/* gunzip is for unzipping .gz files from Netscape
/* Now you need to rearrange the block size correctly for ArcInfo
/*
%dd if=dem_name of=outfile_name cbs=1024 conv=unblock
% arc
Arc: demlattice austin_w.dem coverlat usgs /*Convert a DEM in USGS
/* or TAME format to a lattice.
/* (If you copy several adjacent grids for analysis, they must be merged to
/* construct a single map.)
/*
Arc: grid
Grid: auslat = merge(coverlat,...,...)
/*
/* The following commands allow you to display your grid and isolate a
/* portion for analysis:
/*
Grid: display 9999
Grid: mape auslat
Grid: gridpaint auslat value linear nowrap gray
Grid: setwindow * /*(allows the specification of a smaller window
/* within the map extent defined, using the mouse/cursor)
Grid: ausdem = auslat
/****************************************************************************

/* A GRID AML FOR WATERSHED, STREAM NETWORK, AND DRAINAGE AREA DELINEATION
/*
/* AML NAME: delineate.aml (run from the "Grid" prompt)
/* FUNCTION: Delineates stream networks, watersheds, and drainage
/* areas from a 3" DEM
/*
/* INPUTS:
/* ausdem - the pre-processed DEM from above
/* geoalb.prj - a projection file converting a geographic (global) grid
/* to a map (albers) grid
/* gages - geographic point coverage of USGS surflace flow gages in a
/* particular state or region
/* border - polygon coverage of the outline of particular region of interest
/*
/* The procedure used to pre-process the DEM is described above.
/*
/* In the AML, the following acronyms apply:
/* lat = original lattice file
/* prj = lattice projected into real world coordinates
/* fil = projected grid for which pits have been filled
/* fdr = flow direction grid
/* fac = flowaccumulation grid
/* str = streams grid (all same zone)
/* lnk = links created with one for each stream segment
/* out = outlet cell at bottom of each link
/* shd = watershed for each outlet
/***************************************************************************
/*
/* BEGIN AML EXECUTION
/*
/* The grid must be projected from GEOGRAPHIC coordinates to flat map
/* coordinates before analysis. Use a projection file to convert to
/* coordinate system of choice. 100 meters is specified as cell size.
ausprj = project (ausdem, geoalb.prj ,#, 100)
setwindow ausprj
/* The pits (specified as SINKs) in the terrain that are > a 100 m drop
/* are then filled.
fill ausprj ausfil SINK 100 #
/* Determine the flow direction grid.
ausfdr = flowdirection ( ausfil )
/* Now calculate the flow accumulation grid.
ausfac = flowaccumulation ( ausfdr )
/* ask the user for the threshold number of cells in flow accumulation
/* which will form a stream.
&sv thres = [response 'Value of Threshold? =';]
/* isolate the lines of cells having at least this threshold flow
/* accumulation
ausstr = con ( ausfac > %thres%, 1 )
/* make each stream link unique
auslnk = streamlink ( ausstr, ausfdr )
/* make an arc coverage out of the stream links
covlnk = gridline(auslnk)
/* find link outlets
ausacc = zonalmax (auslnk, ausfac)
ausout = con ( ausacc == ausfac, auslnk)
/* delineate watersheds from these outlets.
ausshd = watershed (ausfdr, ausout)
/* make a polygon coverage of the watersheds
covshd = gridpoly (ausshd)
/* drop back to the Arc/Info program/prompt
quit
/* convert geographic flow gage coordinates to the same map coordinates
/* used above
project cover gages flogages geoalb.prj
/* create a point coverage of "local" flow gages from the projected
/* coverage
clip flogages border locgages point
/* attach x & y coordinates to the gages
addxy locgages
/* call up GRID
grid
/* define the gage locations as subwatershed "outlet points" within
/* the watershed delineated above
drainpts = selectpoint(ausshd,locgages)
/* **CAUTION** if the flow gage locations do not directly fall on
/* delineated streams within the ausshd grid, then the drainpts grid may
/* need to be determined interactively through use of selectpoint(ausshd,*).
/* delineate the drainage areas to each flow gage
shdareas = watershed(ausfdr,drainpts)
/* create an equivalent polygon coverage of the drainage areas grid
covareas = gridpoly(shdareas)
&return
/******************END OF AML****************************************



Go to AML Listing
Quick Connect to 3" DEM Web Site