Skip to content

Tile LiDAR Data

Splits the LiDAR files of a folder into square tiles sized by the point density, and writes them to a new folder. It uses the same plan as the processing tools when they tile the data themselves (see How the LiDAR Tools Tile a Point Cloud): the data is divided into 500 m blocks, and each block gets the largest of 500, 250, 125 or 100 m tiles whose densest tile, with its buffer, fits in the free memory.

Tiling ahead of time is useful when:

  • the input is a few very large files, or files whose density varies a lot, and you will run several tools on it: the tiles are cut once, and each tool then processes them by file;
  • you want the tiles themselves, for example to share or inspect part of the data;
  • you want uniform tiles from a tool's tiled point cloud output, whose tiles vary from 500 m down to 100 m: run this tool on the output folder with tile_size set to 500 (or 1000) and buffer to 0, once the chain of tools is done. The tiles combine into exact 500 m blocks.

The points are copied as they are, noise included, and streamed from file to file, so cutting the tiles needs about one R session of memory (~1.6 GB) per worker. More workers can therefore cut tiles than the processing tools would start.

Output, in out_folder:

  • one tile per file, named by its lower-left corner, for example 520250_6228125.laz;
  • tiles.csv, the tile size of each 500 m block (bx, by, size), which a resumed run reuses;
  • a .lax spatial index for each tile, so a tool reading a tile's buffer from its neighbours reads only that strip.

The tiles are sized for the memory free when this tool runs. A tool that processes them later with tiling set to auto processes them by file when they all fit in its free memory, and otherwise tiles the data again itself, so run it with about as much memory free.

Parameter Type Required Description
in_las_folder directory Yes Folder containing the input LAS/LAZ files.
out_folder directory (output) Yes Folder for the tiles. It must differ from the input folder.
buffer float No Buffer (m) a tool reads around each tile when it processes the tiles later: 20 for ground classification, 30 for the other tools. It only sizes the tiles; they are cut without a buffer. The default is 30.
tile_size float No 0 sizes the tiles by the point density (500 to 100 m). Any other value is one tile size in metres for all the data. The default is 0.
laz bool No True writes LAZ tiles, about a third of the size of LAS; False writes LAS, which is faster to read. The default is True.
skip_existing bool No Set to True to resume a run that stopped: tiles already written completely are not cut again, and the tile sizes are read from tiles.csv. The default is False.
processes int No Most R workers to cut tiles with.
from beratools.modules.pc2products.rpy_lidar_tile import rpy_lidar_tile

rpy_lidar_tile(in_las_folder="tests/data/LiDAR", out_folder="tests/data/LiDAR/Tiles")

Command line

bt tile   # show the parameters
bt tile --in_las_folder <las_dir> --out_folder <tile_dir>
bt tile --in_las_folder <las_dir> --out_folder <tile_dir> --buffer 20 --laz false
bt tile --in_las_folder <las_dir> --out_folder <tile_dir> --tile_size 250