Search code examples
pythonpython-3.xpdal

PDAL filter doesn't work: Unable to parse pipeline


So this is my first time to use PDAL. I use python 3.6 and PDAL 1.9.

 json_s = """{


        "test.las",
        {
        "type":"filters.outlier",
        "method":"statistical",
        "mean_k":12,
        "multiplier":0.5
        },
        {
        "type":"filters.range",
        "limits":"Classification![7:7]"
        },
        "testOut.las"

}"""

pipeline = pdal.Pipeline(json_s)
count = pipeline.execute()

It shows the err,

RuntimeError: JSON pipeline: Unable to parse pipeline. 

I checked the sample code in website and it looks the same. Just don't know why it doesn't work?


Solution

  • PDAL format look like this:

    json_s = """{
    
     "pipeline":[
            "input.las",
            {
              #anything you need
            },
    
            "output.las"
           {
           }
        ]
    }"""
    

    In your case, try:

    json_s = """{
    
     "pipeline":[
            "test.las",
            {
            "type":"filters.outlier",
            "method":"statistical",
            "mean_k":12,
            "multiplier":0.5
            },
            {
            "type":"filters.range",
            "limits":"Classification![7:7]"
            },
            "testOut.las"
        ]
    }"""