Lesson 10e2: Using LASzip to Decompress Lidar

Video Transcript
Download Video
Right-click and save to download

Detailed Description

By the end of this lesson, you will understand the difference between the LAS and LAZ format, know where to download the laszip.exe tool, and how to decompress a LAZ file to a LAS file using laszip.exe. The USGS offers other lessons on using LAS files in ArcGIS Pro, Global Mapper, and LP360.
 

Details

Date Taken:

Length: 00:09:29

Location Taken: Augusta, ME, US

Transcript

The National Map is a collection of mapping products and services produced by the USGS National Geospatial Program.   The products and services are accessed via the internet through service calls and graphical user interfaces.  The National Geospatial Program has released a series of “how to” videos for people who are working with The National Map data and services.  The videos show how to use the services and interfaces to access data and tools for viewing, analyzing and printing geospatial data.   The training materials are a mixture of video and PowerPoint-based lessons.  Lessons 1 and 2 serve as an introduction to the training materials.  The remaining lessons are designed as quick “how to’s” and may be viewed as needed, in any order, depending on the user.

Any use of trade, product, or firm names is for descriptive purposes only and does not imply endorsement by the U.S. Government.

Lesson 10e2: Using LASzip to Decompress Lidar. The United States Geological Survey hosts lidar data in LAZ 1.4 format. LAZ is a compressed version of a typical LAS lidar tile. Like a .zip file, a LAZ lidar tile is much smaller than the same LAS tile. However, you can use a tool called LASzip to Decompress a LAZ file.

By the end of this lesson, you will understand the difference between the LAS and LAZ format, know where to download the laszip.exe tool, and how to decompress a LAZ file to a LAS file using laszip.exe. The USGS offers other lessons on using LAS files in ArcGIS Pro, Global Mapper, and LP360.

Before we begin, you’ll want to download some lidar data to use during our exercise. The National Map has a download client where you can find USGS products to include elevation data such as lidar point clouds at https://viewer.nationalmap.gov/basic/. If you are interested in learning more about downloading products from The National Map, be sure to check out our training videos located at: http://www.usgs.gov/NGPvideos.

However, for this lesson, we’ve conveniently packaged four tiles of LAZ data into a zip file called LAZ_Example_Data.zip and loaded it to our FTP site at: ftp://rockyftp.cr.usgs.gov/Training_Data/. Please navigate to this location and download the zip package. This may take a few minutes.

After you’ve downloaded the lidar data, extract the zip file into a folder on your local computer to use during the lesson.

The LAS format contains the lidar point cloud data records. It is an open source public file format that is maintained by the American Society of Photogrammetry and Remote Sensing. The current version is LAS 1.4 R14. If you would like to learn more about the current version, refer to the ASPRS website.

Lidar systems combine the location information from a Global Navigation Satellite System, an inertial measurement unit, and laser pulse angle and range data to determine the location of objects on the ground. A LAS formatted dataset contains metadata and the X, Y, and Z coordinates for a point cloud as well as additional information such as intensity, return number, number of returns, classification, and other fields. USGS used to distribute lidar data exclusively in the LAS format. However, we switched to the LAZ format in 2019 to lower data storage and download expenses.

LAZ is a free open source product developed by a company called rapidlasso. It is a lossless compression format that retains all the information in a LAS file, but at a reduced file size of 7-20% of the original. Many computer programs natively support the LAZ format, including Global Mapper, QT Modeler, FME, ERDAS IMAGINE and ENVI. However, several software products, such as Esri’s ArcGIS Pro and Qcoherent’s LP360 require you to convert the LAZ into LAS first. LASzip is a free tool under the LAStools library that can easily convert files from LAS to LAZ or from LAZ to LAS.

LASzip is available as an open source code and as a Windows binary executable file. For this lesson, we will use the Windows executable file located at http://lastools.org/download/laszip.exe.

Go ahead and download laszip.exe to your local computer to the same location that you saved the unzipped lesson data.

Here you can see the four LAZ files you downloaded and extracted earlier in the lesson.

Note the four files combined are 166 MBs. The original LAS formatted lidar data is 1.3 GBs so these are 13% of the original file size.

We’ll now launch the software.

You may require administrative privileges on your system to run the executable, so please ensure you have that before running the software.

Also, your computer anti-virus software may warn you not to run the executable because it is from an unrecognized publisher. The software is safe so you can choose to run it. You should only see this warning the first time you launch the program. Alternately, Windows may ask you to search for an app to open the program. Just click No if you get this window.

The LASzip interface will open. It looks complicated, but is simple to run. You can browse to the LAS files, filter your data by coordinate, classification or return, transform your point cloud data by shifting or scaling your data, set a new projection, or load overlays. This is beyond the scope of this lesson, but please feel free to experiment with these options on your own.

When you expand the browse option, you will see the folder that you stored the laszip.exe file in. If it’s the same location as where you unzipped the lesson data, you should see a folder called LAZ_Example_Data. Double click on this folder to view the four LAZ files. If you do not see this folder, you can type the appropriate drive name and click the go button to browse to the correct location. By default, LASzip should see both .las and .laz files. Click the add button to add the four laz files to your workspace.

You can choose to do only a selected file by highlighting the appropriate wireframe in the view window or by highlighting the file name in the top left and choosing the option to ‘use selected file only’. We will decompress all four tiles at once so just make sure the ‘process all files’ button is selected.

If you expand the output option, you can select the folder where you want to decompress the lidar data. If you leave this option blank, it will default to the same location as the LAZ data. To change this option, you can click the ‘… ‘button and change your directory and folder or create a new folder. We will just keep the outputs in the same directory.

If you’re decompressing dozens or hundreds of laz files, you can increase the number of CPU cores you want to use in the tool by expanding the job on cores button. Increasing the number of cores would decrease the processing time. Since this is a small job, we only need one core so we’ll keep the run 1 job option selected.

When you are happy with your choices, click the DECOMPRESS button to convert the LAZ to LAS format.The program will show a summary of the LASzip command in a separate RUN window. Click START to run the tool.

The program does not show you its progress, but the RUN window will go away when all of your LAZ files are decompressed. In Windows explorer, browse to the appropriate folder and you should see four new las files.

You can now use these LAS files in programs that cannot natively read LAZ files. You can use the same tool to compress LAS files into LAZ files. You would simply change the wildcard to .las, browse to the folder where you have LAS data, and click the COMPRESS button.

Congratulations! You’ve finished Lesson 10e2: Using LASzip to Decompress Lidar.

During this lesson, you learned about the LAS and LAZ format, where to download the laszip.exe tool, and how to decompress LAZ files into LAS files. Be sure to check out our other lidar training videos located in the lesson 10 area on https://usgs.gov/NGPvideos. Thanks for your time!