我试图使用PDAL的Python扩展名来读取laz文件。
为此,我使用了简单的管道结构,例如:https://gis.stackexchange.com/questions/303334/accessing-raw-data-from-laz-file-in-python-with-open-source-software。但是,对我来说,插入包含在"filename:“字段的变量中的值是有用的。为此,我尝试了以下方法,其中fullFileName是包含文件名(完整路径)的str变量,但我得到的错误是不存在这样的文件。我假设我的JSON语法有点不正确,有人能帮上忙吗?
pipeline="""{
"pipeline": [
{
"type": "readers.las",
"filename": "{fullFileName}"
}
]
}"""发布于 2019-05-15 16:34:06
您可以遵循以下代码:
import json
import pdal
file = "D:/Lidar data/input.laz"
pipeline={
"pipeline": [
{
"type": "readers.las",
"filename": file
},
{
"type": "filters.sort",
"dimension": "Z"
}
]
}
r = pdal.Pipeline(json.dumps(pipeline))
r.validate()
points = r.execute()
print(points)https://stackoverflow.com/questions/55854652
复制相似问题