[pdal] loop a directory through a pipeline

Maxson, Michele L ERDC-RDE-CRREL-NH CIV Michele.L.Maxson at erdc.dren.mil
Thu Apr 28 08:04:14 PDT 2016


Example 1 (with reader/writer):
{
    "pipeline": [
        {
            "type":"readers.las",    	   },
        {
            "type": "filters.statisticaloutlier",
            "extract":"true",
            "multiplier":5,
            "mean_k": 4
        },
        {
            "type": "filters.range",
            "limits": "Z[115:150]"
        },
        {
            "type": "writers.las",
            "compression": "true",
            "minor_version": "2",
            "dataformat_id": "0",
        }
	   {
            "type":"writers.text",
         }
    ]
}

Example 2 (without reader/writer):
{
    "pipeline": [
        {
            "type": "filters.statisticaloutlier",
            "extract":"true",
            "multiplier":5,
            "mean_k": 4
        },
        {
            "type": "filters.range",
            "limits": "Z[115:150]"
        },
        {
            "type": "writers.las",
            "compression": "true",
            "minor_version": "2",
            "dataformat_id": "0",
        }
    ]
}

Example 3 (pipeline that works properly on a single file):
{
    "pipeline": [
        "/data/CRREL/split/CRREL_Split_1.laz",
        {
            "type": "filters.statisticaloutlier",
            "extract":"true",
            "multiplier":5,
            "mean_k": 4
        },
        {
            "type": "filters.range",
            "limits": "Z[115:150]"
        },
        {
            "type": "writers.las",
            "compression": "true",
            "minor_version": "2",
            "dataformat_id": "0",
            "filename":"/data/CRREL/split/Denoise/CRREL_Split_1_Clean.laz"
        }
    ]
}

Yes, I am talking about http://www.pdal.io/tutorial/reading.html?highlight=loopBlocked#loop-a-directory-and-filter-it-through-a-pipeline.  I've updated the script to point into the correct locations (i.e. my data directory and appropriate subdirectories) as well as the location of the json.

~Mic

-----Original Message-----
From: Howard Butler [mailto:howard at hobu.co] 
Sent: Thursday, April 28, 2016 10:52 AM
To: Maxson, Michele L ERDC-RDE-CRREL-NH CIV <Michele.L.Maxson at erdc.dren.mil>
Cc: pdal at lists.osgeo.org
Subject: Re: [pdal] loop a directory through a pipeline


> On Apr 28, 2016, at 9:45 AM, Maxson, Michele L ERDC-RDE-CRREL-NH CIV <Michele.L.Maxson at erdc.dren.mil> wrote:
> 
> How do I loop a directory through a pipeline?  

You have to run a single pipeline over each file in a script and substitute as appropriate

> I currently have a denoiseing pipeline created and I would like to loop it through all the LAZ files in a directory.  I keep getting the error "PDAL:  PipelineReaderJSON: unable to parse pipeline" indicating that the error may lie within the *.json pipeline.  


> I have created a *.json both with a reader and writer and one without for testing and both files result in the "unable to parse pipeline" error.    Are there additional wildcards or code that needs to be included/not included in the *.json?  I am working in Docker and coding within my container using the script found on the pdal.io website "Loop a directory and filter it through a pipeline" as a template.  Thanks for any help.      


Can you post some of your pipeline examples? I presume you are talking about Blockedhttp://www.pdal.io/tutorial/reading.html?highlight=loopBlocked#loop-a-directory-and-filter-it-through-a-pipeline which will need some modification to work if you are using Docker and windows.


More information about the pdal mailing list