我正在尝试在 python 中使用 pdal。我从一个超级简单的裁剪开始:
json = """{
"pipeline":[
"ARRA-LFTNE_NewYork_2010_000636.las",
{
"type":"crop",
"bounds":"([616766.770,617765.46],[4510733.640,4511649.800])"
},
"output.laz"
]
}"""
pipeline = pdal.Pipeline(unicode(json,encoding="utf-8"))
pipeline.validate() # check if our JSON and options were good
pipeline.loglevel = 8 #really noisy
count = pipeline.execute()
arrays = pipeline.arrays
metadata = pipeline.metadata
log = pipeline.log
json 来自 pdal 的 hp https://www.pdal.io/pipeline.html#pipeline,应该简单地裁剪图像。但是,在验证时失败并出现以下错误:
Traceback (most recent call last):
File "/src/test.py", line 69, in <module>
pipeline.validate() # check if our JSON and options were good
File "/usr/local/lib/python2.7/dist-packages/pdal/pipeline.py", line 42, in validate
return self.p.validate()
File "pdal/libpdalpython.pyx", line 93, in pdal.libpdalpython.PyPipeline.validate (pdal/libpdalpython.cpp:2639)
RuntimeError: Couldn't create filter stage of type 'crop'.
我已经尝试运行我在网上找到的其他小示例,但我不断收到“无法创建 xx 类型的过滤阶段”错误!
我在图像中的 dockerfile 上运行它:pdal/pdal:1.5