Simplified LAS structure
- Public Header Block: signature, version, point format, record length, point count, scale, offset, bounds, and point-data offset.
- Variable Length Records (VLRs): coordinate reference, extra bytes, waveform, and other metadata.
- Point records: integer X/Y/Z plus fields defined by the selected point format.
- Extended Variable Length Records (EVLRs): optional extended metadata, especially in LAS 1.4.
LAZ uses the same logical point-cloud model but compresses the point records. A conforming LAS/LAZ library should be used rather than treating LAZ as uncompressed LAS.
Practical reading sequence
- Open the source as a LAS or LAZ stream.
- Validate the
LASFsignature and supported version. - Read point format, record length, point count, and point-data offset.
- Read scale, offset, and coordinate bounds.
- Inspect relevant VLR and EVLR metadata.
- Stream point records sequentially.
- Decode coordinates and optional attributes according to the point format.
- Apply tile and height selection.
- Write selected points with compatible output metadata.
Coordinate decoding
double x = rawX * scaleX + offsetX;
double y = rawY * scaleY + offsetY;
double z = rawZ * scaleZ + offsetZ;
Streaming selection
while (reader.readNext(point)) {
TileIndex tile = getTile(point);
if (!keepPoint(point, tile, selection))
continue;
writer.write(point);
}
The important rule is to preserve scale, offset, point format semantics, and metadata intentionally. Reading coordinates correctly is not enough if the output silently changes classification, return information, GPS time, RGB, or coordinate reference information.
What is a LAS point-cloud file?
LAS is a binary point-cloud format widely used for LiDAR data. Its header and point-record definitions make it more self-describing than raw XYZ text, while scale and offset values allow large coordinates to be represented compactly.
LAS vs E57 for large point clouds
Both formats can contain very large point sets, but they organise metadata and records differently. A robust large-file workflow should stream either format rather than make memory usage proportional to the total number of points.