tech explorers, welcome!

Tag: geoprocessing

☮️ #WarTraces : the aerial footprint of a world in war.

It all started as an exercise of curiosity, wondering if the attack of the Kerch bridge in Crimea was seen from space.

To my surprise, this might be one of the least visible attacks occurred during the war in Ukraine.

With every news, I checked the publicly available satellite imagery from the European Space Agency and found evidence of many of the reports. Satellite images are purely objective. There is no manipulation or speech behind.

This is absolutely opposite to taking one side or another. This is about showing the reality and the scale of war. The one and only truth is that violence and war has to be condemned in all its forms and prevented with every minimum effort one can do.

#WarTraces start in Ukraine, because it’s close to Europeans, 24/7 on TV, and affecting many powerful economies. But there are many ongoing conflicts in the world. Many that seem to be forgotten. Many we don’t seem to matter or care about. Many that have to be stopped as well as this one.

Follow me on 🐦 Twitter to know when this post is updated!

🐦 @RoamingWorkshop

PEACE ☮ BROTHERS

TIP! Click an image for full size.

Ukraine War: 24 Feb 2022 - today

📖 Wikipedia timeline.

Syrian Civil War: 2011 - today

📖 Wikipedia timeline.

Israeli-Palestinian Conficlt: 1948-today

📖 Wikipedia timeline.

Process LIDAR data in QGIS and create your own Digital Terrain Model

Sometimes a Digital Terrain Model (DTM) might not be detailed enough or poorly cleaned. If you have access to LIDAR data, you can generate a terrain model yourself and make the most of the raw information giving more detail to areas of interest. Let’s see how.

1. Data download

Point cloud

I'll use the awesome public data from the Spanish Geographical Institute (IGN) obtained with survey flights using laser measurements (LIDAR).

  1. Access LIDAR data from IGN Downloads Center.

http://centrodedescargas.cnig.es/CentroDescargas/index.jsp

  1. Draw a polygon of the area of interest.
  1. Download the files PNOA-XXXX...XXXX-RGB.LAZ. RGB uses true color; ICR, infra-red. But both are valid.

TIP! Download all files using the IGN applet. It's a .jnlp file that requires Java instaled on Windows or IcedTea on Linux (sudo apt-get install icedtea-netx)

2. Process LIDAR point cloud in QGIS

Direct visualization

From the latest versions (like 3.28 LTR Firenze), QGIS includes compatibility with point cloud files.

Just drag and drop the file to the canvas or, in the menu, Layer -> Add layer... -> Add point cloud layer...

You'll see the true color data downloaded, which you can classify in the Simbology Properties, choosing Clasification by data type:

3D view

Another default function coming with QGIS is 3D visualization of the information.

Let's configure the 3D properties of the LIDAR layer to triangulate the surface and get a better result.

Now, create a new view in the menu View -> 3D Map Views -> New 3D map view. Using SHIFT+Drag you can rotate your perspective.

LAStools plugin

To handle LIDAR information easily we'll use the tools from a plugin called LAStools, which you can install in the following way:

TIP! On Linux it's recommended to install Wine to use the .exe files directly, or otherwise you'll need to compile the binaries.

  1. Access LAStools' website and scroll to the bottom:

https://lastools.github.io/

  1. The full tool comes to a price, but you can access the public download to use the basic functions that we need.
  1. Unzip the compressed .zip file in a simple folder (without spaces or special characters)
  1. Now open QGIS, search in the plugins list for LAStools and install it.
  1. Finally, configure LAStools' installation folder (if it's different from the default C:/ ). The settings shown below work in Linux with Wine installed (using PlayOnLinux in my case).

Extract types of LIDAR data

Using LAStools we can extract information of the different data that makes up the point cloud. For example, we'll only extract the data classified as Suelo (soil) which is assigned to a value of 2.

With the process las2las_filter we'll create a filtered point cloud:

  • Select the .laz file to filter.
  • On filter, choose the option to keep_class 2
  • Leave the rest by default, and introduce 0 where the fields require a value
  • Finally, save the file with .laz extension in a known location to find it easily.

Once finished, just load the generated file and see the point cloud showing only ground data (with buildings and vegetation removed).

LIDAR to vector conversion

Now use the process las2shp to transform the point cloud into a vector format so you can operate easily with other GIS tools:

  • Choose the point cloud file just filtered.
  • Specify 1 point per record to extract every point of the cloud.
  • Save the file with .shp extension in a known location to find it easily.

And this will be your filtered point cloud in the classic vector format.

You can see that there is no specific field in the table of attributes. I'll create a new field ELEV to save the Z (height) coordinate and use it to generate a Digital Terrain Model.

3. Digital Terrain Model creation

Raster form vector point layer

Thanks to the integration of GRASS GIS, we can make use of powerful vector and raster processing tools. Let's use v.surf.idw to generate a regular grid from the interpolation of data in a point layer (in this case the values are weighted with the inverse of the distance but the are other spline algorithms).

  • Choose the vector point layer.
  • Choose the number of points to use for interpolation (in this case the data is quite dense so I'll choose 50). The more you choose, the softer the result will be, at the expense of losing the detail of the information density.
  • Leave the power with the value of 2, to use "square inverse distance".
  • Choose the data field used in the interpolation (ELEV).
  • Define the grid cell size. I choose 2 to compare the result with the 2m DTM product from IGN.

4. Result

Let's zoom out and see how it all finished:

And now let's see a bit more detail.

Apply the same color ramp to the generated DTM and to the IGN product. Overall, the result is very similar, with some differences in tree areas, being more reasonable in the processed layer.

And that's it! Any doubt or comment can be dropped on Twitter!

🐦 @RoamingWorkshop