/* For future work? This does not preserve ID number of river so that /* attributes can be transfered NODEPOINT wholerivs allnodes ae ec allnodes ef point sel flag = 'M' put mouths sel flag = 'S' put sources quit GRID setwindow goodgrid ;setcell goodgrid mouthg = pointgrid(mouths) &describe goodgrid setcell [calc %grd$dx% / 5] tmpr = ^ isnull(LINEGRID(wholerivs)) setcell maxof rivcount = aggregate(tmpr ,5,sum,#,data) rgrid = con(rivcount ge 3,1,mouthg ge 0,1) /* replaced by code above /* rgrid = LINEGRID(wholerivs) setmask rgrid rid = costallocation(mouthg,rgrid,rivdist) setmask off /* because flowdir is suddenly flaky: rename rivdist uff rivdist = con(isnull(uff),1000000,uff) kill uff /* end of flowdir fix rivdir = flowdirection(rivdist) orthoriv = streamline(rid,rivdir) /* note: Douglas suggests setmask rgrid;griv = gridline(rgrid,#,nothin,#,#,#,5,#,#); setmask off, but I am not satisfied QUIT ungenerate POINT sources sources.gen &sys echo 'coord keyboard;clearsel;trace downstream orthoriv trueriv.sel # *' >! tmptrace.aml &sys sed 's/^ *[0-9]* */1,/' sources.gen | sed "s/1,END/[unquote '']/" >> tmptrace.aml /* next line added 11/19/96 &sys echo 9,0,0 >> tmptrace.aml &sys echo readselect trueriv.sel >> tmptrace.aml &sys /usr/bin/rm trueriv.sel renode orthoriv /* this is essential ARCEDIT ec orthoriv ef arc sel all /* this line added 11/19/96 arcplot tmptrace.aml selectget nsel delete sel all unsplit none save quit build orthoriv arc GRID setwindow goodgrid ;setcell goodgrid thinrivs = linegrid(orthoriv) spoofy = con(isnull(thinrivs),goodgrid,rivdist - 1000000) &if [exist flowdir -grid] &then kill flowdir flowdir = flowdirection(spoofy) /* allflows = streamline(flowdir,flowdir) /* diagnostic flowacc = flowaccumulation(flowdir) /* calcg = con(flowacc > 1000,1) /* rawrcov = streamline(calcg,flowdir) /* We have have two generated stream covers: /* orthoriv: a straightening of wholerivs /* calcg: based on flowaccumulation /* What's the arcinfo equivalent of diff? /* mainrcov = streamline(rgrid,flowdir) /* arcedit /* FIND the arcs that are no coincident. /* INTERSECT and eliminate short dangles /* FIND dangles, use near to establish a path to river. /*