Techno Blender
Digitally Yours.

Generate a 3D Mesh of a Geographic Area with QGIS | by Mattia Gatti | Mar, 2023

0 47


From a digital elevation model to a 3D mesh

Photo by Planet Volumes on Unsplash

3D meshes can be used to represent geographic data such as terrain, buildings and other structures. This mesh can be useful for a variety of purposes, such as urban planning, environmental analysis or virtual reality simulations. However, the process of creating a 3D mesh of a geographical area is not always straightforward, but this guide covers all the necessary steps.

To generate a 3D mesh of a given area, elevation data for that area is required. This data is stored in a Digital Elevation Model (DEM):

A Digital Elevation Model (DEM) is a type of geographical raster file that is used to represent surface reliefs

A DEM is basically a grid of elevation values. If you want more information, I discussed DEMs in a previous article.

Graphic visualization of a DEM. NSIDC, CC BY 2.0, via Wikimedia Commons

These models are created using one or a combination of the following techniques:

  • LiDAR — This method uses a laser scanner to measure the height of the terrain surface. The laser sends out pulses of light that bounce off the terrain, and the time it takes for the light to return is used to calculate the distance to the surface.
  • Photoclinometry — This method analyses the shadows cast by surface features in the image, which can provide information about the elevation and orientation of the terrain.
  • Interpolation — This method uses elevation data from known points, such as survey measurements or GPS data, to estimate the elevation at other points in the area of interest. Interpolation techniques can include methods such as kriging, splines or triangulation.
  • Photogrammetry — This method uses stereo-pair satellite images. The elevation data is derived from the difference in perspective between the two images. Photogrammetry is usually the most accurate method for producing DEMs.

The different techniques for generating DEMs have been presented to help you make a better choice when deciding which to download.

Now comes the real question: where can I download DEMs?

DEMs are raster files, usually saved with the .tif extension. For large areas, the digital elevation model is divided into several raster files. The filename of a DEM usually contains information about the area it covers and the resolution (e.g. 10m). Obviously a 10m DEM has more detail than a 30m DEM of the same area.

Some repositories of digital elevation models are:

  • Copernicus EU-DEM — Here you can download a DEM of Europe produced by Copernicus. Copernicus is the Earth observation component of the European Union’s space programme. It provides information services based on Earth observation satellites and in-situ (non-space) data.
  • Copernicus PANDA — This platform allows you to download DEMs of areas all over the world. Planetary Data Access (PANDA) is the user interface for searching/viewing/accessing Copernicus Earth Observation (EO) products.
  • Tinitaly DEM — For my Italian fellows, here is a DEM of the Italian surface produced by the Istituto nazionale di geofisica e vulcanologia (INGV).
  • UAHiRISE — On this page you can find many DEMs made by combining the stereo pairs taken by HiRISE (photogrammetry). The High Resolution Imaging Science Experiment (HiRISE) is a stereoscopic camera on board the Mars Reconnaissance Orbiter, which has been orbiting and studying Mars since 2006.
  • Moon LOLA DEM — Here you can find DEMs of the Moon. The Lunar Reconnaissance Orbiter (LRO) is a robotic spacecraft currently orbiting the Moon.

Obviously there are many sources of DEMs and it’s impossible to list them all here. If you are interested in a particular country, its research centres usually share the DEMs for that area.

If you want to use the same DEM that I use in this guide, download the file DTEEC_041878_1460_041021_1460_G01 from here. This file is the elevation model of the following image of the Martian surface:

Crater with Steep Gullied Slopes. Image by UAHiRISE.

To generate a mesh from a digital elevation model you need to install the DEMto3D plugin in QGIS:

  1. Open QGIS.
  2. Select Manage and Install Plugins… in the Plugins tab.
  3. Write DEMto3D in the search bar.
  4. Open the first result.
  5. Click Install Plugin in the bottom-right corner.
DEMto3D plugin.

Finally, generating the mesh is very simple:

  1. Open the DEM file
  2. Go to Raster -> DEMto3D -> DEM 3D Printing
  3. Under Print extent you have to select the boundary of the area for which a 3D mesh is to be generated. You can either select the entire area by clicking the first button or draw the bounding rectangle by clicking the third button. The coordinates represent the 2 points of the bounding rectangle (lower left and upper right points).
  4. Under Model size set Spacing (mm) to 0.2 and Width (mm) and Length (mm) to the size you want for the 3D file (e.g. 100mm x 100mm for a square selection).
  5. Under Model height set Height (m) as the difference between the Highest point and the Lowest point (found on the right). Round the result of this difference to the nearest integer.
  6. Click on Export to STL.
The settings I used to generate the 3D mesh.

You can then open the generated mesh in MeshLab or any other 3D editor:

The resulting mesh of the Mars crater.
  1. Urban planning: 3D meshes of urban areas can be used to simulate and visualise the impact of new buildings, roads and other infrastructure on the urban environment.
  2. Environmental analysis: 3D meshes of hazard areas can be used to analyse the impact of natural phenomena such as flooding or erosion on the landscape. This can help environmental scientists and policy makers understand the risks and potential consequences of these events.
  3. Military and defence: some geographical 3D meshes can be used for military and defence applications such as simulation and training environments or mission planning.
  4. Video games: 3D meshes of a geographical area can be used to create the same environment in a virtual scenario.

In this guide you have been given an overview of DEM files and techniques for generating them. You have also seen that the challenging part is getting a proper DEM of the area of interest, because the mesh generation part is very simple.

All images unless otherwise noted are by the Author.


From a digital elevation model to a 3D mesh

Photo by Planet Volumes on Unsplash

3D meshes can be used to represent geographic data such as terrain, buildings and other structures. This mesh can be useful for a variety of purposes, such as urban planning, environmental analysis or virtual reality simulations. However, the process of creating a 3D mesh of a geographical area is not always straightforward, but this guide covers all the necessary steps.

To generate a 3D mesh of a given area, elevation data for that area is required. This data is stored in a Digital Elevation Model (DEM):

A Digital Elevation Model (DEM) is a type of geographical raster file that is used to represent surface reliefs

A DEM is basically a grid of elevation values. If you want more information, I discussed DEMs in a previous article.

Graphic visualization of a DEM. NSIDC, CC BY 2.0, via Wikimedia Commons

These models are created using one or a combination of the following techniques:

  • LiDAR — This method uses a laser scanner to measure the height of the terrain surface. The laser sends out pulses of light that bounce off the terrain, and the time it takes for the light to return is used to calculate the distance to the surface.
  • Photoclinometry — This method analyses the shadows cast by surface features in the image, which can provide information about the elevation and orientation of the terrain.
  • Interpolation — This method uses elevation data from known points, such as survey measurements or GPS data, to estimate the elevation at other points in the area of interest. Interpolation techniques can include methods such as kriging, splines or triangulation.
  • Photogrammetry — This method uses stereo-pair satellite images. The elevation data is derived from the difference in perspective between the two images. Photogrammetry is usually the most accurate method for producing DEMs.

The different techniques for generating DEMs have been presented to help you make a better choice when deciding which to download.

Now comes the real question: where can I download DEMs?

DEMs are raster files, usually saved with the .tif extension. For large areas, the digital elevation model is divided into several raster files. The filename of a DEM usually contains information about the area it covers and the resolution (e.g. 10m). Obviously a 10m DEM has more detail than a 30m DEM of the same area.

Some repositories of digital elevation models are:

  • Copernicus EU-DEM — Here you can download a DEM of Europe produced by Copernicus. Copernicus is the Earth observation component of the European Union’s space programme. It provides information services based on Earth observation satellites and in-situ (non-space) data.
  • Copernicus PANDA — This platform allows you to download DEMs of areas all over the world. Planetary Data Access (PANDA) is the user interface for searching/viewing/accessing Copernicus Earth Observation (EO) products.
  • Tinitaly DEM — For my Italian fellows, here is a DEM of the Italian surface produced by the Istituto nazionale di geofisica e vulcanologia (INGV).
  • UAHiRISE — On this page you can find many DEMs made by combining the stereo pairs taken by HiRISE (photogrammetry). The High Resolution Imaging Science Experiment (HiRISE) is a stereoscopic camera on board the Mars Reconnaissance Orbiter, which has been orbiting and studying Mars since 2006.
  • Moon LOLA DEM — Here you can find DEMs of the Moon. The Lunar Reconnaissance Orbiter (LRO) is a robotic spacecraft currently orbiting the Moon.

Obviously there are many sources of DEMs and it’s impossible to list them all here. If you are interested in a particular country, its research centres usually share the DEMs for that area.

If you want to use the same DEM that I use in this guide, download the file DTEEC_041878_1460_041021_1460_G01 from here. This file is the elevation model of the following image of the Martian surface:

Crater with Steep Gullied Slopes. Image by UAHiRISE.

To generate a mesh from a digital elevation model you need to install the DEMto3D plugin in QGIS:

  1. Open QGIS.
  2. Select Manage and Install Plugins… in the Plugins tab.
  3. Write DEMto3D in the search bar.
  4. Open the first result.
  5. Click Install Plugin in the bottom-right corner.
DEMto3D plugin.

Finally, generating the mesh is very simple:

  1. Open the DEM file
  2. Go to Raster -> DEMto3D -> DEM 3D Printing
  3. Under Print extent you have to select the boundary of the area for which a 3D mesh is to be generated. You can either select the entire area by clicking the first button or draw the bounding rectangle by clicking the third button. The coordinates represent the 2 points of the bounding rectangle (lower left and upper right points).
  4. Under Model size set Spacing (mm) to 0.2 and Width (mm) and Length (mm) to the size you want for the 3D file (e.g. 100mm x 100mm for a square selection).
  5. Under Model height set Height (m) as the difference between the Highest point and the Lowest point (found on the right). Round the result of this difference to the nearest integer.
  6. Click on Export to STL.
The settings I used to generate the 3D mesh.

You can then open the generated mesh in MeshLab or any other 3D editor:

The resulting mesh of the Mars crater.
  1. Urban planning: 3D meshes of urban areas can be used to simulate and visualise the impact of new buildings, roads and other infrastructure on the urban environment.
  2. Environmental analysis: 3D meshes of hazard areas can be used to analyse the impact of natural phenomena such as flooding or erosion on the landscape. This can help environmental scientists and policy makers understand the risks and potential consequences of these events.
  3. Military and defence: some geographical 3D meshes can be used for military and defence applications such as simulation and training environments or mission planning.
  4. Video games: 3D meshes of a geographical area can be used to create the same environment in a virtual scenario.

In this guide you have been given an overview of DEM files and techniques for generating them. You have also seen that the challenging part is getting a proper DEM of the area of interest, because the mesh generation part is very simple.

All images unless otherwise noted are by the Author.

FOLLOW US ON GOOGLE NEWS

Read original article here

Denial of responsibility! Techno Blender is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – [email protected]. The content will be deleted within 24 hours.
Leave a comment