[pdal] How to invoke my custom writer?

Andrew Bell andrew.bell.ia at gmail.com
Mon Jul 10 16:56:09 PDT 2017


You need to build your writer as a shared plugin and make sure that the
dll/so that you create is in a folder where the plugin manager will look
for it (or set PDAL_DRIVER_PATH).  Take a look at one of the existing
plugins in the "plutgins" subdirectory of pdal.  Let me know if you need
more help.

On Mon, Jul 10, 2017 at 5:11 PM, Paul Schrum <paul.schrum at gmail.com> wrote:

> I am developing a custom PDAL writer for my GSoC project. (Link
> <https://trac.osgeo.org/grass/wiki/GSoC/2017/IntegrationOfPDALintoGRASSGIS>)
> Source Code is on github <https://github.com/PaulSchrum/v_in_pdal>.  The
> module compiles, but it is an intermediate state since I am in the process
> of developing it.
>
> I have the custom writer, PdalVectorMapWriter,  inheriting from writer and
> it compiles okay.  Currently all functions just print out their own name
> and return.
>
> In main.cpp I create the pipeline json string and create a
> PipelineExecutor with it.  I then call pipeline-> validate.  This throws an
> exception stating
>
> terminate called after throwing an instance of 'pdal::pdal_error'
>   what():  Couldn't create writer stage of type
> 'writers.PdalVectorMapWriter'.
>
> So I am thinking that I need somehow to inform Pdal about an instance of
> the class.  But as I go over the Pdal documentation, I do not see how to do
> that.  Can someone help me understand what I need to do?
>
> - Paul
>
> Here is a key code snippet:
> 81    std::string pipeline_json =
> 82            pipelineJson::basicVectorMapReaderWriter(inFile,outFile);
> 83
> 84    cout << pipeline_json << endl;  //diagnostic only
> 85    cout << endl;
> 86    G_important_message(_("Running the pipeline ..."));
> 87    auto pipeline = new pdal::PipelineExecutor(pipeline_json);
> 88
> 87    cout << "is valid?  " << pipeline->validate() << endl;
>
> Line 87 throws the exception.
>
>
> Here is the json string being passed to the PipelineExecutor constructor:
>
> { "pipeline":[
>    "/home/user/Desktop/ALL/SourceModules/cpp/grass7_
> trunk/vector/v.in.pdal/testFiles/100-points.las",
> {
>    "type":"writers.PdalVectorMapWriter",
>    "filename":"100-points"
> }
>  ]
> }
>
>
>
>
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal
>



-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20170710/07a2e16a/attachment.html>


More information about the pdal mailing list