Importer le MNT de l’IGN avec QGIS & GRASS

Ici, nous allons voir comment importer le Modèle Numérique de Terrain de l’IGN dans QGIS/GRASS et comment visualiser le résultat dans le visionneur 3D NVIZ

Modification de l’en-tête du MNT d’origine
Le MNT de l’IGN se présente sous la forme d’un fichier à extension .asc comme ASCII

Si l’on ouvre le fichier dans un éditeur de texte, on trouve l’en-tête suivant qui donne la résolution, le nombre de colonnes/lignes composant, ainsi que les coordonnées X Y du coin bas gauche du raster:
ncols 3441
nrows 5401

xllcorner 1157987.50

yllcorner 6101987.50
cellsize 25.00

NODATA_value -9999

Pour être importé dans GRASS, le fichier .asc doit posséder la structure d’en-tête suivante:
cols: 3441
rows: 5401

west: 1157987.50
south: 6101987.50

north: 6237012.50

east: 1244012.50

Les éléments à calculer sont l’abcisse Xmax de l’extrêmité gauche (east) ainsi que l’ordonnée de l’extrêmité haute Ymax (north) du raster.

Le mode de calcul est très simple. Le voici:
east=ncols*cellsize+xllcorner
Ici:
east=(3441*25)+1157987.50
et pour north:
north=nrows*cellsize+yllcorner

En résumé, voici la correspondance entre l’ancien en-tête et le nouveau:
cols: ncols
rows: nrows

west: xllcorner

south: yllcorner

north: nrows*cellsize+yllcorner

east: ncols*cellsize+xllcorner

Une fois cela fait, enregistrez le MNT sous le nom
MNT_GRASS.asc par exemple

Import du fichier ASCII
Dans QGIS, ouvrez les outils GRASS et activez le module r.in.ascii.


Entrez les paramètres suivants:

Visualisation dans NVIZ
Une fois cela fait, vous pouvez visualiser votre MNT via le visionneur NVIZ mais avant le lancement de NVIZ, assurez-vous d’avoir bien défini votre région: l’étendue ainsi que la résolution de la zone d’intérêt à étudier..



Ici, nous avons utilisé la palette de couleur par défaut pour les rasters d’élévation. Il s’agit de la table de couleurs rainbow.

Drapage d’orthophotos, de scans
Je vous recommande fortement de lire le document suivant écrit par Martin Laloux qui traite des résolutions de raster dans NVIZ, dans les cas où l’on souhaite draper une orthophoto, un scan…
http://www.portailsig.org/content/grass-gis-region-resolution-resolution-3d-drapage-ou-l-apparente-quadrature-du-cercle

Ici, nous avons appliqué la méthode décrite ci-dessus en interpolant le MNT à la résolution 0.5 de l’orthophoto puis ayant appliqué la table de couleurs de l’orthophoto.



La valeur de fine a été fixée à 0.5, résolution de l’orthophoto.


Plus d’infos sur le traitement de rasters d’élévation, NVIZ:
r.in.ascii
r.resamp.interp
NVIZ

[GRASS] Aerial Image + Shaded Relief => Shaded Aerial Image

Sometimes, one might find the relief feeling given by an aerial image a little poor. You could also find that the moment the photo was taken doesn’t enhance the right elements of the relief.

One solution is to use a raster elevation to integrate a shaded relief to an aerial image.

Used modules

Prerequisites
This assumes that you already have in your mapset:

  • the aerial image: ortho
  • the elevation raster map: MNT. This article explains you how to import MNT (for french readers)

And that your GRASS region is positioned on your area of interest:

g.region rast=ortho

Creating the shaded relief

r.shaded.relief map=MNT shadedmap=MNT.shaded altitude=80 azimuth=60 zmult=1 scale=1

Combining the aerial image with the shaded relief
Here, we use the aerial image and use the intensity of the shaded relief so as to get a modified aerial image.

r.his h_map=ortho i_map=MNT.shaded g_map=ortho.shaded.green b_map=ortho.shaded.blue r_map=ortho.shaded.red

The areas of the aerial image covered by dark areas of shaded relief will get darker but those covered by white areas will remain closely the same.
That’s why the choice of altitude is important during the r.shaded.relief step. Using a low altitude parameter will cause the horizontal areas of the final image to be dark. We chose a value close to 90 (mid-day time), so as to enhance the horizontal areas.

Combining the different color raster maps of the shaded aerial image
As the shaded relief aerial image has been generated in 3 different rasters maps, we have to merge them.

r.composite green=ortho.shaded.green blue=ortho.shaded.blue red=ortho.shaded.red out=ortho.shaded

Here’s the result:

Here, the feeling of relief that has been added is very light. Play around the azimuth and altitude parameters to get the appropriate aspect for your map.

Note: All the operations have been performed from QGIS, sometimes from the GRASS QGIS Shell. If you use GRASS and not QGIS, this operation is unnecessary. When displaying the aerial image under GRASS, just choose “Drape Map”. However, you may find an interest in applying this method under GRASS if you want to output the result…