LasIndexer

LasIndexer indexes a folder of LAS files, so that it can be used as a single survey: the lidar modules take its main index, index.lasfolder, in place of a LAS file, and read only the parts of the files in the area they work on. Each file is rewritten with its points sorted by cells, next to the index of its cells.

Details

Each las file of the folder, without its subfolders, is rewritten with its points sorted by cells of about the given size, as name_indexed.las, next to a name_indexed.lasfix file with the index of the cells: the bounds of each cell, the range of its points in the file and their average elevation and intensity. The size of the cells is adjusted to divide the bounds of the file in equal cells. The main index, in the folder, knows the bounds of all the files, with the reference system in a prj file next to it.

The modules that read lidar data, as Las2RasterInterpolator, take the main index in place of a las file: for an area they read only the cells of the files that cross it. A folder of files of a few square kilometers can then be used as a single survey, without reading all its points for a small area.

The files already indexed, with both the indexed las and its index, are left as they are, so that new files can be added to the folder and indexed again; a file with only one of the two is indexed again. The indexed files double the space of the survey: the original files are still needed only to index them again. The reference system is the given one, or the one of the prj file of the first file: without either the module stops.

Parameters

Indexes a folder of las files, so that the lidar modules read only the points of the area they work on.

Toolbox folder: Lesto › utilities
Status: Experimental
Keywords: las, lidar
Authors: Andrea Antonello
Class: org.hortonmachine.gears.io.las.index.LasIndexer

Inputs

Parameter

Type

Unit

Default

Description

inFolder

folder

The folder containing the las files to index.

pIndexname

String

index.lasfolder

The name for the main index file, written in the folder: the extension .lasfolder is added if missing.

pCode

CRS code

The optional code defining the target coordinate reference system. This is needed only if the file has no prj file. If set, it will be used over the prj file.

pCellsize

double

5.0

The size of the cells into which to split the las file for indexing (in units defined by the projection).

doOverview

boolean

false

If true, also writes a shapefile of the outlines of the files, as the convex hulls of their points, named as the main index.

pThreads

int

1

The number of files indexed at the same time.

Example

The index of the four pieces of the sample survey written by LasSplitter, in cells of 5 m, with the overview of their points:

import org.hortonmachine.gears.io.las.index.LasIndexer

// the folder with the lidar survey: change it to yours
var folder = "/data/flanginec/"

// index the four pieces of LasSplitter in cells of 5 m, with an overview of their points
var indexer = new LasIndexer()
indexer.inFolder = folder + "las_pieces"
indexer.pCellsize = 5.0
indexer.doOverview = true
indexer.process()

The folder las_pieces gets the main index index.lasfolder with its prj file, the overview index.shp, and for each piece the indexed file and its index, as uni_bz_plot777_1_indexed.las and uni_bz_plot777_1_indexed.lasfix. The modules then read the whole survey from las_pieces/index.lasfolder.