我试图在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'.
我已经尝试过运行我在网上找到的其他小例子,但我一直在创建&#34;无法创建xx&#34; -error类型的过滤阶段!
我在图片的dockerfile上运行它:pdal / pdal:1.5
答案 0 :(得分:0)
再次查看您关联的网站。 crop
过滤器(docs here)使用选项bounds
,而非dimension
来指定边界框。在PDAL
中,dimension
表示点数据的维度(X,Y,Z,红色,绿色,蓝色等)。
答案 1 :(得分:0)
您的过滤器type
应该是filters.crop
,而不只是crop
。