2

I'm looking to convert a LIDAR scan in .laz format into a DSM in ASCII Grid format, in order to calculate RF propagation in an urban environment from a given transmission location (bonus: converting the georeferencing from NAD83 to WGS84).

My source data is a set of scans from NOAA, and I'm working to ingest them into another application which wants it in .asc format, like so:

ncols        2454
nrows        1467
xllcorner    -1.475333294357
yllcorner    53.378635095801
cellsize     0.000006170864
NODATA_value      0
0 0 0 0 0 0 0 0 0 0 0 0 0 ...

Being able to batch-process the data would definitely desirable.

1

As mentioned by Aaron, the CanopyModel tool from Fusion can build Digital Surface Models (DSM).

In order to directly use the compressed LiDAR files .laz as input of CanopyModel, it is necessary to have the file LASzip.dll from LASzip program installed within Fusion's install folder.*

By default the CanopyModel will assign the elevation of the highest return within each grid cell to the grid cell center. Some alternative settings for the tool are available through the switches, such as smoothing filters. For example, see: How to de-noise a DSM.

In your case, it is wanted to export the DSMs as .asc files, so use the switch ascii (the default exports it as .dtm). According to Fusion's manual:

ascii. Write the output surface in ASCII raster format in addition to writing the surface in DTM format.

Then, the CanopyModel syntax would look like the following:

\CanopyModel /ascii \surfacefile cellsize xyunits zunits coordsys zone horizdatum vertdatum \datafile1

The CanopyModel tool can be easily used in batch-processing as it is a stand alone program (.exe). Moreover, the datafile argument (which is the input file, i.e. the raw .laz file) supports wildcard or name of text file listing the data files.

*If one wants to use one program at a time, first decompress the .laz files (see: Converting LiDAR files from LAZ to LAS format), and then, run CanopyModel using .las format.

  • This worked great for me. A couple of notes: for me, the entry for output cell size needed to be in decimal degrees, not meters (this gave me an output of ~4 total points). A good tutorial I found was this one over at the US Forestry Service. – CableBox Nov 17 '16 at 4:36
  • @CableBox, what do you mean with "output of approximate 4 total points"?. I never worked before with point clouds in geographic coordinates (only in projected ones), so not sure what are the options to your case. – Andre Silva Dec 9 '16 at 10:09
  • Also, be aware that working with raster in units of decimal degrees can be tricky if one needs the information of area. See: gis.stackexchange.com/questions/59070/… – Andre Silva Dec 9 '16 at 12:19
2

One caveat to using FUSION: it truncates the precision of the output coordinates to only 4 decimal places, and I required 6. I really wanted to use WhiteBox GAT, however I was unable to get it to perform the nearest-neighbor processing (it kept insisting that the units from my files were in meters, not decimal degrees)

I ended up using SAGA GIS on the command line (functions on Windows and Linux - there's a Mac port in Brew but it's several revisions behind and didn't have LAS support).

I did a very rough job and simply converted the LAS point cloud directly into a raster grid via performing mean sampling for every grid square. As a result, the output file has a lot of holes. This could be fixed with one of the Gridding tools such as triangulation, nearest-neighbor, etc. However, those tools hung the app, possibly due to the sheer size of the dataset. For my purposes, simply sampling works fine, and has the added benefit of being significantly faster to process, as the performance is gated by I/O rather than CPU (SAGA has the side benefit of being more multi-core aware, as opposed to FUSION).

Rough steps which can be done in the GUI:

  1. Import LAS file to a Point Cloud file
  2. Use Point Cloud to Grid tool and set the Cellsize value – I used 0.00001 to represent the resolution in decimal degrees I required (going beyond that significantly increased computation and file size requirements)
  3. Export data in ESRI ASCII Grid format

I also needed to use las2las.exe to move the data from LAZ to LAS format, since SAGA doesn't support LAZ yet.

The following is the Windows batch script which I used to successfully process ~450 files

REM ********************************* PATHS ***********************************
REM Path to saga_cmd.exe and LAStools
set PATH=%PATH%;C:\SAGA;C:\laser\LAStools\bin

REM Path to working dir
SET WORK=C:\laser
REM ***************************************************************************


FOR /F %%i IN ('dir /b %WORK%\*.laz') DO (
cd /d %WORK%

saga_cmd io_shapes_las 1 ^
-FILES=%WORK%\%%~ni.las ^
-POINTS=%WORK%\%%~ni ^
-T=0 -i=0 -a=0 -r=0 -c=0 -u=0 -n=0 -R=0 -G=0 -B=0 -e=0 -d=0 -p=0 -C=0 ^
-VALID=0 -RGB_RANGE=0

saga_cmd pointcloud_tools 4 ^
-POINTS=%WORK%\%%~ni.spc ^
-GRID=%WORK%\%%~ni ^
-OUTPUT=0 -AGGREGATION=0 ^
-CELLSIZE=0.00001

saga_cmd io_grid 0 ^
-GRID=%WORK%\%%~ni.sdat ^
-FILE=%WORK%\%%~ni.asc ^
-FORMAT=1 -GEOREF=0 -PREC=6 -DECSEP=0

del *.mgrd
del *.mpts
del *.sgrd
del *.spc
del *.sdat
)

PAUSE

Note that if you're working with .LAZ files, you'll need to uncompress them to .LAS format with las2las, like below:

las2las.exe -i %%i -o %%~ni.las

and probably of these to delete it too

del *.las

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.