Cost Path Analysis of Mars using SAGA

From CUOSGwiki
Jump to navigationJump to search


This tutorial aims to provide step-by-step instructions for completing cost-path analysis within SAGA. The basic analysis will use tools from the following built-in libraries: "Grid", "Shape" and "Terrain Analysis". A more advanced analysis will further explore tools within the Grid library. By the end, this tutorial will have shown you how to use SAGA’s built-in tools to perform a cost-path analysis using a Mars DTM and be exposed to more advanced techniques to enhance the basic cost-path analysis.



SAGA is an open source program for GIS that has a lot of capability in geoscientific analysis and has been designed for effective implementation of spatial algorithms. It features an extensive suite of tools covering raster data (called Grid data within SAGA) and operations, imagery processing, vector processing as well as some ecological and geomorphological simulations, to name a few. More information can be found at their homepage, and the latest version of the software can be downloaded from SourceForge. This tutorial uses SAGA v6.4.0.

To see more CUOSG tutorials that have used SAGA GIS, click here

Cost-Path Analysis

Cost-path Analysis is a GIS tool used for distance analysis and is primarily used for determining the most efficient route between two points. The strength of cost path analysis is its flexibility in modelling applications as it is only limited by what costs can be assigned to travel a distance. As a result, cost path analysis can be used in a variety of applications, and has been used to determine the best routes for power transmission lines, developing walking paths, determining ecological corridors for wildlife movement as well as modelling fire spread and flooding.

More details about cost path analysis can be found here.

Background and Data

This tutorial will explore the Northeast Syrtis region of Mars, which refers to the northeast area of Syrtis Planum Major quadrangle, which is a candidate landing spot for the Mars 2020 rover mission. As part of the preparation for the mission, stereo images of the potential landing site were taken by NASA’s Mars Reconnaissance Orbiter. The images were then used to create a digital terrain model (DTM), with the primary objective of being used in the rover mission’s Entry, Descent and Landing (EDL) simulations. The DTM of NE Syrtis (download here) is made available by the USGS Astrogeology Science Center.

For our analysis, we will be using the DTM as a base to determine a hypothetical path for the rover once it has landed.

A crucial element to note in this analysis is the type of coordinate system required. Any cost path analysis requires a projected coordinate system, which measures distance in units of distance (such as meters or feet), rather than a geographic coordinate system which uses angular units (degrees or radians). In this way, the analysis represents a cost associated with a consistent distance/area rather than angles, which vary in size as distance to the poles vary. Since we are using data from another planet, special attention must be given to the coordinate system. Fortunately, the DTM used in this example comes projected in an appropriate coordinate system and is ready for our analysis.


Basic Cost Path Analysis

Uploading Data into SAGA

The first step of the process is to download the DTM. The DTM of NE Syrtis comes in a TIFF (.tif) file format, which is a common file type for raster data in geospatial analysis. Once the file is downloaded, open the SAGA software. Start with an empty startup project.

To import the DTM, go to “File >> Grid >> Load” and navigate to where you stored the DTM. Click Open. The file might take a little while to load. Next, double click the file you just imported. A map should appear, and look like the image below.

Map with DTM imported.PNG

The presence of the scale bar with units in Kilometers indicates that we have a projection suitable projection. To check the details, navigate to the “Description” tab in the properties window, and check the Projection. It should say “EquirectangularMars”, with its parameters below.

Projection annoted.PNG

Now we’ll rename a few things to make the analysis process smoother. First we’ll rename the Grid System, the first entry under “Grids” in the data tab (1. in photo below). Under the “Settings” tab in the Properties window, click to the right of the “Name” field. I chose to rename it “Syrtis Grid System”. Next we’ll do the same for the DTM itself. Click on the DTM layer (2. in photo below), then repeat the above process. I named the DTM “Syrtis 20m DTM”.

Named grid and system annot.PNG

Now we’re ready to continue with the analysis.

Creating Points

To perform our cost-path analysis, we need to create a starting point and ending point for our path. To do so we will need to create two new vector layers.

To create a vector layer, we’ll use the geoprocessing tools. Navigate to “Geoprocessing >> Shapes >> Construction >> Create new “Shapes layer”. Check that the Shape Type is Points, then change the name to “Rover_start”. Click Okay.

Create point layer Rover start.PNG

Repeat the process to create the “Rover_end” layer.

Under the Data Tab in the Manager on the left, you should see the three elements we have so far. Double click each point shape to add it to the map. The map panel should look like the following.

Map with point shapes.PNG

Next we need to create the points on our map. To do so, click on the layer you want to edit in the Maps tab. Right click, go to “Edit >> Add Shape”. From the top menu bar, click on the arrow pointer, called the “Action Tool”.

Add points action tool.PNG

Next, left-click somewhere in the top half of the map; this will be our starting point. When you’re happy with the location, right-click and select “Edit Selection” and click “Yes” on the window that pops up. Repeat for the end point, this time placing the point near the bottom of the map. You should now have two points on your map.

Map start end points.PNG

We are now ready to move on to the Terrain Analysis portion of the analysis.

Terrain Analysis

This portion of the analysis turns our DTM into a set of derivative terrain products from which we will base our cost path analysis from. SAGA has a convenient tool that can calculate slope, aspect and curvature within a single window.

To create the terrain products, go to “Geoprocessing >> Terrain Analysis >> Morphometry >> Slope, Aspect, Curvature”. The inputs are “Syrtis Grid System” for the grid system and “Syrtis 20m DTM” for the elevation. To get our outputs, we need to select “<create>” on the following elements: “Slope”, “Aspect” and “Cross-Sectional Curvature”. We will also change the units for both Slope and Aspect to degrees.

Slope annot.PNG

When all the options have been correctly set, click Okay. The outputs can now be found in the Data tab of the Manager. Below is an image of the three outputs.

Slope aspect curve output side by side.PNG


We have created some terrain products, but they aren’t particularly meaningful for use in cost path analysis right away. We will be using the Slope layer as the basis of our analysis and we will reclassify some of the values to better represent the difficulty of crossing varied terrain. To start reclassifying, navigate to “Geoprocessing >> Grid >> Values >> Reclassify Grid Values”. In the tool menu, select the following inputs: “Syrtis Grid System” for the grid system, “Slope” for the grid. Next, we need to define the method for reclassifying the raster. Under Method, select “simple table”.

Reclass tool.PNG

On the next line below, click the three dots on the right-hand line of “Lookup Table”. This should open a new window. Add some lines and enter the values to look like the following photo.

Slope reclassed values.PNG

When happy with the values, click Okay on the Lookup Table window, then Okay on the tool. Below is a photo of the reclassified slope layer.

Slope map reclassed.PNG

The values selected for reclassification were arbitrarily determined and will be sufficient for this process. However, determining appropriate cost values, as will be discussed later, is one of the most difficult elements of cost path analysis.

Accumulation Cost

Now that we have created our terrain products and reclassified our slope data into something meaningful, we are ready to begin the cost-path analysis. The first step is to create an accumulation cost surface. Given a vector point (our destination point), this tool returns a surface that represents how “expensive” it is to travel away from the given input point. This will be the input for the final step of our least cost path analysis.

To create the accumulation cost surface, navigate to “Geoprocessing >> Grid >> Analysis >> Cost Analysis >> Accumulation Cost”. The inputs should be "Syrtis Grid System" for the grid system, "Slope_reclassified" for the local cost, and "Rover_end" as the destination point. Once this is done, click Okay. The output will show up on the “Data” tab labeled “Accumulated Cost”. Double click it to add it to the map.

Below is an image of the accumulation cost raster. It shows areas of low cost in blue (near the end point) and areas with increasing cost in red.

Accumulated cost with points.PNG

Now we move on to complete the last step in our analysis.

Least Cost Path

To complete our analysis and see the final product, we will finally run the Least Cost Path analysis tool. It can be found under “Geoprocessing >> Grid >> Analysis >> Cost Analysis >> Least Cost Path”

The inputs are “Syrtis Grid System” for the grid system and “Accumulated Cost” for the accumulated cost surface. The Source Points is our “Rover_start” point file. Click Okay when ready.

Under the “Data” tab, locate the “Profile Line [Accumulated Cost]” vector feature, and double click it to add it to the map. With the two points, the DTM and the profile line on the map, we now have the optimal path, based on the slope, that the rover could take between the start and end points.

Congratulations! You have now completed a basic least cost path analysis using DTM-derived terrain products. While this process was conducted using data from Mars, the procedure outlined above can be applied to any DTM or DEM.

Final map with least cost line.PNG

The next section will elaborate on some tools and options for performing more complex cost-path analyses.

Advanced Cost Path Analysis Theory

The process described above covers all of the basic steps required to perform a cost path analysis, but only begins to cover the details of complex cost path analyses as it only used on input for the cost surface. In the above rover example, the analysis assumes that slope is the single most important factor in determining the difficulty of the path chosen. However, just like Earth, there is more to the surface of Mars than simply the slope of the terrain. In order to get a more complete picture and more accurate assessment of the problem at hand, more data needs to be included.

In the rover example worked through above, additional data that would be relevant to the analysis could include surface material, surface roughness and aspect among others. When incorporating multiple datasets into the analysis, like the ones mentioned above, new factors need to be considered. The most notable factors are:

- How to assign costs/standardize all datasets

- How to combine all datasets into one cost surface

These two factors are the most subjective and will vary the most between different applications and scenarios. In addition to being the most subjective elements, they are the most critical elements and can dramatically alter the outcomes of the analysis. As such, the methods used to represent data within the analysis are vital. One common method is to pick a common arbitrary scale along which to define the cost for each layer, such as a scale from 1 to 5, or 1 to 1000, depending on the granularity of cost is desired. Each layer can then be reclassified to match this cost scale and be compared to each other. Alternatively, each layer can be reclassified such that they represent a measurable cost, such as dollars, fuel consumption or even time per unit area or length. Either of these options make it such that layers can be directly compared to one another.

Once costs have been assigned to each data layer, the next challenge is figuring out which method to use to combine them into one cost surface. The method used for combining data sets into a final cost surface is partially dependent on how costs were assigned to each data layer. Similarly to assigning costs, there are two main ways to combine data:

- Additive combination

- Linear-weighted combination

Additive combination is simply adding all cost data layers into one, which is to be used as the base of the analysis. This method is the simplest and works well if all cost layers have similar influence or if the data are classed such that they represent measurable units rather than arbitrary ones.

Linear-weighted combination involves assigning each layer a relative importance (generally expressed as a fraction of 1), such that the final cost layer is most influenced by the data with higher relative importance. This method is well suited to data that has a common scale and allows for easier fine-tuning of the cost model.

The common theme with increasing the complexity of cost-path analyses is the high degree of subjectivity and application-specific methods required. This section is meant to be an introduction to these methods and is by no means an exhaustive list.


This tutorial showed the basic steps that are needed to perform a least cost path analysis using SAGA GIS. In addition, it introduced some theory behind performing more complex cost-path analyses. The world of distance analysis in GIS is complex and can be used in creative ways for a wide variety of applications.


Dominoc925's Blog, How to digitise a new shape object in SAGA GIS,

Sohail Dham and Colin Doucette. Exploring Hydrological Analyses,

Saga Tool Library website,

Amanda Briney, Overview of Least Cost Path Analysis.

SAGA GIS Tutorials, Reclassification.