Skip to content

Quickinfo scales #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ jobs:
export PDAL_DRIVER_PATH=$PDAL_PLUGIN_PATH:$PDAL_DRIVER_PATH
python -m pdal
pdal --drivers --debug
py.test -v test/
python -m pytest -v test/

6 changes: 6 additions & 0 deletions src/pdal/PyPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ MetadataNode computePreview(Stage* stage)
}
if (dims.size())
summary.add("dimensions", dims);

if (!qi.m_metadata.empty() && qi.m_metadata.valid())
{
summary.add(qi.m_metadata.clone("metadata"));
}

pdal::Utils::toJSON(summary, strm);
return summary;

Expand Down
Binary file added test/data/simple.laz
Binary file not shown.
9 changes: 9 additions & 0 deletions test/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ def test_quickinfo(self):
assert 'readers.las' in info.keys()
assert info['readers.las']['num_points'] == 1065

def test_quickinfo_offsets_scales(self):
r = pdal.Reader(os.path.join(DATADIRECTORY,"simple.laz"))
p = r.pipeline()
info = p.quickinfo
assert 'readers.las' in info.keys()
assert 'offset_x' in info['readers.las']['metadata'].keys()
assert 'scale_x' in info['readers.las']['metadata'].keys()
assert info['readers.las']['num_points'] == 1065

def test_jsonkwarg(self):
pipeline = pdal.Reader(os.path.join(DATADIRECTORY,"autzen-utm.las")).pipeline().toJSON()
r = pdal.Pipeline(json=pipeline)
Expand Down
Loading