An aspect-slope map (sometimes called a slope-aspect map) is an overlay of a semi-transparent slope map on top of an aspect map that is styled with a unique hue for every 45 degrees of slope direction. To put it visually:
To do this in GeoServer, you need slope and aspect raster datasets in degrees. Create an SLD for each with the following syntax (I’m not including the whole SLDs here for brevity).
SLOPE SLD
<sld:ColorMapEntry color=”#999999″ opacity=”1″ quantity=”10″/>
<sld:ColorMapEntry color=”#999999″ opacity=”.66″ quantity=”20″/>
<sld:ColorMapEntry color=”#999999″ opacity=”.33″ quantity=”30″/>
<sld:ColorMapEntry color=”#999999″ opacity=”0″ quantity=”90″/>
Here we have a gray color being used to denote very flat areas where the slope is less than 10. The gray is increasingly transparent as the slope becomes steeper, thus revealing the underlying aspect layer with more brightness in the steepest locations. These parameters could be tweaked to allow more or less brightness to show through.
ASPECT SLD
<ColorMapEntry color=”#9AFB0C” quantity=”22.5″ />
<ColorMapEntry color=”#00AD43″ quantity=”67.5″ />
<ColorMapEntry color=”#0068C0″ quantity=”112.5″ />
<ColorMapEntry color=”#6C00A3″ quantity=”157.5″ />
<ColorMapEntry color=”#CA009C” quantity=”202.5″ />
<ColorMapEntry color=”#FF5568″ quantity=”247.5″ />
<ColorMapEntry color=”#FFAB47″ quantity=”292.5″ />
<ColorMapEntry color=”#F4FA00″ quantity=”337.5″ />
<ColorMapEntry color=”#9AFB0C” quantity=”360″ />
The colors and class breaks are from this Esri/Buckley blog entry which, in turn, references the color scheme from Moellering and Kimerling’s MKS-ASPECT (GIS world 1991). The colors, in order, are shown here:
PUTTING THE LAYERS TOGETHER
Using a two-layer syntax in the wms request mashes the two layers together. List the aspect layer first and the slope second. I had it switched around on my first try and it took me a bit of time to realize that it draws that second referenced layer on top. And no, the finished map does not have a hillshade underneath. The combination of aspect and slope creates that “hillshade” effect.
————-
Creating an aspect-slope map in GeoServer. https://t.co/JdAzVolWfE pic.twitter.com/dgWJPmuoTA
— Gretchen Peterson (@PetersonGIS) June 22, 2016
@PetersonGIS @cirquelar I'm ignorant of specifics, but a google search confirmed that GeoServer is OpenSource software.
— Carl Trachte (@infixum) June 22, 2016
@PetersonGIS sounds like bump mapping. Is it? pic.twitter.com/1mUqIdqsxq
— andest01 (@andest01) June 22, 2016
@PetersonGIS another might be a "normal buffer". Advantage is that it's trivial to implement in 3D graphics for acceleration.
— andest01 (@andest01) June 22, 2016
@PetersonGIS opps, forgot pic 😓 pic.twitter.com/cUXvqxoF4u
— andest01 (@andest01) June 22, 2016
@PetersonGIS Enjoyed your blog post, though I'm not familiar with the acronym SLD. Color classes in Geoserver? Worth defining in post.
— Mapperwocky (@cirquelar) June 22, 2016
#1 by Andrea Aime on June 22, 2016 - 8:11 am
Hi Gretchen, for this case you could also try the map compositing options that are available since GeoServer 2.8.0:
http://docs.geoserver.org/stable/en/user/styling/sld-extensions/composite-blend/index.html
Using “multiply” compositing should make for a less washed out result, e.g.:
http://geoserver.geo-solutions.it/edu/en/pretty_maps/styling_raster.html
#2 by Ian Turton on June 22, 2016 - 8:34 am
You could also create a layer group to allow people to request just one layer (and always get them in the right order)
#3 by G.P. on June 22, 2016 - 8:36 am
Thanks Andrea.
#4 by G.P. on June 22, 2016 - 8:38 am
Thanks for the comment, Ian. I should have mentioned in the blog that while that’s the go-to method for combining layers, in this case I’m not the major person making changes to this geoserver so I prefer not to add layer groups and go with the dynamic route instead.