我在python中使用pdal,我正在尝试使用可编程的过滤器。根据文献化,我应该能够通过编写来解析python函数的附加输入参数(第141页)
{
"pipeline":[
"input.las",
{
"type":"filters.programmable",
"module":"anything",
"function":"filter",
"source":"arguments.py",
"pdalargs":"{\"factor\":0.3048,\"an_argument\":42, \"another\": \"a string\"}"
},
"output.las"
]
}我尝试过复制粘贴(实际上,我只更改了输入las文件的名称),并且一直收到以下错误:
RuntimeError: JSON pipeline: Unable to parse pipeline:
* Line 13, Column 15
Missing ',' or '}' in object declaration我试着随机删除并插入pdalargs参数中的“and \”,但我似乎无法正确地理解语法。(没有pdalargs,它工作得很好)
文档中是否有更新或其他内容??语法实际上是如何使用pdalargs的?
发布于 2017-05-15 07:26:26
我发现了如何改变语法。出现此问题可能是因为我在python脚本中将json代码作为字符串编写。
无论如何,这个语法似乎有效:
jsonStr = """{
"pipeline":[
"input.las",
{
"type":"filters.programmable",
"module":"anything",
"function":"filter",
"source":"arguments.py",
"pdalargs": {"factor":0.3048,"an_argument":42, "another": "a string"}
},
"output.las"
]
}"""如果其他人也有同样的问题,希望这会有所帮助。
https://stackoverflow.com/questions/43916646
复制相似问题