Cartographer's Toolkit

Map Making Tips, Tricks, and Inspiration

Creating an Aspect-slope Map in GeoServer

June 22nd, 2016

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:

aspect_slope_visual

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:

 

aspect_slope_palette

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.

————-

 

Comments

4 Comments

RSS
  • Andrea Aime says on: June 22, 2016 at 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

  • Ian Turton says on: June 22, 2016 at 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)

  • G.P. says on: June 22, 2016 at 8:36 am

     

    Thanks Andrea.

  • G.P. says on: June 22, 2016 at 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.

Cartographer's Toolkit

Map Making Tips, Tricks, and Inspiration