.laz is one of many file formats of LIDAR files and (for me) the most complicated file format to convert from. So I thought I should share this tutorial so that anyone else who had to handle .Laz or .las doesn’t encounter the same type of problems that I had when I tried to convert the files first time around. Still, This tutorial isn't complete as I obviously missed some steps and didn't get the final results as I wanted. I leave this guide as-is for now and update it when I have figured things out. __________________________________________________________________________ In this tutorial, we are going to use QGIS. If you have read the other tutorials about LIDAR and SRTM here on DTG Forums, everyone mentions QGIS, so it makes sense to use that here as well. But with that, we also need LASTOOLS, as that is core programs that does the actual conversions. The software isn’t free, but there is a workaround that I included in this guide. It makes some extra steps but I rather go trough that than having those diagonal watermarks over the converted LIDAR data, which would only ruin the map anyway: INSTALLATION & SETUP: Step 1: Download and Install QGIS. I downloaded the latest version, QGIS 3.34 “Prizren” from their website. I am not sure if 3.28 LTR (Wich claimed to be the most stable version) would work. (I used it at first, but as part of my trial and error, I upgraded to 3.34 and kept it since.) Step 2: Download LASTools from Github 2.1 Scroll down to the bottom of the page, select “Public download on github.io” and then “download LAStools.zip” at the top. 2.2 Unzip this at the C:\ root drive. A new folder called LASTools should appear here. IMPORTANT: Really save this in the C:\ root drive as LASTools cannot handle special characters such as space in their pathfinding and it will only cause problems and NOTHING will work. Placing it in the C:\ root drive will make things easier later on. STEP 3: Open QGIS and install plugins. 3.1 Open QGIS, at the top menu, select Plugins>Manage and Install Plugins… a new window will appear. 3.2 In the new window, select “All” in the menu to the left and then search for “LASTools” 3.3 Select LASTools in the search result. 3.4 Select “Install plugin”. 3.5 To ensure it should work as intended, chec it’s options at “Settings>Options” and in the new window, scroll down on the left menu and select “Processing”, and in the new main menu, Select “Providers>LASTools. Chech if it is activated and that the LASTools folder is set to C:\LASTools. Click OK to close the winow. Now you are ready to download LIDAR data in the .las or .laz format. In my case I intend to use it to build a commuter network in the Stockholm region, Sweden, so I have to visit Lantmäteriet and their “shop” Geotorget. It is all in Swedish, which is no problem for me as a swede. I am interested in “Laserdata Nedladdning, Skog” which are laser-scanned data done from airplanes and the point cloud has a point density of 1-2 points per square meter, including everything from rooftops and treetops to elevation and such. - The coverage I wanted to have contained 24,4 GB of data. It’s a lot of data and it will be several gigabytes large files to handle, so only download the files that covers the railway you want to build and a few miles radius from it, the rest can be covered in SRTM data which is not covered in this tutorial. Continued...
CONVERSION Step 4: Place your .las/.laz files in a newly named folder on the desktop. 4.1 Create a new folder and name it something like “Lidar” IMPORTANT: The default name “New folder” won’t work as it contains spaces, and once again, LASTools cannot handle Spaces! As long as the file path is C:\Users\[username_without_space]\Desktop\Lidar then it should be all right. 4.2 Extract and place your .las/.laz files in the Lidar folder. 4.3. Take note of the coordinate reference system (CRS). It will be useful in QGIS once the conversion is done. In my case the CRS I use are SWEREF99 TM + RH2000 Height and it’s ESPG is 5845. You can go to Donnydave’s excellent route creation guide and scroll down to “Converting Lidar data for use in TSW3 Editor using QGIS and getting your terrain in STRM files.” Where he mentions how to add a new CRS for your project. You can do this step once the conversion is done tho, let’s focus on the conversion right now. 4.4 Open QGIS and start a new project. Then select Processing>Toolbox. A new menu called “Processing Toolbox” should open to the right. 4.5 You can use the search field to look after the processes you need, or do like me and navigate trough the menu, either way, to make sure that LASTools are working, we need to check on LASinfo. In the Processing Toolbox menu, you can find it under LAStools>6. Quality Control & Information>lasinfo. Double-click on it and a new window “Lasinfo” will pop up. 4.6 In the new window, press on the […] button at Input LAS/LAZ file and navigate to your file directory, e.g. C:\Users\[username_without_space]\Desktop\Lidar. Select one of your .las/.laz files in your file directory and then “Open”. 4.7 Hit “Run” and wait for a couple of seconds. The end results should show as this: That means that Lasinfo could read your file all right. If it sends out red texts as errors then something is wrong, most likely you didn’t take my advice to put the LASTools files in the C:/ directory or the .Laz/.LAS files is in a filepath containing spaces. Go back to Step 2.2 or step 4.1 and try again. You are now ready to split your .laz/.las files into smaller pieces. Continued...
Step 5: Split the LAZ/LAS files into smaller bits. This is to go around LAStools limit to convert files without getting diagonal watermarks on the converted files. 5.1 In the Processing Toolbox, Search for “lassplit” or navigate to “LAStools>3.Preprocessing>lassplit”. A new window called “Lassplit” will open. 5.2 Click on “Run as a batch” at the bottom left of the new window if you have multiple .laz files to split. 5.3 At the top of the next window, select autofill under “input LAS/LAZ file” and choose “Add All Files from a Directory. Navigate to your folder, e.g. C:\Users\[username_without_space]\Desktop\Lidar and select this folder. All the fields, except the first, will have files selected for them. 5.4 At the first field witch is completely bland, select it by the number “2” to the left and then the – symbol on the top. 5.4.1 (Added new lines to correct the tutorial) At "additional command line parameter(s), Add Code: -split 1000000 at the top row, then on Autofill... dropdown menu, choose "Fill Down" and it will be filled in the whole column. 5.4.2 Optional: At "number of digits for file name" change from 5 to 2 at the top row. (I did not do that initially, so the images below doesn't add up) Then once again Autofill...>Fill Down. 5.5 Over at the rightmost column named “Output LAS/LAZ file, press on the […] button on the first row. In the new “Save file” window, make sure that you are at C:\Users\[username_without_space]\Desktop\Lidar already and at this point, you should create a new folder named “Split”. It is fully possible to do so within the “Save File” explorer. 5.6 There is a bug here, so name the file something.laz (or something.las if you are handling .las files) and select All files (*.*) as the file format, otherwise it will throw a “Invalid file name” error and prompt you to rename it. I named mine Stockholm.laz 5.7 Another window will pop up called “Autofill settings” here I nAutofill mode, select “Fill with numbers” and hit OK. 5.8 Now, all the Output LAS/LAZ file should have a filename and filepath, hit “Run”. Now take a small break, do a short walk or something, since this will take a while. Lassplit had to process 141 .laz files for me and it took approx. 8 secs for each. It depends on your PC so the mileage can vary. You are now ready to convert the split .LAZ/.LAS files into Geotif. Why Geotif? Well, it was easier for me to handle when it was time to merge, warp and split those files in the various LIDAR tutorials I’ve seen in the DTG forums. QGIS worked faster with Geotif as well compared to .asc files that the PC Editor needs later on and the other tutorials here also works with .tif files so I choose it for consistency. Also keep an eye on the processes, for some reason, it randomly gets stuck at some point and won’t batch process any further. If that happens, Force close QGIS trough the task manager, and redo from step 5, but remove the files that has already been processed from the batch list. Also the batch process will include the files from the “Split” folder, make sure to remove those files from the batch list as well. -- Random freezes at Batch-processing is a well-known issue reported over at Github.
Step 6: Convert the splitted .laz files into .tif files. 6.1 In the Processing Toolbox, Search for “blast2dem (folder)” or navigate to “LAStools>5. DSM/DTM Generation & Production>blast2dem (folder)”. A new window called “blast2dem (folder)” will open. 6.2 In Input directory, select […] and navigate to C:\Users\[username_without_space]\Desktop\Lidar\Split and select that folder. 6.3 in filter, on the scroll down menu, select “keep_class 2”. This is so the conversion will only convert the elevation data from the .laz tiles to the .tif files it will generate and nothing else. This is what we want in the PC editor in the end. 6.4 Make sure that the “output format” is set as tif. Leave all the other fields as-is. 6.5 in output directory [optional] press the […] a drop-down menu will appear, choose “Save to Directory…”. 6.6 A new “Select Directory” explorer appears, this time around, I suggest that you go back to the lidar folder and create a new folder called “tif”. Go to that foler and choose this folder. The filepath should be something like C:\Users\[username_without_space]\Desktop\Lidar\tif. 6.7 Hit “run” and relax again, this will once again take a while. Watch as the tif folder grows with .tif files… Congratulations! You now have your .tif files. Place them all in QGIS. You will notice that they have question marks (?) that the right side and if you uses the OSM layer, you will notice that they are somewhere else in the map and not where they are supposed to be. Mark all of them, left-click and choose Layer CRS. And then Choose to whatever EPSG you have noted down when you downloaded your .laz files. My ESPG is 5845 as I said in step 4.3 of the tutorial. Now that they are located where they are supposed to and everything looks all right, you are practically done with the conversion. You can now go to Donnydave’s excellent route creation guide and scroll down to “Converting Lidar data for use in TSW3 Editor using QGIS and getting your terrain in STRM files.” And follow the steps from there, or go to Lulon’s LiDAR Tutorial and follow it from step 3. If, however, you got corrupted 8kb .tif files then something went wrong. You should redo the blast2dem process. And if you see the diagonal lines in some of your raster then they didn’t make it trough the threshold in the splitting process back in step 5.4.1 Good luck and happy landscaping! Update 2023-11-30 #1 Added step 5.4.1 and Step 5.4.2 between step 5.4 and Step 5.5. since I've missed a crucial part in the file splitting process that wouldn't circumnavigate the diagonal watermarkings. //ADDE