Demo: View Point Cloud¶
This demo illustrates how to download and view a point cloud.
To run the demo, type:
$ python view_pointcloud.py
Purpose¶
This demo demonstrates how to download point cloud data within a specified bounding box and visualize it. The visualization colors the point cloud based on the z-coordinate, making it easier to see elevation variations.
Step-by-step¶
Define Bounds: Specify the spatial bounds for a residential area in Helsingborg by setting a width/height value (here, 2000.0 units).
h = 2000.0 bounds = dtcc.Bounds(319891, 6399790, 319891 + h, 6399790 + h)
Download the Point Cloud: Retrieve the point cloud data (lidar) for the defined bounds using the
download_pointcloud
function.pointcloud = dtcc.download_pointcloud(bounds=bounds)
Visualize the Point Cloud: Extract the z-coordinate values from the point cloud and use these as color data when visualizing the point cloud via the
view()
method.color_data = pointcloud.points[:, 2] pointcloud.view(data=color_data)
Complete Code¶
Below is the complete code for this demo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|