101 lidar
Visualizing LiDAR data in 3D with only one line of code
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install geemap[lidar] open3d
# !pip install geemap[lidar] open3d
In [ ]:
Copied!
import os
import geemap
import os
import geemap
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://drive.google.com/file/d/1H_X1190vL63BoFYa_cVBDxtIa8rG-Usb/view?usp=sharing"
)
filename = "madison.las"
url = (
"https://drive.google.com/file/d/1H_X1190vL63BoFYa_cVBDxtIa8rG-Usb/view?usp=sharing"
)
filename = "madison.las"
In [ ]:
Copied!
if not os.path.exists(filename):
geemap.download_file(url, "madison.zip", unzip=True)
if not os.path.exists(filename):
geemap.download_file(url, "madison.zip", unzip=True)
Read the LiDAR data
In [ ]:
Copied!
las = geemap.read_lidar(filename)
las = geemap.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!
# geemap.view_lidar(filename, cmap='terrain', backend='pyvista')
# geemap.view_lidar(filename, cmap='terrain', backend='pyvista')
Visualize LiDAR data using the ipygany backend.
In [ ]:
Copied!
# geemap.view_lidar(filename, backend='ipygany', background='white')
# geemap.view_lidar(filename, backend='ipygany', background='white')
Visualize LiDAR data using the panel backend.
In [ ]:
Copied!
# geemap.view_lidar(filename, cmap='terrain', backend='panel', background='white')
# geemap.view_lidar(filename, cmap='terrain', backend='panel', background='white')
Visualize LiDAR data using the open3d backend.
In [ ]:
Copied!
# geemap.view_lidar(filename, backend='open3d')
# geemap.view_lidar(filename, backend='open3d')