PDAL / python

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

Behavior of `Pipeline.arrays` with/without filter step #141

Open spolloni opened 1 year ago

spolloni commented 1 year ago

When trying to query Lidar out-of-bounds from an EPT, we noticed that Pipeline.arrays returns different objects based on whether the pipeline contains a Filter step or not:

import pdal

filename = 'https://s3-us-west-2.amazonaws.com/usgs-lidar-public/USGS_LPC_NY_LongIsland_Z18_2014_LAS_2015/ept.json'
bounds = '([8126849, 8126859],[-4980069, -4980059])' # far far away from Long Island, NY

# without filter
pipeline = pdal.Reader.ept(filename=filename, bounds=bounds).pipeline()
pipeline.execute()
print(pipeline.arrays) #  non-empty list containing one empty array

# with filter
pipeline = pdal.Reader.ept(filename=filename, bounds=bounds).pipeline()
pipeline |= pdal.Filter.range(limits='Classification[1:31]')
pipeline.execute()
print(pipeline.arrays) #  empty list

wondering if this is by design or should be tweaked to be consistent where there are no points to return.