-
-
Notifications
You must be signed in to change notification settings - Fork 20
Preparing your dataset
This guide will teach you, how to prepare your dataset in the suitable GeoTIFF (.tif)
format. If your dataset is already in the GeoTIFF (.tif)
format, you can skip to Part two: Generating/using your dataset. Before you proceed, check if your country already has a guide here.
Depending on your dataset type, you will be using one of the following three scripts:
Description | Software needed | |
---|---|---|
ground_only_export_dem.py Dataset format: LiDAR (.laz or .las)
|
Suitable, if your LiDAR data, contains only ground points | CloudCompare and QGIS |
export_dem.py Dataset format: LiDAR (.laz or .las)
|
Suitable, if your LiDAR data contains both ground and off-ground points (Like trees, buildings...) | CloudCompare with the modified qCSF plugin and QGIS |
convert_dem.py Dataset format: XYZ (.xyz) ASCII Grid (.asc)
|
Suitable, if your raster data is in any other format than GeoTIFF (.tif) and can be opened using GDAL. The script simply converts the source file to GeoTIFF (.tif) using gdal_translate . Note, the script also offers an recursive option, to also scan sub-folders. To enable it, simply change the recursive variable to True . |
QGIS |
export_dem_classification.py Dataset format: LiDAR (.laz or .las)
|
Suitable, if your LiDAR data, contains classified points. Find out more in Preparing your Classified LiDAR dataset | CloudCompare and QGIS |
convert_TIN_to_raster Dataset format: XYZ (.xyz) ASCII Grid (.asc)
|
Suitable, if your xyz or asc file contain a TIN surface . This also assumes that the columns are order in the order: x y z , with a delimiter like space or semicolon in between. To change the delimiter being used (space by default), change the source_delimiter variable. Make sure to set the source epsg, by changing the source_epsg variable to 'EPSG:<YOUR EPSG CODE>' . Note, the script also offers an recursive option, to also scan sub-folders. To enable it, simply change the recursive variable to True . |
QGIS |
Regardless, of which script you choose, all follow the same general procedure. Each script also contains comments if you want to change something, like for which formats should the script scan for For example, in the convert_dem.py
script, you would change the line:56
, to the format your dataset uses, that GDAL can open.
-
CloudCompare
: Download and install the latest stable release of CloudComapre (2.11.3 Anoia) from here -
QGIS
: Download and install the latest version of QGIS (3.16) in OSGeo4W -
CloudCompare qCSF plugin
: Download the QCSF_PLUGIN.dll file and place it in the plugins folder (default:C:\Program Files\CloudCompare\plugins
). If you wish to build the plugin yourself, you can find the source files here and follow the instructions from here.
Note: The modified qCSF plugin will be incorporated in the future CloudComapre v2.12 release
- Download and place your lidar/source files into a folder (ex. Documents\Minecraft\Source)
- Open QGIS and navigate to
Plugins/Python Console
in the toolbar - In the opened bottom panel click on the
Show Editor
button (Script icon) - Open the script you choose using the
Open Script...
button (Folder icon) - Once open navigate to the
source_directory
line (line: 14) - Here replace the path with your path to the folder where you lidar/source data is saved and make sure to use double backslash
- Then navigate to the
dem_directory
line (line: 15) and replace the path where you wish to save the converted/transformed dataset, making sure to use double backslash - Save the changes using the
Save
button (Floppy disk icon) - Navigate to View/Panels/Log Messages in the toolbar
- Now, depending on how many lidar/source files you have this can take quite a while, up to multiple hours if you use the
export_dem
script. Click on theRun Script
button (green play button) - After the script is finished you will get a notification from QGIS
Now that your dataset is in the suitable GeoTIFF (.tif)
format, you can follow the Part two: Generating/using your dataset, using dataset in the folder that you defined in the dem_directory
variable.
Warning: I do not own the provided qCSF plugin, therefore use it at your discretion. You may use the provide compiled dynamic library file or you may compile it from the source.
The provided plugin is a modified version of the qCSF plugin made to work in the command mode. It will be included in the future release of CloudComapre (v2.12). If you wish to learn more go here.
You can contact me on Discord, under davixdevelop#3914
, or you can join us on our BTE Development Hub on Discord, and ask away under the #terraplusplus-support
channel.