In [ ]:
Copied!
# %pip install "leafmap[lidar]" open3d
# %pip install "leafmap[lidar]" open3d
Import libraries¶
In [ ]:
Copied!
import leafmap
import leafmap
Download data¶
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://open.gishub.org/data/lidar/madison.zip"
filename = "madison.las"
url = "https://open.gishub.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)
Metadata¶
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)
Read data¶
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
In [ ]:
Copied!
leafmap.view_lidar(filename, cmap="terrain", backend="pyvista")
leafmap.view_lidar(filename, cmap="terrain", backend="pyvista")
In [ ]:
Copied!
leafmap.view_lidar(filename, backend="ipygany", background="white")
leafmap.view_lidar(filename, backend="ipygany", background="white")
In [ ]:
Copied!
leafmap.view_lidar(filename, cmap="terrain", backend="panel", background="white")
leafmap.view_lidar(filename, cmap="terrain", backend="panel", background="white")
In [ ]:
Copied!
leafmap.view_lidar(filename, backend="open3d")
leafmap.view_lidar(filename, backend="open3d")