From jweir@unlinfo.unl.eduFri May 24 15:55:46 1996 Date: Fri, 24 May 1996 11:45:45 -0500 (CDT) From: jim weir To: esri-l@esri.com Subject: ESRI: SUM - Smooth elevation shadeset Resent-From: esri-l-request@esri.com Resent-Date: Fri, 24 May 1996 11:45:45 -0500 (CDT) sorry - I forgot the color ramps that several people wanted to see. This is the revised version. ARRGHHH!!! Back on May 2d I asked: I have a nice DEM that I have converted to a grid. NOW the user wants a color rendition rather than a grey scale to show the elevation. My experiments produce distinct 'bands' of color, rather than that nice, smooth transition shown in commercial maps. Has any one created a SHADCOLORRAMP or a shadeset that could simulate the display of elevations as a smooth transition from 'green is low' to 'white is high' (like National Geographic does it) I would like to have about 256 shades for use with GRIDSHADES. Thanks to: Glenn Hyman suggesting shadeset rainbow as a start Michael E Wieczorek suggested the remap option in gridshades Sam Adams provided a 5 step ramp , color shaded relief aml j borgione suggested using the IDW function in grid Mark R. Graves provided a 7 step ramp, colorshaded relief aml. MARK KALITOWSKI suggested a 3 step ramp Rusty Dodson another 3 step ramp Sorry about the delay in replying. As usual, testing takes time, and new projects take precedence over testing. Solutions: I was trying to do the ramping in a single stage - pick the right green and the right white and get this perfect rainbow to match the output of the 'National Geographic.' Silly me! The solutions were to use several ramps, controlling the flow of the colors. Suggested ramps: (all suggested experimenting with the # of steps in the ramp, based on the data) These are written as an aml to be run in GRID or ARCPLOT. /* a three-step set of ramps shadetype color shadedelete all shadecolorramp 1 100 forestgreen yellow nonlinear shadecolorramp 100 100 yellow tan nonlinear shadecolorramp 200 55 tan khaki nonlinear /* alternate colors in a three stage /* shadecolorramp 1 100 forestgreen gold /* shadecolorramp 101 100 gold saddlebrown /* shadecolorramp 201 55 saddlebrown white shadecolor "white" shadeput 256 shadecolor "blue" shadeput 257 /* a 5-step set of ramps shadetype color shadedelete all shadecolorramp 1 50 green yellow nonlinear shadecolorramp 51 50 yellow orange nonlinear shadecolorramp 101 50 orange red nonlinear shadecolorramp 151 50 red violet nonlinear shadecolorramp 201 50 violet khaki nonlinear &return /* a 7-step set of ramps shadetype color shadedelete all shadecolorramp 1 22 turquoise darkolivegreen1 nonlinear shadecolorramp 23 27 darkolivegreen1 yellowgreen nonlinear shadecolorramp 50 72 yellowgreen khaki2 nonlinear shadecolorramp 122 19 khaki2 lightgoldenrod nonlinear shadecolorramp 141 55 lightgoldenrod goldenrod nonlinear shadecolorramp 196 35 goldenrod darkgoldenrod nonlinear shadecolorramp 231 24 darkgoldenrod goldenrod4 nonlinear shadecolor "white" shadeput 256 shadecolor "blue" shadeput 257 &return I wrote a simple aml to test each ramp against my elevation grid. /* colorramp testing with simple ramp# file. /* needs name of ramp for 255 colors example: ramp5.aml with 5 ramps &args ramp arcplot mape dkb200:[library]outline <--- my state cover shadedelete all &r %ramp% shadecolor "white" shadeput 256 shadecolor "blue" shadeput 257 pagesize 33 25.5 weeddraw off display 1040 elev%ramp% box 0 0 33 25.5 mappos cen cen mapunits meters mapscale 1000000 gridnodatasymbol 256 gridshades slice <--- or any other grid out there. linesymbol 5 arcs dkb200:[library]outline annotext dkb200:[library]outline 1 annotext dkb200:[library]outline 3 linesymbol 4 arcs dkb200:[library]simpstreams <--- other nebraska covers for mapping reselect dkb200:[library]lakes poly area lt 99999999 <--- put in your own polygonshades DKB200:[LIBRARY]lakes 257 <-- mapping stuff here linesymbol 1 textfont palacio textquality proportional textsize .75 move 16.5 23 text 'Simplified Color-shaded Elevation Coverage' cc move 16.5 22 textsize .5 text 'Developed using USGS DEM & ESRI-L assistance by Jim Weir, CSD-UNL, 1996' cc q Additionally, several individuals shared their thoughts (and AMLs) to apply the HSV model to create a colored, shaded relief map. I wasn't going that far, but the USER had this great idea - 'how about a colored, shaded relief map!' /* suggested by Sam Adams /* program biashade, from documentation faxed to me from Sam. /* It is derived from a BIA technical note. /* &ARGS elevgrid &if [SHOW PROGRAM] <> GRID &then &return This AML must be run in the GRID module! &if [null %elevgrid%] &then &goto usage &if ^ [exists %elevgrid% -GRID] &then &return No GRID named %elevgrid% exists in this workspace! mapextent %elevgrid% &if [exists tempelev -grid] &then kill tempelev all &if [exists colorhue -grid] &then kill colorhue all &if [exists colorsat -grid] &then kill colorsat all &if [exists colorval -grid] &then kill colorval all &if [exists tempshade3 -grid] &then kill tempshade3 all &if [exists slice -grid] &then kill slice all tempelev = int ( %elevgrid% ) slice = slice( tempelev, eqinterval, 255 ) kill tempelev all shadetype color shadecolorramp 1 50 green yellow shadecolorramp 51 50 yellow orange shadecolorramp 101 50 orange red shadecolorramp 151 50 red violet shadecolorramp 201 54 violet khaki gridshades slice &if [exists elevcol.cmp -file] &then &sys delete elevcol.cmp.* savecolormap elevcol.cmp hue_tmp = color2hue( slice, elevcol.cmp) colorhue = con (isnull (hue_tmp), 0, hue_tmp) sat_tmp = color2sat( slice, elevcol.cmp) colorsat = con (isnull (sat_tmp), 0, sat_tmp) val_tmp = color2val( slice, elevcol.cmp) colorval = con (isnull (val_tmp), 100, val_tmp) kill hue_tmp all kill sat_tmp all kill val_tmp all gridcomposite hsv colorhue colorsat colorval tempshade1 = hillshade( slice, #, #, #, 3) tempshade2 = slice ( tempshade1, eqinterval, 100 ) kill tempshade1 all tempshade3 = con (isnull (tempshade2), 100, tempshade2) kill tempshade2 all gridcomposite hsv colorhue colorsat tempshade3 &return /* /* Display usage /* &label usage &type Usage: biashade &return This was the 7-color ramp with shaded relief provided by Mark Graves /* /* NAME: colorrelief.aml /* /* PURPOSE: Creates an automatic shaded relief view of /* a DEM lattice. /* /* AUTHOR: Mark R. Graves and Jerrell R. Ballard /* US Army Engineer Waterways Experiment Station /* Environmental Laboratory /* 3909 Halls Ferry Road (WESEN-C) /* Vicksburg, MS 39180 /* (601)634-2557 /* /* DATE: 3/95 Original Coding (Jerrell Ballard) /* 2/96 User interface modifications /* (Added Error Checking) /* /********************************************************* &ARGS elevgrid &if [SHOW PROGRAM] <> GRID &then &return This AML must be run in the GRID module! &if [null %elevgrid%] &then &goto usage &if ^ [exists %elevgrid% -GRID] &then &return No GRID named %elevgrid% exists in this workspace! mapextent %elevgrid% &if [exists tempelev -grid] &then kill tempelev all &if [exists colorhue -grid] &then kill colorhue all &if [exists colorsat -grid] &then kill colorsat all &if [exists tempshd -grid] &then kill tempshd all &if [exists shade2 -grid] &then kill shade2 all &if [exists slice -grid] &then kill slice all tempelev = int ( %elevgrid% * 3.28084 ) /*slice = slice( tempelev, eqarea, 110, 1 ) slice = slice( tempelev, eqinterval, 255 ) shadetype color shadeset colorrange /* he provided a 100 color set of ramps /*shadecolorramp 1 8 turquoise darkolivegreen1 /*shadecolorramp 9 11 darkolivegreen1 yellowgreen /*shadecolorramp 20 29 yellowgreen khaki2 /*shadecolorramp 49 6 khaki2 lightgoldenrod /*shadecolorramp 55 22 lightgoldenrod goldenrod /*shadecolorramp 77 14 goldenrod darkgoldenrod /*shadecolorramp 91 20 darkgoldenrod goldenrod4 /* I modified the ratio to get 255 colors /* here is where it needed experimentation! shadecolorramp 1 36 turquoise darkolivegreen1 shadecolorramp 37 36 darkolivegreen1 yellowgreen shadecolorramp 73 36 yellowgreen khaki2 shadecolorramp 109 36 khaki2 lightgoldenrod shadecolorramp 145 36 lightgoldenrod goldenrod shadecolorramp 181 36 goldenrod darkgoldenrod shadecolorramp 217 38 darkgoldenrod goldenrod4 colorhue = color2hue( slice ) colorsat = color2sat( slice ) tempshd = hillshade( slice, #, #, #, 3 ) shade2 = slice ( tempshd, eqinterval, 100 ) gridcomposite hsv colorhue colorsat shade2 &type gridcomposite hsv colorhue colorsat shade2 &return &end /* /* Display usage /* &label usage &type Usage: colorrelief &return  -- Jim Weir, Computing Supervisor Conservation & Survey Division University of Nebraska-Lincoln Lincoln NE 68588-0517 402-472-7557 FAX 402-472-2410 jweir@unlinfo.unl.edu