SatSure | Blog
Home » Satsure Blogs » Using the Digital Elevation Model (DEM) Dataset to Generate 3D Maps on SatSure Sparta

Using the Digital Elevation Model (DEM) Dataset to Generate 3D Maps on SatSure Sparta

Digital Elevation Model or DEM are gridded representations of terrain, with each cell’s value in the grid being its elevation. DEM data can be used in various applications, like the creation of relief maps, terrain analysis, and modeling water flow, amongst others.

There are multiple data sources for DEM available like SRTMASTERGMTED, etc.

Aster DEM 30m

On SatSure Sparta, the DEM data available is derived from ASTER 30m dataset and is available to download as PNG or raw tiffs at a sub-district level.

From a raw DEM input dataset, we can extract a variety of other derivative datasets. Some of which we will cover in this article are:

  1. Slope — It is the steepness or the degree of inclination of a particular surface. It is typically expressed as either a percentage or an angle.
  2. Aspect — It is the orientation of slope or the direction that the terrain is facing measured clockwise in degrees from 0 to 360, where 0 is north-facing, 90 is east-facing, 180 is south-facing, and 270 is west-facing.
  3. Hillshade — It is a 3D representation of a surface using the sun’s relative position to provide shading and depth to the image.

Initial Preparation:

The first step here is to download the raw tiff file from SatSure Sparta and importing that on QGIS or in your python code.

For this explanation, the region I have chosen is the Trimbakeshwar area of Maharashtra, and I have saved it by the name trim.tif

You can access the dataset by creating an account or logging in on SatSure Sparta, an Open Innovation Platform for AgTech and ClimateTech. (

Trimbakeshwar, Nashik DEM representation on SatSure Sparta

Next, we need to open QGIS and drag and drop the image in the Layers tab.


Finally, we need to color the file. Here, I have used a Custom Colour ramp made from the same shades used in SatSure Sparta. You can make a custom color ramp or choose any of the pre-existing ones.

Steps to Process:

  1. In QGIS, double click — Layer properties
  2. Render type — Single-band pseudocolor
  3. Select color ramp
Raw Layer Color
Raw Colorized


Import Modules

import os
import gdal
import rasterio
import matplotlib.pyplot as plt

Get DEM file and open it

with'trim.tif') as dataset:
plt.imshow(dem, cmap="magma")


Raw Python


Once we have our base layer in place, the next step is to perform Raster Analysis on it and extract different features. First, we will extract the Slope:


  1. Click on Raster > Analysis > Slope
Slope steps QGIS

2. Enable Slope Expressed as a percentage instead of degrees

Slope QGIS steps


Slope QGIS


gdal.DEMProcessing('slope.tif', 'trim.tif', 'slope', options = '-p')
with'slope.tif') as dataset:
plt.imshow(slope, cmap="magma")


Slope Python


Similarly, we can also extract the Aspect.


  1. Click on Raster > Analysis > Aspect
  2. Select the default values in the window that opens and click on Run


Aspect QGIS


gdal.DEMProcessing('aspect.tif', 'trim.tif', 'aspect')
with'aspect.tif') as dataset:
plt.imshow(aspect, cmap="magma")


Aspect Python


We also extract Hillshade the same way:


Select Raster > Analysis > Hillshade

Hillshade QGIS


gdal.DEMProcessing('hillshade.tif', 'trim.tif', 'hillshade')
with'hillshade.tif') as dataset:
plt.imshow(hillshade, cmap="magma")


Hillshade Python


The next step is changing colors and transparency to bring out the features. In our example, we made the transparency of the first 3 layers 60% so that we could see the layer beneath

Post this, we also colorized the Slope and Aspect layers using the same color map you see on SatSure Sparta. The resulting image is as below:

Final 2D Output

We can already see the different contours being visible. As is evident, the area in the south of the region seems to have a lot of hilly regions. The next step is to convert this to an actual 3D map!

3D Map

The following are the steps to take:

  1. Select View > New 3D Map View
Step 1 3D Map

Note: If you get an error saying:

3D view currently does not support unprojected coordinate reference systems (CRS).

Please switch the project’s CRS to a projected CRS

Go to Project > Properties

Set the CRS to any Projected CRS (as needed by your application)


You can see a new window pop-up like this

Step 2 3D Map

2. Click on the Configure button in the toolbar

In the new window that opens:

  1. Change Type to DEM (Raster Layer)
  2. Change Elevation to your base DEM layer (trim in my case)
    (Optional parameters to change below. Change as needed)
  3. Increase vertical scale to 1.5
  4. Increase the tile resolution to 50 px (you can play around with this later)
  5. Scroll down, in Map tile resolution, select 128 px
  6. Increase the map screen error to 5 px

The resulting output will be something like this!

Final 3D Output

And there you have it!

That’s how you can ingest DEM data from SatSure Sparta. You can then use it to extract any of these derivatives like slope, aspect, or hillshade and generate amazing 3D visualizations!

Read more such articles on using SatSure Sparta and relevant use cases on

Written by Arpit Kubadia, Junior Product Manager, SatSure. This story was first published on our Medium.



Subscribe to our Email Newsletter