48 lidar
Visualizing LiDAR data in 3D with only one line of code
Uncomment the following line to install leafmap if needed.
In [ ]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [ ]:
Copied!
# !pip install leafmap[lidar] open3d
# !pip install leafmap[lidar] open3d
In [ ]:
Copied!
import os
import leafmap
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.
In [ ]:
Copied!
url = "https://opengeos.org/data/lidar/madison.zip"
filename = "madison.las"
url = "https://opengeos.org/data/lidar/madison.zip"
filename = "madison.las"
In [ ]:
Copied!
leafmap.download_file(url, "madison.zip", unzip=True)
leafmap.download_file(url, "madison.zip", unzip=True)
Read the LiDAR data
In [ ]:
Copied!
las = leafmap.read_lidar(filename)
las = leafmap.read_lidar(filename)
The LAS header.
In [ ]:
Copied!
las.header
las.header
The number of points.
In [ ]:
Copied!
las.header.point_count
las.header.point_count
The list of features.
In [ ]:
Copied!
list(las.point_format.dimension_names)
list(las.point_format.dimension_names)
Inspect data.
In [ ]:
Copied!
las.X
las.X
In [ ]:
Copied!
las.Y
las.Y
In [ ]:
Copied!
las.Z
las.Z
In [ ]:
Copied!
las.intensity
las.intensity
Visualize LiDAR data using the pyvista backend.
In [ ]:
Copied!
leafmap.view_lidar(filename, cmap="terrain", backend="pyvista")
leafmap.view_lidar(filename, cmap="terrain", backend="pyvista")
Visualize LiDAR data using the ipygany backend.
In [ ]:
Copied!
leafmap.view_lidar(filename, backend="ipygany", background="white")
leafmap.view_lidar(filename, backend="ipygany", background="white")
Visualize LiDAR data using the panel backend.
In [ ]:
Copied!
leafmap.view_lidar(filename, cmap="terrain", backend="panel", background="white")
leafmap.view_lidar(filename, cmap="terrain", backend="panel", background="white")
Visualize LiDAR data using the open3d backend.
In [ ]:
Copied!
leafmap.view_lidar(filename, backend="open3d")
leafmap.view_lidar(filename, backend="open3d")