All credits go to https://github.com/bertt I just translated his workshop into English
Digital Twins faithfully bring together data from various sources into a digital copy of the physical reality. The concept of a digital twin is very broad. In this workshop, we focus on digital twins of the physical environment. This provides a realistic picture of an area or region, where spatial data is clearly displayed and can be used for many applications. Such a digital twin cannot exist without the 3D component. However, most data is not directly available in 3D. Therefore, the data often needs to be processed first. These processing steps can vary significantly depending on the type of source data.
This workshop demonstrates how this data processing works using a number of examples. The focus is on the 3D Tiles specification. This OGC standard helps optimize the display of large 3D datasets by smartly loading only the necessary data.
For a detailed overview of the 3D Tiles specification, see https://github.com/CesiumGS/3d-tiles/blob/main/3d-tiles-reference-card.pdf.
The amount of data in a digital twin is often enormous, making it undesirable to request all available data at once due to performance considerations.
After data processing, we will visualize the 3D Tiles. 3D Tiles can be used by multiple applications. In this workshop, we use Cesium, a powerful open-source JavaScript library.
In addition to visualization in Cesium, the created tilesets will be loaded into QGIS.
In this workshop, we will set up a digital twin for the Proefpolderdijk near Andijk. Managing this dike involves a lot of different data. We will be working with the Digital Topographic File (DTB) from RWS (Rijkswaterstaat). Using this data, we will demonstrate the steps required to go from the available source data to a 3D web environment using open-source tooling and open standards.
The workshop is divided into two parts:
Part 1: Data Processing to 3D Tiles
- Downloading and importing data;
- Preparing data
- Creating 3D Tiles
Part 2: Data Visualization in 3D
- Loading 3D tilesets
- Customizing tileset style
- Adding 3D models
- Using PDOK 3D Basic Facility 3D Tiles
- Loading 3D Tiles in QGIS
After completing this course:
- You will have knowledge of the 3D Tiles standard;
- You will have insight into the software and techniques required for creating 3D tilesets;
- You will be able to load a 3D tileset into a CesiumJS web environment;
- You will be familiar with the possibilities for data visualization with CesiumJS.
- Laptop
- Internet connection
- Web browser
Required software:
- Docker
Check:
docker --version
Docker version 27.1.1, build 6312585- QGIS
Set the path to QGIS in the environment variables, so we can use GDAL command-line tools.
Example directory: C:\Program Files\QGIS 3.38.3\bin.
This can be done via Control Panel - System - Edit the system Environment Variables - Environment Variables... - System Variables - Path, or via the command line:
set PATH=%PATH%;C:\Program Files\QGIS 3.38.3\binCheck:
ogr2ogr --version
GDAL 3.9.2, released 2024/08/13- Database management tool (e.g., pgAdmin or DBeaver)
pgAdmin: https://www.pgadmin.org/
DBeaver: https://dbeaver.io/
The advantage of DBeaver is that a large number of database types can be used.
Command-line enthusiasts can also use psql. psql.exe is located in the bin directory of the QGIS installation by default.
- Node.JS
Download and install Node.js (https://nodejs.org/en/download/)
Check:
node --version
v20.18.0The workshop uses the Windows operating system, but with some minor adjustments, other operating systems can also be used.
We use Docker to start the PostGIS database. Open a terminal and execute the following command:
docker run -d -e POSTGRES_PASSWORD=postgres -d -p 5439:5432 postgis/postgis
3cc40f09c573141a90e1a7abdc4f5d0cdfc2bebfe4ab2ff9e3ecf81f83af4529
Command explanation:
Docker run: starts a new container.
With -e, set environment settings, such as a password or username.
With -d, the Docker container runs in 'detached' mode, so it doesn't block the terminal but runs in the background.
With -p, handle port mapping; we use port 5439.
Next, a connection to the database can be made in DBeaver, pgAdmin, or QGIS by adding a new connection. Use the following settings:
- Host: localhost
- Port: 5439
- Username: postgres
- Password: postgres
Example of creating a database connection with DBeaver - via Database - New database connection - PostgreSQL:
Queries can be executed on the database via SQL Editor -> Open SQL Script.
Example of creating a database connection with QGIS - Browser window - right-click on PostgreSQL - new connection
Queries can be executed on the database via the 'Execute SQL' option.
Check: Retrieve the PostGIS version with the following SQL query:
SELECT postgis_version();Example with psql client:
psql -h localhost -p 5439 -U postgres -d postgres -c "select PostGIS_Version();"
postgis_version
---------------------------------------
3.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)Create a working directory where the files for this workshop will be stored.
For example:
cd c:\
mkdir workshop_3dtilesIn the workshop, we will use the following data files:
- Digital Topographic File (DTB) from RWS
- Bag 3D
The assignments explain how to retrieve these data files. The data files can also be found in the 'data' folder in this repository.
See the results of this workshop in the 'results' folder.
This folder contains the following subfolders:
- andijk_buildings: 3D Tiles of the buildings in Andijk
- dtb_points: 3D Tiles of the DTB points
- dtb_polygons: 3D Tiles of the DTB polygons
The result of the workshop is a 3D web environment with the 3D tilesets for Andijk loaded.
Continue to 1_data_processing.md



