Python package for post-processing point-cloud data for 3D visualization
This software requires an x86_64 architecture and a Linux environment.
Visualization requirements:
Remember to set up and activate your virtual environment before proceeding.
# use conda to set up environment
conda create -n viz-points python=3.9
conda activate viz-points
conda install -c conda-forge pdal
# get and install this software
git clone https://github.com/PermafrostDiscoveryGateway/viz-points.git
cd viz-points
# checkout the development branch if necessary
git checkout develop
pip install .
# test your installation
tilepoints-test
This software is designed to be used either as a command line tool or as a Python package.
Command syntax:
tilepoints [ OPTIONS ] -f /path/to/file.las
Required argument:
-f file.las | --file=/path/to/file.las
specify the path to a LAS or LAZ point cloud file
Options:
-h | --help
display the help message
-v | --verbose
display more informational messages
-c | --copy_I_to_RGB
copy intensity values to RGB channels
-m | --merge
merge all tilesets in the output folder (./3dtiles)
-a | --archive
copy original LAS files to a ./archive folder
-s X | --rgb_scale=X
scale RGB values by X amount
-z X | --translate_z=X
translate Z (elevation) values by X amount
Python example:
from pdgpoints.pipeline import Pipeline
p = Pipeline(f='/path/to/file.laz',
intensity_to_RGB=True,
merge=True,
archive=False,
rgb_scale=4.0,
translate_z=-8.3,
verbose=False)
p.run()
You can view the output tiles in a Cesium environment. For steps for how to visualize the tiles with a local Cesium instance, see the documentation here in pdg-info.
More info on the above test dataset here.
Below is an example of the cesium.js
file that will display a 3dtiles tileset at ./3dtiles/tileset.json
(you will need your own access token):
function start(){// Your access token can be found at: https://cesium.com/ion/tokens.
Cesium.Ion.defaultAccessToken = "YOUR-TOKEN-HERE"
const viewer = new Cesium.Viewer('cesiumContainer');
const imageryLayers = viewer.imageryLayers;
var tileset = new Cesium.Cesium3DTileset({
url: "3dtiles/tileset.json",
debugShowBoundingVolume: true,
debugShowContentBoundingVolume: false,
debugShowGeometricError: false,
debugWireframe: true
});
viewer.scene.primitives.add(tileset);
window.zoom_to_me = function(){
viewer.zoomTo(tileset);
}
tileset.readyPromise.then(zoom_to_me).otherwise(error => { console.log(error) });
}
start()
If you would like to cite this repository, we suggest using something like the following:
Ian M. Nesbitt, Robyn Thiessen-Bock, and Matthew B. Jones (NCEAS). viz-points: A Python package for post-processing point-cloud data for 3D visualization. https://github.com/PermafrostDiscoveryGateway/viz-points.