PermafrostDiscoveryGateway / viz-points

Python package for post-processing point-cloud data for 3D visualization
Apache License 2.0
0 stars 1 forks source link

Transmute intensity to `.pnts` RGB fields #5

Closed iannesbitt closed 1 year ago

iannesbitt commented 1 year ago

RGB is not currently converted into .pnts tiles despite las2las commands copying intensity into RGB channels. Potential explanations/solutions:

iannesbitt commented 1 year ago

The following sequence is the only way I can find to reliably load intensity values into the RGB channels of a functional LAS file:

lasinfo -i Site7.las -stdout | grep EPSG > Site7rgb.las-wkt.txt
las2las -i Site7.las -otxt -oparse xyziiiitanr -stdout | las2las -stdin -itxt -iparse xyziRGBtanr -scale_RGB_up -load_ogc_wkt Site7rgb.las-wkt.txt -o Site7rgb.las

The first command exports the CRS info as a WKT string to file. The second exports the points to text through stdout with four intensity fields, then through stdin parses three of those fields as RGB and scales up from 8bit to 16bit. WKT is loaded from file.

Result after tiling: image

iannesbitt commented 1 year ago

Closing as completed since this works in testing.

Going through ASCII in this way (484444f) is slower than using binary .las, but it works and cuts down on both code and disk i/o since it's piped through stdout rather than written to file. May need to change in the future, but not everyone will need to use this intensity to rgb feature, and DRP will likely be uploading relatively manageable file sizes.