## NAME

r3.in.lidar - Creates a 3D raster map from LAS LiDAR points using univariate statistics.

## KEYWORDS

raster3d, import, LIDAR, statistics, conversion, aggregation, binning

## SYNOPSIS

r3.in.lidar
r3.in.lidar --help
r3.in.lidar [-dvopsg] [input=name] [file=name] [n=name] [sum=name] [mean=name] [proportional_n=name] [proportional_sum=name] [return_filter=string] [class_filter=integer[,integer,...]] [base_raster=name] [zscale=float] [intensity_range=min,max] [intensity_scale=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

### Flags:

-d
  Use base raster actual resolution instead of computational region
-v
  Use only valid points
  Points invalid according to APSRS LAS specification will be filtered out
-o
  Override projection check (use current location's projection)
  Assume that the dataset has same projection as the current location
-p
  Print LAS file info and exit
-s
  Scan data file for extent then exit
-g
  In scan mode, print using shell script style
--overwrite
  Allow output files to overwrite existing files
--help
  Print usage summary
--verbose
  Verbose module output
--quiet
  Quiet module output
--ui
  Force launching GUI dialog

### Parameters:

input=name
  LAS input file
  LiDAR input file in LAS format (*.las or *.laz)
file=name
  File containing names of LAS input files
  LiDAR input files in LAS format (*.las or *.laz)
n=name
  Count of points per cell
  Name for output 3D raster map
sum=name
  Sum of values of point intensities per cell
  Name for output 3D raster map
mean=name
  Mean of point intensities per cell
  Name for output 3D raster map
proportional_n=name
  3D raster map of proportional point count
  Point count per 3D cell divided by point count per vertical column
proportional_sum=name
  3D raster map of proportional sum of values
  Sum of values per 3D cell divided by sum of values per vertical column
return_filter=string
  Only import points of selected return type
  If not specified, all points are imported
  Options: first, last, mid
class_filter=integer[,integer,...]
  Only import points of selected class(es)
  Input is comma separated integers. If not specified, all points are imported.
base_raster=name
  Subtract raster values from the z coordinates
  The scale for z is applied beforehand, the filter afterwards
zscale=float
  Scale to apply to Z data
  Default: 1.0
intensity_range=min,max
  Filter range for intensity values (min,max)
intensity_scale=float
  Scale to apply to intensity values
  Default: 1.0

## DESCRIPTION

The r.in.lidar module is very similar to the r3.in.lidar module and many parts of its documentation apply also for r3.in.lidar.

Figure: Proportional count of points per 3D cell. When 50% of all points in a vertical column fall into a given 3D cell, the value is 0.5. Here, the green color was assigned to 0.5, red to 1 and yellow to 0. The figure shows vertical slices and green color indicates high vegetation while red color indicates bare ground.

## NOTES

- This module is new and partially experimental. Please don't rely on its interface and be critical towards its outputs. Please report issues on the mailing list or in the bug tracker.
- No reprojection is performed, you need to reproject ahead or use GRASS Location which has the right coordinate system which fits with the data.
- Some temporary maps are created but not cleaned up. Use of --overwrite might be necessary even when not desired.
- Expects points to have intensity and causing random (undefined) result for related outputs (sum, mean, proportional_sum) when the intensity is not present but the outputs were requested.

## EXAMPLES

### Basic import of the data

Set the region according to a 2D raster and adding 3D minimum (bottom), maximum (top) and vertical (top-bottom) resolution.

    g.region rast=secref b=80 t=160 tbres=5 -p3

Now, r3.in.lidar will create the 3D raster of the size given by the computation region:

    r3.in.lidar input=points.las n=points_n sum=points_sum \
        mean=points_mean proportional_n=points_n_prop \
        proportional_sum=points_sum_prop

### Point density vertical structure reduced to the terrain

Create ground raster:

    r.in.lidar input=points.las output=ground method=mean class_filter=2

Set vertical extent of computational region to (relative) coordinates above ground:

    g.region rast=secref b=0 t=47 -p3

Compute point density:

    r3.in.lidar input=points.las n=points_n sum=points_sum \
        mean=points_mean proportional_n=points_n_prop \
        proportional_sum=points_sum_prop \
        base_raster=ground

### Complete workflow for vertical structure analysis

Compute the point density of points in 2D while setting the output extent to be based on the data (-e) and the resolution set to a relatively high number (here 10 map units, i.e. meters for metric projections).

    r.in.lidar input=points.las output=points_n method=n -e resolution=10

This step can be repeated with using different resolutions (and the --overwrite flag) to determine the resolution for the further analysis.

The class_filter option should be also provided if only part of the points is analyzed, for example `class_filter=3,4,5` would be used for low, medium, and high vegetation if the LAS file follows the usedstandard ASPRS class numbers.

The resolution should be suitable for computing digital elevation model which will be computed in the next steps. Once you decided on the resolution, you can use the 2D raster to set the computational region extent and resolution:

    g.region raster=points_n -p3

`class_filter=2` is used to limit

    r.in.lidar input=points.las output=ground_mean method=mean class_filter=2

The following steps are not necessary if the point density is high enough to fill the raster continuously.

Convert the raster to vector point resulting in a decimated point cloud:

    v.to.rast input=ground_mean type=point output=ground_decimated use=z

Interpolate the ground surface from the decimated ground points:

    v.surf.rst input=ground_decimated elevation=ground

Now we need to determine upper vertical limit for the 3D raster (the top value from `g.region -p3`). This can be potentially done with lower resolution. The -d flag ensures that the ground raster will be used in its actual resolution regardless of the resolution of the output.

    r.in.lidar input=points.las method=max output=veg_max class_filter=3,4,5 base_raster=ground -d

With that, we can finally set up the 3D extent and resolution:

    g.region rast=secref b=0 t=40 res=1 res3=1 -p3

Note that the 2D and 3D resolutions are separate so that user can perform the 2D calculations on a finer resolution than the 3D calculations. The vertical resolution can be and often is set to a different value as well. Here we use the same value for all resolutions for simplicity.

Finally, we perform the 3D binning where we count number of points per cell (voxel):

    r3.in.lidar input=points.las n=n class_filter=3,4,5 base_raster=ground -d

## REFERENCES

- V. Petras, A. Petrasova, J. Jeziorska, H. Mitasova (2016): Processing UAV and lidar point clouds in GRASS GIS. XXIII ISPRS Congress 2016 [ISPRS Archives, ResearchGate]
- ASPRS LAS format
- LAS library
- LAS library C API documentation

## SEE ALSO

r3.in.xyz, r.in.lidar, v.in.lidar, r.to.rast3, r3.to.rast, r3.mapcalc, g.region

## AUTHOR

Vaclav Petras, NCSU GeoForAll Lab

## SOURCE CODE

Available at: r3.in.lidar source code (history)

Accessed: Monday Apr 08 00:23:28 2024

Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2023 GRASS Development Team, GRASS GIS 8.4.0dev Reference Manual