&args cover boundgrid outgrid /* This grids a line nicely /* It oversamples by a factor of 5, then reselects those cells that /* have contain at least 5 subcells. /* This gives us a degree of thinning, and does it better than anyone else. /* It contains code pulled out of gridriv /* cover is a river coverage to be converted to a grid /* boundgrid is any grid used to establish window and cellsize /* This version captures intersections better. &type boundriv.aml Version 0.0 7/9/99 &type Harvey Greenberg, University of Washington hgreen@u.washington.edu &if [show program] ne 'GRID' &then &RETURN ERROR in gridnice.aml: This must be started from GRID &if ^ [exists %boundgrid% -grid] &then &RETURN ERROR in gridnice.aml: The grid %boundgrid% (argument 2) does not exist. &if [exists %outgrid% -grid] &then &RETURN ERROR in gridnice.aml: The grid %outgrid% (argument 3) already exists. &s tag [after [date -ftag] '.'] &describe %boundgrid% /* so we can determine the cell size setwindow %boundgrid% setcell [calc %grd$dx% / 5] /* temporarily work on a finer grid tmpgrd%tag% = ^ isnull(LINEGRID(%cover%)) tmpcnt%tag% = aggregate(tmpgrd%tag% ,5,sum,#,data) setcell maxof %outgrid% = con(tmpcnt%tag% ge 3,1) /* kill tmpgrd%tag% /* kill tmpcnt%tag% &type You have a thinnish river mask name %outgrid% &type Your grid window is [show setwindow]