Introduction: How to Make a Martian Fly-Over Animation With QGIS

About: I'm interested in documenting my creations.

Our planet Earth is a wondrous place to be mapped about, but with the advance of technology and the launch of different spacecrafts, there is an interesting venture and a new research field for mapping enthusiasts, another planet.

Mars, as the most similar to our Earth and also a destination of a lot of planetary mission (some of them are scheduled to be launched/ had just launched this year) has been mapped a lot more compared to other planetary bodies. These vast data are fortunately available open-source to us and can be utilised for both scientific purposes and for fun.

In this Instructables, I will guide to you make a simple Martian fly-over animation using a mapping software QGIS, instead of using animation software like Blender.


Working computer in any Operating System

Step 1: Obtain Our Data

As there are different missions to Mars already, there are different topographical datasets available online. In this Instructable, we will use HRSC dataset. HRSC is a high-resolution stereo camera onboard the ESA Mars Express spacecraft that has been observing Mars since 2003.

There are different terms for topographical information on Earth, like Digital Terrain Model (DTM), Digital Elevation Model (DEM), or Digital Surface Model (DSM), but as there is no building or vegetation on Mars, DTM and DEM are usually used interchangeably. To get this information from images (there are other methods, such as using laser altimetry), you need to have at least 2 images overlapping an area to do a stereo processing. HRSC has 9 different cameras, including 2 stereo channels, so this can be done more easily (even though it's still not easy) No worries though as there are scientists doing this and creating a good dataset that can be downloaded for free.

The HRSC DTM and other Martian data can be downloaded for free under the integrated Arizona State University Martian viewer website Choose the HRSC tab.

Now, choose your Martian Area of interest. The easy way to do this is to go to a specific Martian feature Wikipedia page. For example in this Instructable, we will choose Echus Chasma. Chasma is an elongated depression feature on a surface. Echus Chasma is a chasma located in the north of Valles Marineris, the large valley on Mars. You can take a note of the central coordinate of this feature, 1.0°N 278.0°E.

Go back to the ASU Martian viewer website. Now we want to look for the available topographic dataset of Echus Chasma. You need to input the coordinates. As it asks for minimum and maximum value, let's put 0.9-1.1°N and 277.5-278.5°E. For Image Types, you can select DT4 (terrain model/ DTM) . Click Run Query.

Choose orbit H2204 (H2204_0000_DT4). You will arrive at the orbit landing page. Scroll until you get a link on the PDS tab. Copy this link and paste it to your address page. Delete the filename until you only get the folder name like this Click enter to go to the orbit data page. Now, it's time to download your data. Download file with *dt4*img (terrain model), *re4*img (red band), the *gr4*img (green band) and the *bl4*img (blue band). There are other files in the folder that you don't need to download for visualisation like *ir4*img (infrared) and *nd4*(nadir image).

Step 2: Install QGIS

Have you installed QGIS in your computer already? QGIS is an multi-platform open-source mapping software, it's useful if you work with map a lot. If you haven't, you can go to QGIS website to download QGIS ( You can install the latest version or the stable version, I believe the 3D View has been available since QGIS 3.8, any version after that should be alright. Install by double clicking the installer (Windows) or drag the dmg to your Application folder (Mac).

Step 3: Open QGIS and Load Your Terrain Model

Now, open QGIS and add your terrain data by dragging all your 4 files to the QGIS workspace.

The DTM is a grayscale image with elevation number in metres stored in pixel values and georeferencing information stored in its metadata so we know that each pixel in this DTM is about the same with 750m in real life. So, our chasm here is about 1.8km high and 7000km wide.

Arrange our dataset in the layer bar with the terrrain model on top (dt4) and the colour layers below it (no specific order).

To display this height value to a more understandable form, we will create a hillshaded image. A hillshaded image is a 3D representation of a surface by different shading with sun's position taken into account. You can do this easily in QGIS by clicking our terrain model (dt4) on the layer window, and hillshade by the toolbar using Raster > Analysis > Hillshade. However, this way, you can't control your surface because the numbers are automatically generated. To be able to adjust the numbers to your liking, you can right click on your DTM layer and choose Properties. The Layer Properties window will pop up. Under the Symbology tab, you can change the Render type to Hillshade. You can change the altitude (height) and the azimuth (angle from North), or just use the default value. To obtain more on the height, you can increase the height exaggeration value, Z-factor. I find values between 5-10 good, let's use 10 for this map. You want the surface to come through instead just the height, with this, you need to change the hillshade opacity/ transparency under the transparency tab and move the slider. I usually change it to around 30%.

Now, for the colour. using the same Properties window, Symbology tab, you will use the Multiband color on the Render type drop down. For the red band file (re4), change the Red band value to Band 1 and the other bands to Not set. Do this for the other 2 bands (bl4 to Blue band set to Band 1 and others to not set, gr4 to Green band set to Band 1 and others to not set). Change the transparency value as well. Now, as Mars is more red than green and blue, set the transparency values differently for these three layers. Set the red layer transparency to 50%, the green to 10%, and blue to 5%. Now you have your colourised, hillshaded, Martian terrain model ready to animate.

Step 4: Create Your Animation

After you're happy with your surface. It's time to animate it in 3D. In older QGIS version, you cannot do this straight in QGIS, so you need to load your DTM to other 3D software or install 3D viewer plugin. However, the 3D visualisation is now included in QGIS releases. Click on the Toolbar: View > New 3D Map View to load the 3D Map window.

Then you need to change the setting to show the terrain model, with 10 exaggerations similar to what you've previously done in the Properties setting.

There is a navigation button on the right-hand side of the 3D map window. As we're planning to do a flyover chasm video here, click the tilt down and zoom button until you're inside the Chasm for your initial location. After you're happy with it, click the animation button to show the animation setup. Click the Add keyframe (green plus sign) to add a keyframe on your current location. Change your keyframe time (let's try 5s in our first keyframe). Now, move to a different location at the canyon by using your mouse for your 2nd location, then add another keyframe again (for 10s). Move to the third location, for 15s). Continue until you're happy with your flyover. You can preview your animation by clicking the play button. You can change the interpolation to higher ones if you want the surface to look better, but depending on your computer specs, it will make your animation slower.

If you are happy with everything, you can export your 3D animation by clicking the Export button (the floppy disk icon).

You should have a lot of numbered images in your folder.

Step 5: Convert Images to GIF

As our flyover animation is still in a stack of images, we need to convert them to gif or videos. We can do this using image editing software, but for this Instructable we will use online GIF maker, Choose your numbered files to upload. Then click "Upload and make a GIF!". All the images would get displayed. If you want the default, just go to the end and "click Make a GIF!" Wait until the GIF file is created and save to your computer.

An example animation created for this tutorial can be seen as this Instructable main image or in this Streamable link here

You can play around with other martian datasets such as HiRISE (1m/pixel) for a smaller area and better resolution but more steps to arrange colour images (here), or other planetary body like the Moon (here for LROC-NAC 5m/pixel), as well as Earth dataset.

Maps Challenge

Participated in the
Maps Challenge