Is there anyway to access raw "LAZ" (not LAS) datasets in Python? I was trying to with ArcPy (I'd prefer not too), but it doesn't seem able to access LAZ. I'd prefer to work with the raw LAZ file and develop something to give access to other users.
My goal here is to do some filtering of the data to produce different features in a shapefile format. To do that I need to access the raw points XYZ, classification, and other fields. I've done this before, but never with a LAZ, only LAS.
I am looking for an Open Source, free solution, I know ESRI has some tools, but I am hoping to run this tool without any licensing needed.
This is related to What LiDAR processing tools are available in Python?, but specific to compressed LiDAR format (LAZ) and more about accessing the data than processing it.
Best Answer
A convenient way to get point cloud data to Python is to use the PDAL Python extension. PDAL uses the concept of pipelines (much like a GDAL VRT for point clouds instead of rasters) to allow users to orchestrate the processing of point cloud data. With the PDAL Python extension, you can read a LAZ file into a Numpy array and then do whatever you need to with it. The easiest way to do all this is with Conda.
Here's what it does
constructs a new environment with Conda
installs
pdal
,python-pdal
, andmatplotlib
modulesreads a LAZ file over the internet using a PDAL pipeline
plots a histogram of all of the dimensions of the file into a file called
histogram.png
Run these commands in your shell environment after installing miniconda to create a new environment.