## NAME

v.in.lidar - Converts LAS LiDAR point clouds to a GRASS vector map with libLAS.

## KEYWORDS

vector, import, LIDAR, level1

## SYNOPSIS

v.in.lidar
v.in.lidar --help
v.in.lidar [-pruvetcboi] input=name output=name [id_layer=string] [return_layer=string] [class_layer=string] [rgb_layer=string] [spatial=xmin,ymin,xmax,ymax[,xmin,ymin,xmax,ymax,...]] [zrange=min,max] [return_filter=string] [class_filter=integer[,integer,...]] [mask=name] [mask_layer=string] [skip=integer] [preserve=integer] [offset=integer] [limit=integer] [project=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

### Flags:

-p
  Print LAS file info and exit
-r
  Limit import to the current region
-u
  Invert mask when selecting points
-v
  Use only valid points
  Points invalid according to APSRS LAS specification will be filtered out
-e
  Extend region extents based on new dataset
-t
  Do not create attribute table
-c
  Do not automatically add unique ID as category to each point
  Create only requested layers and categories
-b
  Do not build topology
  Advantageous when handling a large number of points
-o
  Override projection check (use current project's CRS)
  Assume that the dataset has the same coordinate reference system as the current project
-i
  Create the project specified by the "project" parameter and exit. Do not import the vector data.
--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 [required]
  LAS input file
  LiDAR input files in LAS format (*.las or *.laz)
output=name [required]
  Name for output vector map
id_layer=string
  Layer number to store generated point ID as category
  Set to 1 by default, use -c to not store it
return_layer=string
  Layer number to store return information as category
  Leave empty to not store it
class_layer=string
  Layer number to store class number as category
  Leave empty to not store it
rgb_layer=string
  Layer number where RBG colors are stored as category
  Leave empty to not store it
spatial=xmin,ymin,xmax,ymax[,xmin,ymin,xmax,ymax,...]
  Import subregion only
  Format: xmin,ymin,xmax,ymax - usually W,S,E,N
zrange=min,max
  Filter range for z data (min,max)
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.
mask=name
  Areas where to import points
  Name of vector map with areas where the points should be imported
mask_layer=string
  Layer number or name for mask option
  Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.
  Default: 1
skip=integer
  Do not import every n-th point
  For example, 5 will import 80 percent of points. If not specified, all points are imported
preserve=integer
  Import only every n-th point
  For example, 4 will import 25 percent of points. If not specified, all points are imported
offset=integer
  Skip first n points
  Skips the given number of points at the beginning.
limit=integer
  Import only n points
  Imports only the given number of points
project=name
  Name for new project (location) to create

## DESCRIPTION

v.in.lidar converts LiDAR point clouds in LAS format to a GRASS vector, using the libLAS library. The created vector is true 3D with x, y, z coordinates.

For larger datasets, it is recommended to not build topology (-b flag). Also, creating a table with attributes can take some time for larger datasets.

The optional spatial parameter defines spatial query extents. This parameter allows the user to restrict the region to a spatial subset while importing the data. All LiDAR points falling into this rectangle subregion are imported. The -r current region flag is identical, but uses the current region settings as the spatial bounds (see g.region).

A LiDAR pulse can have multiple returns. The first return values can be used to obtain a digital surface model (DSM) where e.g. canopy cover is represented. The last return values can be used to obtain a digital terrain model (DTM) where e.g. the forest floor instead of canopy cover is represented. The return_filter option allows selecting one of first, mid, or last returns.

LiDAR points can be already classified into standardized classes. For example, class number 2 represents ground (for other classes see LAS format specification in references). The class_filter option allows selecting one or more classes, as numbers (integers) separated by comma.

Note that proper filtering of the input points in not only critical for the analysis itself but it can also speed up the processing significantly.

### Decimation

Table with selected percentages of points to keep with corresponding decimation parameters:

percentage | parameters
--- | ---
0.1% | preserve=1000
1% | preserve=100
5% | preserve=20
10% | preserve=10
20% | preserve=5
25% | preserve=4
50% | skip=2
75% | skip=4
80% | skip=5
90% | skip=10

Table with selected fractions of points to keep with corresponding decimation parameters:

ratio | parameters
--- | ---
1/3 | preserve=3
1/4 | preserve=4
1/5 | preserve=5
1/6 | preserve=6

Table with selected fractions of points to throw away with corresponding decimation parameters:

ratio | parameters
--- | ---
1/3 | skip=3
1/4 | skip=4
1/5 | skip=5
1/6 | skip=6

## Project Creation

v.in.lidar attempts to preserve coordinate reference system (CRS) information when importing datasets if the source format includes such information, and if the LAS driver supports it. If the source dataset CRS does not match the CRS of the current project (previously called location) v.in.lidar will report an error message ("`Coordinate reference system of dataset does not appear to match current project`") and then report the PROJ_INFO parameters of the source dataset.

If the user wishes to ignore the difference between the coordinate system of the source data and the current project, they may pass the -o flag to override the CRS check.

If the user wishes to import the data with the full CRS definition, it is possible to have v.in.lidar automatically create a new project based on the CRS and extents of the file being read. This is accomplished by passing the name to be used for the new project via the project parameter. Upon completion of the command, a new project will have been created (with only a PERMANENT mapset), and the vector map will have been imported with the indicated output name into the PERMANENT mapset.

## NOTES

The typical file extensions for the LAS format are .las and .laz (compressed). The compressed LAS (.laz) format can be imported only if libLAS has been compiled with laszip support. It is also recommended to compile libLAS with GDAL, needed to test for matching CRSs.

## EXAMPLE

The sample LAS data are in the file "Serpent Mound Model LAS Data.laz", available at Serpent Mound Model LAS Data.laz

    # print LAS file info
    v.in.lidar -p input="Serpent Mound Model LAS Data.laz"

    # create a project with CRS information of the LAS data
    v.in.lidar -i input="Serpent Mound Model LAS Data.laz" project=Serpent_Mound

    # quit and restart GRASS in the newly created project "Serpent_Mound"
    # real import of LiDAR LAS data, without topology and without attribute table
    v.in.lidar -tb input="Serpent Mound Model LAS Data.laz" output=Serpent_Mound_Model_pts

## REFERENCES

ASPRS LAS format
LAS library
LAS library C API documentation

## SEE ALSO

r.in.lidar, r3.in.lidar, g.region, v.vect.stats, v.in.ogr

## AUTHORS

Markus Metz
Vaclav Petras, NCSU GeoForAll Lab (decimation, cats, areas, zrange)
based on v.in.ogr by various authors

## SOURCE CODE

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

Latest change: Tuesday Dec 17 20:17:20 2024 in commit: d962e90c026708a4815ea2b9f46c0e84c17de22d

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual