/* srgeol.aml /* macro to make a HSV grids for simple /* geology-on-shaded-relief map. /* Ralph Haugerud, U.S. Geological Survey /* rhaugerud@usgs.gov /* April 1998 /* to be run from ARC /* /* inputs are /* GCov geology (polygon) coverage /* ZGrid coextensive DEM /* SymFile text file specifying symbolization /* (hue, saturation, pattern#, and tag) /* for polygons in GCov /* map rootname of output files /* UNITITEM name of GCOV.PAT ITEM that identifies /* polygon type (geologic unit) /* MAKE SURE THAT DEFINITION ON LINE 56 /* IS ADEQUATE (=long enough) /* azim sun azimuth for calculating hillshade /* inclin angle of sun above horizon, for calculating hillshade /*********EDIT NEXT 5 LINES TO SUIT**************** &set GCov = tzgcov &set ZGrid = tz &set SymFile = TZGCOV.UNITS &set map = tz &set UNITITEM = XUNIT &set azim = 45 &set inclin = 45 &DESCRIBE %ZGrid% &set cellsize = %GRD$DX% &set map = [translate %map%] &set OldDisplay = [SHOW DISPLAY] DISPLAY 0 &call SymInfo &call SymRelate &if not [exist %map%v -grid] &then &call MakeVGrid &if not [exist %map%h -grid] &then &call MakeHGrid &if not [exist %map%s -grid] &then &call MakeSGrid DISPLAY %OldDisplay% &return /******************** &routine SymInfo &s Symfile = [pathname %SymFile%] &data ARC INFO ARC SELECT %map%.SYM DELETE %map%.SYM YES DEFINE %map%.SYM %UNITITEM%, 10, 10, C TAG, 10, 10 , C HUE, 3, 3, I SAT, 3, 3, I PATTERN, 3, 3, I UNITNAME, 100, 45, C ADD %UNITITEM%, TAG, HUE, SAT,PATTERN, UNITNAME FROM %SYMFile% Q STOP &end /* &data block &return &routine SymRelate relate add sym [pathname %map%.SYM -info] info %UNITITEM% %UNITITEM% linear RO [unquote ' '] &return &routine MakeVGrid GRID %map%shd = hillshade(%ZGrid%,%azim%, %inclin%, shade) &describe %map%shd xxg1 = (%map%shd - [Value GRD$MEAN]) * 15 / [value GRD$STDV] + 95 %map%v = con(xxg1 <= 70, 70, xxg1 <= 99, int(xxg1), 99) kill xxg1 all kill %map%shd all QUIT &return &routine MakeSGrid polygrid %GCov% %map%s1 sym//sat %CellSize% /* set cellsize to match DEM YES /* convert whole coverage GRID setwindow %map%v %map%v %map%s = con(isnull(%map%s1), 0, %map%s1) kill %map%s1 all QUIT &return &routine MakeHGrid polygrid %GCov% %map%h1 sym//hue %CellSize% /* set cellsize to match DEM YES /* convert whole coverage GRID setwindow %map%v %map%v %map%h = con(isnull(%map%h1), 0, %map%h1) kill %map%h1 all QUIT &return &return