Latvia, officially the Republic of Latvia, is a country in the Baltic region of Northern Europe has around 2 million inhabitants, a territory of 65 thousand square kilometers and – since recently – also a fabulous open LiDAR policy. Here is a list of 65939 tiles in LAS format available for free download that cover the entire country with airborne LiDAR with a density from 4 to 6 pulses per square meters. The data is classified into ground, building, vegetation, water, low noise, and a few other classifications. It is licensed Creative Commons CC0 1.0 – meaning that you can copy, modify, and distribute the data, even for commercial purposes, all without asking permission. And there is a simple and functional interactive download portal where you can easily download individual tiles.
We downloaded the 5 by 5 block of square kilometer tiles matching “4311-32-XX.las” for checking the quality and creating a 1m DTM and a 1m DSM raster. You can follow along after downloading the latest version of LAStools.
We first run lasvalidate and lasinfo on the downloaded LAS files and then immediately compress them with laszip because multi-core processing of uncompressed LAS files will quickly overwhelm our file system, make processing I/O bound, and result in overall longer processing times with CPUs waiting idly for data to be loaded from the drives.
lasinfo -i 00_tiles_raw\*.las ^ -compute_density ^ -histo z 5 ^ -histo intensity 256 ^ -histo user_data 1 ^ -histo scan_angle 1 ^ -histo point_source 1 ^ -histo gps_time 10 ^ -odir 01_quality -odix _info -otxt ^ -cores 3
lasvalidate -i 00_tiles_raw\*.las ^ -no_CRS_fail ^ -o 01_quality\report.xml
Despite already excluding a missing Coordinate Reference System (CRS) from being a reason to fail (the lasinfo reports show that the downloaded LAS files do not have any geo-referencing information) lasvalidate still reports a few failing files, but scrutinizing the resulting XML file ‘report.xml’ shows only minor issues.
Usually during laszip compression we do not alter the contents of a file, but here we also add the EPSG code 3059 for CRS “LKS92 / Latvia TM” as we turn bulky LAS files into slim LAZ files so we don’t have to specify it in all future processing steps.
laszip -i 00_tiles_raw\*.las ^ -epsg 3059 ^ -cores 2
Compression reduces the total size of the 25 tiles from over 4.1 GB to below 0.6 GB.
Next we use lasgrid to visualize the last return density which corresponds to the pulse density of the LiDAR survey. We map each 2 by 2 meter pixel where the last return density is 2 or less to blue and each 2 by 2 meter pixel it is 8 or more to red.
lasgrid -i 00_tiles_raw\*.laz ^ -keep_last ^ -step 2 ^ -density_16bit ^ -false -set_min_max 2 8 ^ -odir 01_quality -odix _d_2_8 -opng ^ -cores 3
This we follow by the mandatory lasoverlap check for flight line overlap and alignment where we map the number of overlapping swaths as well as the worst vertical difference between overlapping swaths to a color that allows for quick visual quality checking.
lasoverlap -i 00_tiles_raw\*.laz ^ -step 2 ^ -min_diff 0.1 -max_diff 0.2 ^ -odir 01_quality -opng ^ -cores 3
The results of the quality checks with lasgrid and lasoverlap are shown below.
Raster Derivative Generation
Now we use first las2dem to create a Digital Terrain Model (DTM) and a Digital Surface Model (DSM) in RasterLAZ format and then use blast2dem to create merged and hill-shaded versions of both. Because we will use on-the-fly buffering to avoid edge effects along tile boundaries we first spatially index the data using lasindex for more efficient access to the points from neighboring tiles.
lasindex -i 00_tiles_raw\*.laz ^ -cores 3 las2dem -i 00_tiles_raw\*.laz ^ -keep_class 2 9 ^ -buffered 25 ^ -step 1 ^ -use_orig_bb ^ -odir Latvia\02_dtm_1m -olaz ^ -cores 3 blast2dem -i 02_dtm_1m\*.laz ^ -merged ^ -hillshade ^ -step 1 ^ -o dtm_1m.png las2dem -i 00_tiles_raw\*.laz ^ -drop_class 1 7 ^ -buffered 10 ^ -spike_free 1.5 ^ -step 1 ^ -use_orig_bb ^ -odir 03_dsm_1m -olaz ^ -cores 3 blast2dem -i 03_dsm_1m\*.laz ^ -merged ^ -hillshade ^ -step 1 ^ -o dsm_1m.png
Because the overlaid imagery does not look as nice in our new Google Earth installation, below are the DTM and DSM at versions down-sampled to 25% of their original size.
Many thanks to SunGIS from Latvia who tweeted us about the Open LiDAR after we chatted about it during the Foss4G 2019 gala dinner. Kudos to the Latvian Geospatial Information Agency (LGIA) for implementing a modern national geospatial policy that created opportunity for maximal return of investment by opening the expensive tax-payer funded LiDAR data for re-purposing and innovation without barriers. Kudos!