Skip to content

Commit b569f27

Browse files
hobunormanb
andauthored
Quickinfo scales (#189)
* added additional metadata to quickinfo * use module call to run pytest --------- Co-authored-by: Norman Barker <[email protected]>
1 parent 32328ac commit b569f27

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ jobs:
7474
export PDAL_DRIVER_PATH=$PDAL_PLUGIN_PATH:$PDAL_DRIVER_PATH
7575
python -m pdal
7676
pdal --drivers --debug
77-
py.test -v test/
77+
python -m pytest -v test/
7878

src/pdal/PyPipeline.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ MetadataNode computePreview(Stage* stage)
185185
}
186186
if (dims.size())
187187
summary.add("dimensions", dims);
188+
189+
if (!qi.m_metadata.empty() && qi.m_metadata.valid())
190+
{
191+
summary.add(qi.m_metadata.clone("metadata"));
192+
}
193+
188194
pdal::Utils::toJSON(summary, strm);
189195
return summary;
190196

test/data/simple.laz

17.8 KB
Binary file not shown.

test/test_pipeline.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,15 @@ def test_quickinfo(self):
396396
assert 'readers.las' in info.keys()
397397
assert info['readers.las']['num_points'] == 1065
398398

399+
def test_quickinfo_offsets_scales(self):
400+
r = pdal.Reader(os.path.join(DATADIRECTORY,"simple.laz"))
401+
p = r.pipeline()
402+
info = p.quickinfo
403+
assert 'readers.las' in info.keys()
404+
assert 'offset_x' in info['readers.las']['metadata'].keys()
405+
assert 'scale_x' in info['readers.las']['metadata'].keys()
406+
assert info['readers.las']['num_points'] == 1065
407+
399408
def test_jsonkwarg(self):
400409
pipeline = pdal.Reader(os.path.join(DATADIRECTORY,"autzen-utm.las")).pipeline().toJSON()
401410
r = pdal.Pipeline(json=pipeline)

0 commit comments

Comments
 (0)