Visualizing LiDAR data in 3D with only one line of code
Uncomment the following line to install leafmap if needed.
# !pip install leafmap
# !pip install leafmap[lidar] open3d
import os
import leafmap
Download a sample LiDAR dataset from Google Drive. The zip file is 52.1 MB and the uncompressed LAS file is 109 MB.
url = "https://opengeos.org/data/lidar/madison.zip"
filename = "madison.las"
leafmap.download_file(url, "madison.zip", unzip=True)
Read the LiDAR data
las = leafmap.read_lidar(filename)
The LAS header.
las.header
The number of points.
las.header.point_count
The list of features.
list(las.point_format.dimension_names)
Inspect data.
las.X
las.Y
las.Z
las.intensity
Visualize LiDAR data using the pyvista backend.
leafmap.view_lidar(filename, cmap="terrain", backend="pyvista")
Visualize LiDAR data using the ipygany backend.
leafmap.view_lidar(filename, backend="ipygany", background="white")
Visualize LiDAR data using the panel backend.
leafmap.view_lidar(filename, cmap="terrain", backend="panel", background="white")
Visualize LiDAR data using the open3d backend.
leafmap.view_lidar(filename, backend="open3d")