/* Program: GIRASNEAT.AML /* Usage: GIRASNEAT ~ /* {neatline_cover} {dissolve_item} {SNAP | NOSNAP} /* /* Purpose: Standardize processing of land use/cover theme following the /* use of GIRASARC2.AML. GIRASNEAT clips in_cover with neatline_cover; /* dissolves polygon boundaries between polygons having the same dissolve_item /* value (if this option is specified); /* and optionally snaps exterior arcs and those that intersect them to the /* arcs of neatline_cover (using a snapping tolerance of 40 meters). /* /*------------------------------------------------------------------------ /* Platform: DG Aviion (Unix workstation) /* System Dependencies: /* System dependent settings are stored in variables near the beginning /* of the code. By modifying those settings, this program may be ported /* to other systems or platforms. /* /* The system dependent settings involve the following: /* 1. system commands to concatenate and copy system files; /* 2. system path name delimiter character. /* /*------------------------------------------------------------------------ /* /* Arguments: /* name of input cover of land use/cover polygons; this /* cover should have been the output cover produced by the /* GIRASARC2.AML program. /* /* name of cover to be created by GIRASNEAT. /* /* {neatline_cover} polygon cover with which will be clipped, and /* which will serve as the snapcover if SNAP option is used. /* Default is NL (produced by GIRASARC2.AML). /* /* {dissolve_item} the item in the .PAT used by DISSOLVE (see /* Arc/Info Users Guide for further discussion). Default /* is to not perform any dissolve operation. /* /* {SNAP | NOSNAP} controls whether exterior and connected arcs from in_cover /* will be snapped to arcs in neatline_cover. Default is to /* perform snapping. /*------------------------------------------------------------------------ /* History: /* Rev.0.1 RBZELT USGS-WRD, 02/11/92, Original coding. /* Rev.0.1.1 RBZELT USGS-WRD, 03/03/92, Cosmetic fix in log appearance; /* added termination when polygon /* topology cannot be created for /* neatline_cover. /* Rev.0.2 RBZELT USGS-WRD, 04/06/92, Added dissolve_item argument. /* Rev.0.3 DDNEBERT USGS-WRD, 04/02/93 Moved to 6.1.1 UNIX /*======================================================================== &ARGS incov outcov neatcov disitm snapopt &if [null %outcov%] &then &goto usage &if [null %neatcov%] &then &s neatcov # &if [quote %neatcov%] = '#' &then &s neatcov %incov%NL &if [null %disitm%] &then &s disitm # &if [null %snapopt%] &then &s snapopt # &if [quote %snapopt%] = '#' &then &s snapopt SNAP /* Check validity of arguments: /* &if [keyword %snapopt% SNAP NOSNAP] le 0 &then &goto usage &if not [exists %incov% -poly] &then &do &ty Coverage %incov% is not a polygon coverage. &goto usage &end &if not [exists %neatcov% -coverage] &then &do &ty Neatline_cover %neatcov% does not exist. &goto usage &end &if [quote %disitm%] ne '#' &then &do &if not [iteminfo %incov% -poly %disitm% -exists] &then &do &ty Dissolve_item %disitm% not found in %incov%.PAT &goto usage &end &end &if [exists %outcov% -coverage] &then &do &ty Output_cover %outcov% already exists. &goto usage &end /* Housekeeping section &s home [show workspace] &s mess_off = [unquote '&off &all'] /* toggle messages for debugging /*&s mess_off = &on /* ******* system-dependent settings follow ****************** &s d / /* pathname delimiter /* store system commands to insert log from xxcov into log of : &s com1 [unquote [locase [quote cat %outcov%%d%log >> %home%%d%xxcov%d%log]]] &s comr [unquote [locase [quote rm %outcov%%d%log]]] &s com2 [unquote [locase [quote cp %home%%d%xxcov%d%log %outcov%%d%log]]] /* ************************************************************ /* Version number &ty \'[GIRASNEAT Ver. 0.3 for Arc 6.1.1 UNIX -- 4/02/93]' \ &mess %mess_off% &if [exists xxcov -coverage] &then kill xxcov /* If {neatline_cover} is not a polygon cover, then make it so. &if not [exists %neatcov% -poly] &then &do build %neatcov% &if not [exists %neatcov% -poly] &then &return &warning~ Cannot create polygon topology for %neatcov% &end /* Now, to clean up "overshooting polygons" that extend beyond the true /* quadrangle boundary, clip them with the neatline_cover. &ty Clipping to quadrangle neatline clip %incov% %neatcov% xxcov poly 1 /* Dissolve those sectional boundaries, if option selected &if [quote %disitm%] eq '#' &then ~ copy xxcov %outcov% &else &do &ty Dissolving sectional boundaries dissolve xxcov %outcov% %disitm% poly &end /* insert log file from xxcov into log file of out_cover &sys %com1% &sys %comr% &sys %com2% /* If SNAP option selected, then snap exterior and connected arcs of out_cov /* to arcs of neat_cov /* &if [keyword %snapopt% SNAP NOSNAP] = 1 &then &do &if not [exists %outcov% -line] &then~ build %outcov% line /* So that arc attributes can be used to select the /* exterior arcs in out_cov. &s olddisp [show display] display 0 &ty Snapping exterior to quadrangle neatline arcedit EDITCOV %outcov% SNAPCOV %neatcov% SNAPFEAT ARC ARC SNAPPING CLOSEST 40 EDITFEAT ARC SEL LPOLY# = 1 OR RPOLY# = 1 /* select arcs that compose the external poly ASEL CONNECT /* also select arcs that intersect the external poly SNAP /* snap the selected arcs to the true neatline QUIT YES /* quit arcedit and save changes display %olddisp% /* The out_cover is ready to be re-built as a polygon cover. /* If build finds an intersection, use CLEAN with fuzzy_tolerance = 1. /* Commentout the BUILD command because it will hang. Ed at EPA &ty Running Build instead of Clean.... &severity &error &ignore build %outcov% poly &severity &error &fail &describe %outcov% /* Store cover info in reserved variables. &if %dsc$qedit% &then &do /* Check whether build was successful. &ty Unable to build coverage, running CLEAN instead... tolerance %outcov% fuzzy 1 clean %outcov% &end &end /* do when snap option selected &type Copying documentation from %incov%... &do ext &list DOC REF ATT NAR &if not [exists %outcov%.%ext% -info] &then copyinfo %incov%.%ext% %outcov%.%ext% &end &ty Cleaning up ... kill xxcov all &mess &on log %outcov% add GIRASNEAT %incov% %outcov% %neatcov% %disitm% %snapopt% [username] &return &label usage &ty Usage: GIRASNEAT {neatline_cover} {dissolve_item} {SNAP | NOSNAP} &return