@@ -223,6 +223,41 @@ def test_infer_stage_type(self):
223223 assert pdal .Reader ().type == ""
224224 assert pdal .Writer ().type == ""
225225
226+ def test_streamable (self ):
227+ """Can we distinguish streamable from non-streamable stages and pipeline"""
228+ rs = pdal .Reader (type = "readers.las" , filename = "foo" )
229+ assert rs .streamable is True
230+ assert pdal .Reader .las ("foo" ).streamable is True
231+ assert pdal .Reader ("foo.las" ).streamable is True
232+
233+ rn = pdal .Reader (type = "readers.pts" , filename = "foo" )
234+ assert rn .streamable is False
235+ assert pdal .Reader .pts ("foo" ).streamable is False
236+ assert pdal .Reader ("foo.pts" ).streamable is False
237+
238+ fs = pdal .Filter (type = "filters.crop" )
239+ assert fs .streamable is True
240+ assert pdal .Filter .crop ().streamable is True
241+
242+ fn = pdal .Filter (type = "filters.cluster" )
243+ assert fn .streamable is False
244+ assert pdal .Filter .cluster ().streamable is False
245+
246+ ws = pdal .Writer (type = "writers.ogr" , filename = "foo" )
247+ assert ws .streamable is True
248+ assert pdal .Writer .ogr (filename = "foo" ).streamable is True
249+ assert pdal .Writer ("foo.shp" ).streamable is True
250+
251+ wn = pdal .Writer (type = "writers.glb" , filename = "foo" )
252+ assert wn .streamable is False
253+ assert pdal .Writer .gltf ("foo" ).streamable is False
254+ assert pdal .Writer ("foo.glb" ).streamable is False
255+
256+ assert (rs | fs | ws ).streamable is True
257+ assert (rn | fs | ws ).streamable is False
258+ assert (rs | fn | ws ).streamable is False
259+ assert (rs | fs | wn ).streamable is False
260+
226261 # fails against PDAL master; see https://github.com/PDAL/PDAL/issues/3566
227262 @pytest .mark .xfail
228263 @pytest .mark .parametrize ("filename" , ["reproject.json" , "reproject.py" ])
0 commit comments