Skip to content

Las io#17

Merged
tim-devereux merged 5 commits into
Leaf2Landscape:mainfrom
tim-devereux:las_io
May 19, 2026
Merged

Las io#17
tim-devereux merged 5 commits into
Leaf2Landscape:mainfrom
tim-devereux:las_io

Conversation

@tim-devereux

Copy link
Copy Markdown
Collaborator

No description provided.

- LasRayCloudWriter and LasWriter now write LAS 1.4 (version_minor=4,
  point formats 7 and 6 respectively) instead of LAS 1.2
- passthrough expanded from 6 to 8 bytes/point using LAS 1.4 extended
  fields (extended_return_number, extended_classification, extended_scan_angle etc.)
- LAS 1.2 sources converted to 8-byte LAS 1.4 layout on read
- Both LasWriter and LasRayCloudWriter destructors now patch the LAS 1.4
  64-bit extended point count at header offset 247 in addition to the
  legacy 32-bit count at offset 107
- All tool output filenames now inherit the input file extension (.las,
  .laz, or .ply) instead of hardcoding .las
- raysplitter splitGrid and splitColour output files also use input extension
LASzip rejects writes with version_minor=4 unless header_size is
at least 235 (LAS 1.3+). Correct LAS 1.4 header is 375 bytes.
LASzip internally uses the LAS 1.2 default header size (227) when
computing offset_to_point_data during VLR additions. After all VLRs
are added, adjust offset_to_point_data by +148 (375-227) in
LasRayCloudWriter, and set it explicitly to 375 for LasWriter and
writeLas which have no VLRs.

Also fix rayimport: always add _raycloud suffix so the output file
never conflicts with the input file. Preserves .laz extension for
.laz inputs.
All raycloudtools that read and write LAS/LAZ files now pass the
original sensor extra-byte VLR through unchanged, so attributes like
InternalTime, Amplitude, BeamDirection, etc. survive every pipeline
step: rayimport, raydecimate, raycolour, raytranslate, raysplit
(all split modes), raycombine, raysmooth, raydenoise.

Key changes:
- raylaz: add readLasExtraBytesVlr helper; stream passthrough bytes
  (8 std LAS fields + orig sensor bytes) alongside each point;
  fix has_tree_id_attr detection from VLR instead of byte count
- raycloudwriter: accept extra_bytes_vlr in begin() and register
  attributes before opening the laszip writer
- raycloud: convertCloud (used by raytranslate/rayrotate) now
  pre-reads VLR and routes passthrough bytes per chunk
- raysplitter: all six split functions (split, splitPlane,
  splitCapsule, splitBox, splitGrid, splitColour) pre-read VLR,
  pass it to every CloudWriter::begin call, and copy passthrough
  bytes to each output sub-ray including clipped pieces
- raydecimation: streaming raydecimate passes passthrough through
- raycolour, raycombine, rayimport, rayterrain: same pattern
@tim-devereux tim-devereux merged commit 2b465a4 into Leaf2Landscape:main May 19, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant