mfbonfigli / gocesiumtiler

A Cesium.js point cloud 3D tiles generator from LAS files written in Golang
GNU Lesser General Public License v3.0
169 stars 36 forks source link

Fix multiple files processing bug and LAS RGB color parsing logic. #24

Closed mfbonfigli closed 2 years ago

mfbonfigli commented 2 years ago

Fixes a bug preventing the processing of multiple files when using the -f flag due to a resue of a non empty octree structure. The issue here is that previously a tree data structure was initialized at the moment of the instantiation of the algorithm manager, rather than on request. The fix is thus to instantiate and return the data structure when GetTreeAlgorithm is invoked.

Fixes a bug in the logic to parse RGB point colors occurring in case of LAS point records containing custom metadata and non standard length. The las library that is used apparently was not following correctly the LAS 1.4 specifications which require optional fields to be specified with default values. Previously the logic was simply assuming the bytes were omitted, but this is not correct. The fix is thus to simply assume that all fields, including the optional ones, are present.