[pdal] PDAL Pipeline Extensibility

Howard Butler howard at hobu.co
Fri Dec 30 07:53:25 PST 2016


> On Dec 29, 2016, at 3:16 PM, Kristian Evers <kreve at sdfe.dk> wrote:
> 
> Recently I have had a need for feeding user data to the programmable filter. I have an application that creates a PDAL pipeline based on the input and various settings determine the output. In some cases I use the programmable filter to do something that is outside the current scope of PDAL. If it were possible to access the pipeline JSON, and the userData section of the pipeline, from the Python function behind the filter I would be able to make more generic filters.

This is a good idea.

I'll make a dict of globals called 'pipeline' available to both filters.programmable and filters.predicate that represent the following:

pipeline['schema'] -> json dict 
pipeline['metadata'] -> json dict 
pipeline['pipeline'] -> json dict 
pipelien['log'] -> writeable log stream


> A recent example is that I wanted to create a vertical gridshift filter (similar to what Proj.4 does). I would have liked to pass the grid name to the programmable filter as a PDAL pipeline parameter but that is not possible. Instead I ended up hard coding it. It did the job but wasn't a very satisfying solution. I have since realized that I can in fact use the reprojection filter to do this (via Proj.4). This is just the example that came to mind – I have been in similar situations before but the exact details escape my memory.

Thanks for your documentation update that demonstrates how to do gridshifts and proj.4 strings in PDAL http://www.pdal.io/stages/filters.reprojection.html#examle-2 . I guess I assumed people familiar with GDAL's SRS handling tools would just know that the same skills and techniques would transfer.

Howard


More information about the pdal mailing list