[pdal] How to invoke my custom writer?
Paul Schrum
paul.schrum at gmail.com
Mon Jul 10 14:11:36 PDT 2017
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"
}
]
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20170710/905042e6/attachment.html>
More information about the pdal
mailing list