TransWikia.com

PDAL Filter output is same as input file

Geographic Information Systems Asked by Yogi_04 on December 25, 2020

I’ve applied SOR filter using PDAL python.Below is the code snippet of the same,

json =  
 """  
{  
  "pipeline":[  
    "D:/Lidar_collect_3/output/output_1.las",  
    {  
      "type":"filters.outlier",  
      "method":"statistical",  
      "mean_k":6,  
      "multiplier":1.0  
    },  
    "D:/Lidar_collect_3/output/output.las"  
  ]  
}  
"""  

pipeline = pdal.Pipeline(json)  
pipeline.validate()  
pipeline.execute()

The output.las created has the same number of points as input(looks same as the input). I’ve tried with different mean_k and multiplier values, but no result.

Where did I go wrong ?

One Answer

I think your json is being interpreted as a string rather than as a json object. Try importing the json library (part of the standard Python library) and then loading the string as a json object. For example:

import json
json_string = """  
{  
  "pipeline":[  
    "D:/Lidar_collect_3/output/output_1.las",  
    {  
      "type":"filters.outlier",  
      "method":"statistical",  
      "mean_k":6,  
      "multiplier":1.0  
    },  
    "D:/Lidar_collect_3/output/output.las"  
  ]  
}  
"""  

json_pipeline = json.loads(json_string)
pipeline = pdal.Pipeline(json_pipeline)  
pipeline.validate()  
pipeline.execute()

Answered by Charlie Parr on December 25, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP