The SPD file format was designed around storing LiDAR pulses with digitised waveforms and associated points. The most recent version (3.3) has the ability to import waveform data from LAS files using LASlib, which is part of LAStools. Currently binaries are only available for Linux (although binaries for OS X are planned), they can be installed through conda.
conda install -c rios -c conda-forge spdlib
Windows users are advised to install using a Linux Virtual Machine. This post also has more details on installing conda.
For this example LAS 1.3 files acquired by the NERC Airborne Research Facility (NERC-ARF, previously ARSF) over Borneo using a Leica ALS50-II instrument with full waveform digitiser will be used.
Once you have registered with NEODC and applied for access to the ARSF archive these data can be downloaded from: http://browse.ceda.ac.uk/browse/neodc/arsf/2014/RG13_06/RG13_06-2014_303_Maliau_Basin/LiDAR/flightlines/fw_laser/las1.3
You can also follow through with any of the other NERC-ARF datasets or other waveform LAS files you have.
- Convert LAS to SPD format
First you need a WKT file to define the projection. This step is optional but is more reliable than reading from a LAS file. For the example the projection is UTM50N, you can download a WKT file using:
Then convert to an unsorted SPD file (UPD).
spdtranslate --if LAS --of UPD \ -x LAST_RETURN \ --input_proj UTM_WGS84_Z50_N.wkt \ -i LDR-FW-RG13_06-2014-303-05.LAS \ -o LDR-FW-RG13_06-2014-303-05.spd
- Subset SPD file (optional)
As full waveform processing is quite intensive it is recommended to subset the data for the purpose of running though this tutorial, you can do this using the spdsubset command.
spdsubset --xmin 494400 --ymin 524800 \ --xmax 494800 --ymax 525000 \ -i LDR-FW-RG13_06-2014-303-05.spd \ -o LDR-FW-RG13_06-2014-303-05_subset.spd
- Decompose waveform
One of the limitations of discrete systems is there is are only a given number of ‘points’ recorded (normally 2 – 4) and the rest of the information is lost. As full waveform data records the entire waveform it is possible to extract more returns after data are acquired. A common approach to this ‘Gaussian Decomposition’ which involves fitting Gaussian distributions to the peaks, within SPDLib this is available as the ‘spddecomp’ command.
spddecomp --all --noise --threshold 25 \ -i LDR-FW-RG13_06-2014-303-05_subset.spd \ -o LDR-FW-RG13_06-2014-303-05_subset_decomp.spd
This will still take around 5 minutes to run. If you decide to decompose the full dataset after, expect it to take an hour or so.
- Export returns to LAS file
The final step for this part of the tutorial is to export the returns to a LAS file, using the spdtranslate command.
spdtranslate --if SPD --of LAS \ -i LDR-FW-RG13_06-2014-303-05_subset_decomp.spd \ -o LDR-FW-RG13_06-2014-303-05_subset_decomp.las
The next part of the tutorial will cover more tools in SPDLib for classifying ground returns and calculating LiDAR metrics.
If you have further questions about using SPDLib please contact the mailing list (details available from https://lists.sourceforge.net/lists/listinfo/spdlib-develop). If you have any questions about working with NERC-ARF data contact the NERC-ARF Data Analysis Node (NERC-ARF-DAN) see https://nerc-arf-dan.pml.ac.uk/ or follow us on twitter: @NERC_ARF_DAN).