Golden Software Blog

Helping you learn more about the latest product information, tips, tricks, techniques, and customer stories so you can visualize data and communicate results with ease.

Create Aspect-Slope Maps in Seconds Using Surfer

My last blog article described how to create a slope map from a digital elevation model in Surfer. Moving forward on that topic, I found this blog article written for ArcMap on creating aspect-slope maps, which was improved upon for QGIS. This single map combines both the compass direction of slopes (aspect) and the steepness of the slopes (in degrees) and uses both color and saturation to display the combined results. Slopes facing different directions use different colors, and the brightness of that color shows the steepness of that slope (the brighter the color, the steeper the slope). I thought this was a really interesting map type and it made me wonder how this could be done in Surfer.

Coincidentally, at that time, a user asked me this exact question! The user wanted to come up with a way to see the very small slope variations in the soft sediments they have on the surface, using both aspect and slope. Looking at the slopes and aspect together may reveal small variations that otherwise could be overlooked.

Surfer 2D & 3D Mapping Software: Aspect-slope maps Create aspect-slope maps to get an idea for both the direction
of slope and the amount of slope in one view.

Before we delve into the steps on how to create this type of map, I want to go over a little background on what the colors represent.

Background

To create an aspect-slope map in Surfer, all you need to start with is a grid, DEM, or DTM file. Using the method described in the QGIS article, the idea is to create a grid of slopes (in %) and create grid of aspect directions. Reclassify the slope grid into bins from 0 to 8 in steps of 2, and reclassify the aspect grids into bins from 10 to 80 in steps of 10.

Original Slope% Z Value New Z Value
>=0.0 and <5.0 0
>=5.0 and <15.0 2
>=15.0 and <30.0 4
>=30.0 and <45.0 6
>=45.0 8

 

Original Aspect Z Value New Z Value
>=0 and <22.5 10
>=22.5 and <67.5 20
>=67.5 and <112.5 30
>=112.5 and < 157.5 40
>=157.5 and <202.5 50
>=202.5 and <247.5 60
>=247.5 and <292.5 70
>=292.5 and <337.5 80
>=337.5 and <360.5 10

Reclassify the slope (%) and aspect grid files so that the slope values are even numbers from 0 to 8, and the aspect values are ten values from 10 to 80.

Combine the reclassified grids by adding them together to create a single aspect-slope grid. For the combined grid, the values can range anywhere from 10 to 88­, which is the minimum of the slope plus the minimum of aspect (10+0) and the maximum of the slope plus the maximum of the aspect (80+8). The first digit in the number in the ten’s place is the aspect orientation, and the second digit in the one’s place is the slope.  For example, a value of 24 in the combined grid indicate a slope in the direction between 22.5° and 67.5° azimuth (since the first digit is 2), and the slope would be between 15% and 30% (since the second digit is 4).

We will then create a map and color it based on this combined value. The actual color is based on the aspect value (the first digit in the ten’s place) and the brightness of that color based on the slope value (the second digit in the one’s place). Since any value that has a 0 in the one’s place (e.g. 10, 20, 30, etc.) is relatively flat (a slope between 0-5°), we can assign it a flat gray color that we can make completely transparent. For the other colors, we can use colors based on a wheel like the image below. For example, a value of 24 in the combined grid would be assigned a medium green color.

Color wheel for aspect-slope mapsThis color wheel was selected from the ArcMap article. The color around the wheel is based on the aspect (slope direction), and is identified by the first digit in the 10’s place of the Z values in the combined grid. The brightness of that color is based on the slope itself, identified by the second digit in the 1’s place of the Z values in the combined grid.

Performing the steps manually is not very difficult, but they do take some time. I decided to shorten this workflow significantly by writing a script, compatible with Surfer 13. The manual process of walking through the steps only takes about 5 minutes, but the script takes only seconds and is wonderfully easy. I’ll provide instructions for both running the script and manually walking through the steps.

Steps to Create an Aspect-Slope Map using a Script

To run the script to create the aspect-slope map in seconds, follow these steps:

  1. Download the script Aspect-Slope.bas and the colormap file ColorWheel.clr .
  2. Open Scripter by clicking Windows Start | All Programs (or All apps) | Golden Software Surfer 13 | Scripter.
  3. In Scripter, click File | Open, select Aspect-Slope.bas and click Open.
  4. Click Script | Run.
  5. Select the grid file you wish to use (such as Diablo.grd from the Surfer Samples folder) and click Open.
  6. Select the ColorWheel.clr color file and click Open. The script works to completion.

That’s it! Surfer is opened and the map is created with the appropriate values and colors. Even with a large grid file, this takes only seconds on my computer.

Surfer 2D & 3D Mapping Software: Aspect slope map creationRun the Aspect-Slope.bas script to create an aspect-slope map from any grid in just a few seconds.

Steps to Create an Aspect-Slope Map Manually

If you want to work through this manually, the equivalent steps to perform in Surfer are as follows:

  1. Create the grid of slope values (in rise/run).
    1. Click Grid | Calculus.
    2. Select your grid file, such as Diablo.grd from the Surfer Samples folder, and click Open.
    3. In the Grid Calculus dialog, select Differential & Integral Operator | Gradient Operator.
    4. Click the Change Filename button to the right of Output Grid File, give the file a new name (e.g. Diablo_Slope.grd) and click Save.
    5. Click OK and the grid is created.
  2. Convert the slope grid in rise/run to percent slope.
    1. Click Grid | Math.
    2. In the Grid Math dialog, click the Add Grids button.
    3. Select Diablo_Slope.grd and click Open.
    4. Enter the function: A*100
    5. Click the Change Filename button to the right of Output Grid File, give the file a new name (e.g. Diablo_Slope_Percent.grd) and click Save.
    6. Click OK and the grid is created.
  3. Reclassify the slope grid file using Grid Math.
    1. Click Grid | Math.
    2. In the Grid Math dialog, click the Add Grids button.
    3. Select Diablo_Slope_Percent.grd and click Open.
    4. Enter the function:  IF (A>=45, 8, IF (A>=30.0 AND A<45, 6, IF (A>=15 AND A<30, 4, IF (A>=5 AND A<15,2, IF(A>=0 AND A<5, 0, A)))))
    5. Click the Change Filename button to the right of Output Grid File, give the file a new name (e.g. Diablo_Slope_Percent_Reclass.grd) and click Save.
    6. Click OK and the grid is created.
  4. Create the grid of aspect values.
    1. Click Grid | Calculus.
    2. Select your grid file, such as Diablo.grd from the Surfer Samples folder, and click Open.
    3. In the Grid Calculus dialog, select Terrain Modeling | Terrain Aspect.
    4. Click the Change Filename button to the right of Output Grid File, give the file a new name (e.g. Diablo_Aspect.grd) and click Save.
    5. Click OK and the grid is created.
  5. Reclassify the aspect grid file using Grid Math.
    1. Click Grid | Math.
    2. In the Grid Math dialog, click the Add Grids button.
    3. Select Diablo_Aspect.grd and click Open.
    4. Enter the function:  IF (A>=337.5 OR A<22.5, 10, IF (A>=22.5 AND A<67.5, 20, IF (A>=67.5 AND A<112.5, 30, IF (A>=112.5 AND A<157.5,40, IF(A>=157.5 AND A<202.5,50, IF(A>=202.5 AND A<247.5,60, IF(A>=247.5 AND A<292.5,70, IF(A>=292.5 AND A<337.5, 80, A))))))))
    5. Click the Change Filename button to the right of Output Grid File, give the file a new name (e.g. Diablo_Aspect_Reclass.grd) and click Save.
    6. Click OK and the grid is created.
  6. Add the reclassified slope and aspect maps together, also using Grid Math.
    1. Click Grid | Math.
    2. In the Grid Math dialog, click the Add Grids button.
    3. Select both Diablo_Slope_Percent_Reclass.grd and Diablo_Aspect_Reclass.grd and click Open.
    4. Enter the function:  A+B
    5. Click the Change Filename button to the right of Output Grid File, give the file a new name (e.g. Diablo_AspectSlope.grd) and click Save.
    6. Click OK and the grid is created.
  7. Create the map and color it using the colors defined above.
    1. Click Map | New | Image Map, select Diablo_AspectSlope.grd and click Open.
    2. Select the Image layer in the Object Manager, and click the General page in the Property Manager.
    3. Under the Hill Shading section, uncheck Enable hill shading.
    4. Under the General section,
      1. Uncheck Interpolate pixels.
      2. Click the Custom colormap (…) button to the right of Colors.
      3. In the Colormap dialog, click Load, select ColorWheel.clr, and click Open.
      4. Click OK.
      5. Check Show color scale.
    5. Under the Missing Data section, set the Opacity to 0%.

Surfer 2D & 3D Mapping Software: Aspect slope map created in SurferCreate aspect-slope maps in the Surfer user interface.

Capturing both slope and aspect in a single map is an excellent way to identify large and small scale trends in a map. You have tremendous flexibility in Surfer. You can adjust the classifications if you wish, to emphasize certain slope or aspect ranges by adjusting the Grid Math functions, or you can choose to make the flat areas solid gray instead of transparent by setting the Opacity in the Colormap dialog to 100%. There are many options you can choose from so that this map shows exactly what you need it to.

 

Comments 6

Guest - Brittany on Friday, 01 October 2021 16:28

Hi Sean - Thank you for reading our blog! The Image Map is now the Color Relief map and the Object Manager is the Contents window. Learn more about the Color Relief map here: http://surferhelp.goldensoftware.com/vec_shd_img/IDM_imagemap.htm?Highlight=color%20relief

If you have any additional questions, feel free to reach out to our support team at support@goldensoftware.com

Thanks!
Brittany
Golden Software

Hi Sean - Thank you for reading our blog! The Image Map is now the Color Relief map and the Object Manager is the Contents window. Learn more about the Color Relief map here: http://surferhelp.goldensoftware.com/vec_shd_img/IDM_imagemap.htm?Highlight=color%20relief If you have any additional questions, feel free to reach out to our support team at support@goldensoftware.com Thanks! Brittany Golden Software
Guest - Kari Dickenson on Thursday, 30 September 2021 16:47

Hi Sean,

The "image" map was renamed to "color relief", and we replaced the menus with a ribbon.

So for Step 7.1, click Home | New Map | Color Relief. And for Step 7.2, select the Color Relief layer in the Contents window.

Thanks!
Kari

Hi Sean, The "image" map was renamed to "color relief", and we replaced the menus with a ribbon. So for Step 7.1, click [b]Home | New Map | Color Relief[/b]. And for Step 7.2, select the [i]Color Relief[/i] layer in the [b]Contents[/b] window. Thanks! Kari
Guest - Sean Berry on Thursday, 30 September 2021 17:23

Hi again Kari, could you email me the ColourWheel.clr file ... won't let me download!
sean.berry@soilandrock.co.nz

Hi again Kari, could you email me the ColourWheel.clr file ... won't let me download! sean.berry@soilandrock.co.nz
Guest - Kari on Friday, 01 October 2021 08:42

Hi Sean,

Yes, I emailed it to you and also sent a note to our web administrator to update the link in the blog.

Thanks!
Kari

Hi Sean, Yes, I emailed it to you and also sent a note to our web administrator to update the link in the blog. Thanks! Kari
Guest - Sean Berry on Thursday, 30 September 2021 16:57

Thanks Kari ?

Thanks Kari ?
Guest - Sean Berry on Thursday, 30 September 2021 16:36

How do you do this in v20? Falling down at Step 7 ...

How do you do this in v20? Falling down at Step 7 ...
Guest
Monday, 25 October 2021

Captcha Image

By accepting you will be accessing a service provided by a third-party external to https://www.goldensoftware.com/

Subscribe To Our Blog

Most Popular

Over the years, one of the most common questions asked is “How can I get my contour map out of Surfe...
Creating a map of slopes is common practice when looking at slope stability. Some examples of when y...
I'm pleased to introduce our first ever guest blogger, Scott Carter, Owner and Creative Director of ...

Exceeding expectations

Our customers

Go to top