[GIS] How to create a layer over a surface with mayavi

3dgdalpythonsurface

I made a program with python which displays an animation of the propagation of a fire spreading in a forest in 2D (the forest is an array):

  • no tree = 0.0
  • a tree = 1.0
  • a tree in fire = 2.0

Here is an example (without wind and relief):

enter image description here

And I also made a surface plot with mayavi, python and gdal using this post (DEM plot with matplotlib is too slow).

Now I want to know how to put the propagation that I made with an array (in 2D) over the surface of the mountain as if it was a kind of layer that will be able to move and grow on the surface like a fire growing in a forest.

I am not asking for an algorithm that can make a simulation of a forest fire.

I am asking for a way to create this kind of layer over the surface plot I made.

For instance, in the next photo you can see a red layer (the spreading fire) on the surface:

enter image description here

Source: https://www.researchgate.net/figure/48202796_fig11_Fig-11-The-finest-domain-in-the-Meadow-Creek-fire-simulation-5-h-after-ignition

Best Answer

Sorry, but for me it is not a GIS problem but a pure Python problem:

  1. You need to learn Mayavi: mlab: Python scripting for 3D plotting before using it.
  2. Mayavi, as Matplotlib, knows nothing about georeferenced surfaces. You can plot easily a DEM surface, but if you want to drape a raster over the DEM or plot lines, it is a problem of Mayavi.
  3. The only example I know is 3D terrain visualization with python and Mayavi2

Generally, I use GRASS GIS for that with also ParaView witch also use VTK

enter image description here

enter image description here

Related Question