DatabaseLasWriter

DatabaseLasWriter inserts the LAS files of a folder into a spatial database, spatialite or H2GIS: the points grouped in cells, with their summaries, and coarser levels of summaries over them. The lidar modules read the database in place of a LAS file, and the 3D viewer draws it quickly at any scale, from the levels when far and from the cells when near.

Details

The database gets three kinds of tables:

  • lassources, with a row per las file: its bounds, name, range of elevations and intensities, and the cell size, levels and factor used;

  • lascells, the cells of the given size that have points, with their number, the average, lowest and highest elevation and intensity, the times, and all their points, as blobs of coordinates, intensities and classes, returns, times and colors;

  • laslevels1, laslevels2 and so on, the summaries of the levels: squares with the average, lowest and highest elevation and intensity of the cells, for the first level, or of the squares of the level before, inside them.

The squares of a level are as large as the cell size times the factor times the number of the level: with cells of 3 m and a factor of 5, 15 m at the first level, 30 m at the second and 45 m at the third. The averages of a square are the averages of the averages of the cells or squares in it, not weighted by their points.

The files already in the database, by name, are skipped, so a folder can be added to again. The colors come from the points, or, with an image mosaic of orthophotos, from its three bands at each point, white outside of it. The reference system is the given one, or the one of the first prj file of the folder; without either it is set to EPSG:4326, which is right only for data in longitude and latitude.

The lidar modules read the database in place of a las file, and the 3D viewer shows its levels and cells.

Parameters

Inserts the las files of a folder into a spatialite or H2GIS database, in cells with summaries at coarser levels, for quick reading and viewing of large surveys.

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

Inputs

Parameter

Type

Unit

Default

Description

inFolder

folder

The folder containing the las files to insert.

pDbType

String

SPATIALITE

The type of the database. Allowed values: SPATIALITE, H2GIS.

inOrtophoto

vector file

The optional image mosaic of orthophotos, by its shapefile index, with 3 bands, to take the colors of the points from.

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

3.0

The size of the cells into which the points are grouped (in units defined by the projection).

pLevels

int

2

Number of data summary levels to add.

pFactor

int

5

The factor of the size of the squares of the levels: the size of the cells times the factor times the number of the level.

doEmptyCells

boolean

false

Flag to define if empty cells should also be written into the database.

doAvoidIndex

boolean

false

Flag to define if the spatial index creation should be ignored (will not create levels).

inLasNames

List

Optional las list names to process only those (inside las folder).

Outputs

Parameter

Type

Unit

Description

inDatabasePath

output file

The database to write to, new or existing: if it does not exist it is created, otherwise the las files are added to it.

Example

The four pieces of the sample survey written by LasSplitter, in a spatialite database with cells of 1 m and two levels, of 5 and 10 m:

import org.hortonmachine.gears.io.las.databases.DatabaseLasWriter

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

// the four pieces of LasSplitter in a spatialite database, in cells of 1 m
// with two levels of summaries over them
var writer = new DatabaseLasWriter()
writer.inFolder = folder + "las_pieces"
writer.inDatabasePath = folder + "las_pieces.sqlite"
writer.pDbType = "SPATIALITE"
writer.pCellsize = 1.0
writer.pLevels = 2
writer.pFactor = 5
writer.process()

The database las_pieces.sqlite has the four pieces in the table lassources, their points in the cells of lascells and the summaries in laslevels1 and laslevels2.