PDAL / python

PDAL's Python Support
Other
115 stars 34 forks source link

Getting Spatial Reference via quickinfo from a LAZ #154

Closed CharlesGaydon closed 7 months ago

CharlesGaydon commented 9 months ago

I gather from different PR and issues that a pipeline involving a pdal.Filter.las reader should give me access to the point cloud metadata. For instance theses issues

And this PR:

But with quickinfo I only get a subset of the information that would be expected in the metadata.

r = pdal.Reader.las(filename=input_file)
p = r.pipeline()
p.quickinfo

RESULT: 
{'readers.las': {'bounds': {...}, 'dimensions': 'X, Y, Z, Intensity, ..., Infrared', 'num_points': 51369}}

Am I missing something?

I am currently using the ugly workaround described here where I call pdal --info via subprocess to get the LAZ metadata and, eventually, its projection from metadata["comp_spatialreference"]

Current versions:

pdal                      2.5.5                hee5d408_0    conda-forge
pdal-plugins              1.2.0                    pypi_0    pypi
python-pdal               3.2.3           py310h8245ec1_2    conda-forge
hobu commented 9 months ago

I'm not quite sure what you're asking here. You can't get all of the metadata from .quickinfo. You can only get the full metadata of a file or a pipeline by actually executing it. Can you provide some more detail about what you see is the issue?

In your example above ...

count = p.execute()
metadata = p.metadata