Select to view content in your preferred language

Can I duplicate the color scheme of my old AML for a shaded elevation relief?

535
3
10-31-2018 11:22 AM
PaulHuffman
Occasional Contributor III

My agency is still using the old elevation shaded reliefs that I generated on a Sun Workstation using AML. (bottom data frame) The problem is how do I match this appearance when I get new data, or need to patch old DEM data?  ArcMap >10.3 gives you Elevation 1 and Elevation 2 and both are hideous. The closest I can find is using Pink to YellowGreen, Diverging, Dark,  set at 40% transparency on the DEM raster,  over a hillshade raster of the same DEM. (Top data frame). https://www.dropbox.com/s/jphr9f73xvl7snm/reliefcompare.PNG?dl=0

I found the old aml that produced the color scheme.  It produced a recode grid of elevation called slice based on the lookup table elev.lut, a hillshade called hill, an illumination grid called illum,  then combined them into color separates based on the color lookup table color.lut  that were later combined in a stack. Maybe if I can decode the rgb color codes in color.lut,  I could use them to symbolize a elevation reclass raster, reclassified based on the elevation breaks in the elev.lut,  then put that at 40% over a hillshade .

elev.lut

-10000 0000 :  1
0000 0250 :  2
0250 0500 :  3
0500 1000 :  4
1000 1500 :  5
1500 2000 :  6
2000 2500 :  7
2500 3000 :  8
3000 3500 :  9
3500 4000 :  10
4000 4500 :  11
4500 5000 :  12
5000 5500 :  13
5500 6000 :  14
6000 6500 :  15
6500 7000 :  16
7000 7500 :  17
7500 8000 :  18
8000 8500 :  19
8500 9000 :  20
9000 9500 :  21
9500 10000 :  22
10000 20000 : 23

color.lut

1 8 129 242
2 113 153 89
3 117 170 101
4 149 190 113
5 178 214 117
6 202 226 149
7 222 238 161
8 242 238 161
9 238 222 153
10 242 206 133
11 234 182 129
12 218 157 121
13 194 141 125
14 214 157 145
15 226 174 165
16 222 186 182
17 238 198 210
18 255 206 226
19 250 218 234
20 255 222 230
21 255 230 242
22 255 242 255
23 255 255 255

Relief.aml

&args elev_map
grid
mapex %elev_map%

/* kill slice all
/* kill hill all
/* kill red all
/* kill green all
/* kill blue all
/* kill illum all

slice = reclass(%elev_map% * 3.28089,elev.lut)
hill = hillshade(%elev_map%,345,45,#,5.0)
illum = float(hill) / 255

red = int(con(isnull(color2red(slice,color.lut,nowrap) * illum),255,(color2red(slice,color.lut,nowrap) * illum)))

green = int(con(isnull(color2green(slice,color.lut,nowrap) * illum),255,(color2green(slice,color.lut,nowrap) * illum)))

blue = int(con(isnull(color2blue(slice,color.lut,nowrap) * illum),255,(color2blue(slice,color.lut,nowrap) * illum)))
&echo &off
q
&return
0 Kudos
3 Replies
PaulHuffman
Occasional Contributor III

I wonder if there is a hack to edit the color.lut file into a .lyr or a .avl file that could be imported into the symbology definition of a elevation reclass raster.

0 Kudos
DanPatterson_Retired
MVP Emeritus

clr…. lut… same? looks like it, but not to lyr directly

Colormap function—ArcGIS Pro | ArcGIS Desktop 

0 Kudos
PaulHuffman
Occasional Contributor III

I got something like this to work from the ArcMap python window to make the reclass raster, the one called slice in the aml.  Now if I can get the colors mapped in from the color.lut,  I guess I can save it as a layer file so the others in my team can import the colors into their symbology window.  I could define the colors by the rgb codes in my symbology window manually, but it would be more fun to use the text file color.lut.

# Name: reclass.py
# Description: Reclassify elevation DEM by values used
# in relief.aml in elev.lut, converted to DOS file elev.txt

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "G:\elevation\elevationwash100.mdb"

# Set local variables
inRaster = "wash_dem"
inRemapTable = "G:\elevation\midcolum\elev.txt"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute Reclassify
outRaster = ReclassByASCIIFile(inRaster, inRemapTable)

# Save the output 
outRaster.save("wash_demreclass")
0 Kudos