<div dir="ltr">Stephen,<div><br></div><div>If I understand, you're building your own executable using the code that you referenced.  The executable you created must be able to find the PCL plugin in one of these directories: <span style="color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)">“.”, “./lib”, “../lib”, “./bin”, “../bin” relative to your executable path.  You can also explicitly set PDAL_DRIVER_PATH to the location of the driver.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 18, 2017 at 5:17 AM,  <span dir="ltr"><<a href="mailto:pidgeon13@googlemail.com" target="_blank">pidgeon13@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="#954F72"><div class="m_-2466897148122004491WordSection1"><p class="MsoNormal">When I run pdal –drivers in the command prompt it does list the filter as being found. My configuration script sets PCL to build and libpdal_plugin_filter_<wbr>voxelgrid.dll has been created in the bin folder.</p><span class=""><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class="MsoNormal"><u></u> <u></u></p></span><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="border:none;padding:0cm"><b>From: </b><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">Andrew Bell</a><br><b>Sent: </b>15 December 2017 12:57<br><b>To: </b><a href="mailto:pidgeon13@googlemail.com" target="_blank">Stephen Pidgeon</a><br><b>Cc: </b><a href="mailto:pdal@lists.osgeo.org" target="_blank">pdal@lists.osgeo.org</a><br><b>Subject: </b>Re: [pdal] Linking with PCL</p></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">The StageFactory must be able to locate the plugin.  See the second question in the FAQ: <a href="https://www.pdal.io/faq.html" target="_blank">https://www.pdal.io/faq.<wbr>html</a></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Fri, Dec 15, 2017 at 4:44 AM, <<a href="mailto:pidgeon13@googlemail.com" target="_blank">pidgeon13@googlemail.com</a>> wrote:</p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal">Hi,</p><p class="MsoNormal"> </p><p class="MsoNormal">I am trying to use the voxelgrid filter in some c++ code I am writing (and would also like to be able to read and write .pcd files). I believe I have linked in PCL correctly, and my solution builds the plugin .dll files. However, although there is plenty of information on the PDAL website about using PCL in pipelines, I have not managed to find anything to help me use the API. I currently have a function I am playing around with to try and get the filter to work:</p><p class="MsoNormal"> </p><p class="MsoNormal">bool ReadFilterWrite(const std::string& inputfilename, const std::string& readerdriver, const std::string& outputfilename)</p><p class="MsoNormal">{</p><p class="MsoNormal">                bool bFilterWorks=false;</p><p class="MsoNormal">               pdal::StageFactory factory;</p><p class="MsoNormal">                pdal::PointTable table;</p><p class="MsoNormal">                pdal::Stage *pReader = factory.createStage(<wbr>readerdriver);</p><p class="MsoNormal">                pdal::Options readerOptions;</p><p class="MsoNormal">                readerOptions.add("filename", inputfilename);</p><p class="MsoNormal">                if (pReader)</p><p class="MsoNormal">                {</p><p class="MsoNormal">                                pReader->setOptions(<wbr>readerOptions);</p><p class="MsoNormal">                }</p><p class="MsoNormal">                else</p><p class="MsoNormal">                {</p><p class="MsoNormal">                                return false;</p><p class="MsoNormal">                }</p><p class="MsoNormal">                pdal::Options writerOptions;</p><p class="MsoNormal">                writerOptions.add("filename", outputfilename);</p><p class="MsoNormal">                pdal::Stage *pWriter = factory.createStage("writers.<wbr>text");</p><p class="MsoNormal">                if (pWriter)</p><p class="MsoNormal">                {</p><p class="MsoNormal">                                pdal::Stage *pFilter = factory.createStage("filters.<wbr>voxelgrid");</p><p class="MsoNormal">                                if (pFilter)</p><p class="MsoNormal">                                {</p><p class="MsoNormal">                                                bFilterWorks = true;</p><p class="MsoNormal">                                                pFilter->setInput(*pReader);</p><p class="MsoNormal">                                                pWriter->setInput(*pFilter);</p><p class="MsoNormal">                                }</p><p class="MsoNormal">                                else</p><p class="MsoNormal">                                {</p><p class="MsoNormal">                                               //Currently commented out so that files are only written if the filter works.</p><p class="MsoNormal">                                                //pWriter->setInput(*pReader);</p><p class="MsoNormal">                                                return false; //Temporary, currently where the function exits.</p><p class="MsoNormal">                                }</p><p class="MsoNormal">                                pWriter->setOptions(<wbr>writerOptions);</p><p class="MsoNormal">                                pWriter->prepare(table);</p><p class="MsoNormal">                                pWriter->execute(table);</p><p class="MsoNormal">                }</p><p class="MsoNormal">                return bFilterWorks;</p><p class="MsoNormal">}</p><p class="MsoNormal"> </p><p class="MsoNormal">The function reads the data in from a .las file (for example) fine, but then doesn’t create the filter stage. Am I going about this in the right way?</p><p class="MsoNormal"> </p><p class="MsoNormal">Best regards,</p><p class="MsoNormal"> </p><p class="MsoNormal">Stephen</p><p class="MsoNormal"> </p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class="MsoNormal"> </p></div></div><p class="MsoNormal"><br>______________________________<wbr>_________________<br>pdal mailing list<br><a href="mailto:pdal@lists.osgeo.org" target="_blank">pdal@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/pdal" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/pdal</a></p></blockquote></div><p class="MsoNormal"><br><br clear="all"></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- </p></div><p class="MsoNormal">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></p><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div>