[pdal] Linking with PCL

Andrew Bell andrew.bell.ia at gmail.com
Mon Dec 18 04:37:54 PST 2017


Stephen,

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: “.”, “./lib”, “../lib”, “./bin”,
“../bin” relative to your executable path.  You can also explicitly set
PDAL_DRIVER_PATH to the location of the driver.

On Mon, Dec 18, 2017 at 5:17 AM, <pidgeon13 at googlemail.com> wrote:

> 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_voxelgrid.dll has been created in the bin folder.
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Andrew Bell <andrew.bell.ia at gmail.com>
> *Sent: *15 December 2017 12:57
> *To: *Stephen Pidgeon <pidgeon13 at googlemail.com>
> *Cc: *pdal at lists.osgeo.org
> *Subject: *Re: [pdal] Linking with PCL
>
>
>
> The StageFactory must be able to locate the plugin.  See the second
> question in the FAQ: https://www.pdal.io/faq.html
>
>
>
> On Fri, Dec 15, 2017 at 4:44 AM, <pidgeon13 at googlemail.com> wrote:
>
> Hi,
>
>
>
> 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:
>
>
>
> bool ReadFilterWrite(const std::string& inputfilename, const std::string&
> readerdriver, const std::string& outputfilename)
>
> {
>
>                 bool bFilterWorks=false;
>
>                pdal::StageFactory factory;
>
>                 pdal::PointTable table;
>
>                 pdal::Stage *pReader = factory.createStage(readerdriver);
>
>                 pdal::Options readerOptions;
>
>                 readerOptions.add("filename", inputfilename);
>
>                 if (pReader)
>
>                 {
>
>                                 pReader->setOptions(readerOptions);
>
>                 }
>
>                 else
>
>                 {
>
>                                 return false;
>
>                 }
>
>                 pdal::Options writerOptions;
>
>                 writerOptions.add("filename", outputfilename);
>
>                 pdal::Stage *pWriter = factory.createStage("writers.
> text");
>
>                 if (pWriter)
>
>                 {
>
>                                 pdal::Stage *pFilter =
> factory.createStage("filters.voxelgrid");
>
>                                 if (pFilter)
>
>                                 {
>
>                                                 bFilterWorks = true;
>
>
> pFilter->setInput(*pReader);
>
>
> pWriter->setInput(*pFilter);
>
>                                 }
>
>                                 else
>
>                                 {
>
>                                                //Currently commented out
> so that files are only written if the filter works.
>
>
> //pWriter->setInput(*pReader);
>
>                                                 return false; //Temporary,
> currently where the function exits.
>
>                                 }
>
>                                 pWriter->setOptions(writerOptions);
>
>                                 pWriter->prepare(table);
>
>                                 pWriter->execute(table);
>
>                 }
>
>                 return bFilterWorks;
>
> }
>
>
>
> 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?
>
>
>
> Best regards,
>
>
>
> Stephen
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
>
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal
>
>
>
>
>
> --
>
> Andrew Bell
> andrew.bell.ia at gmail.com
>
>
>



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


More information about the pdal mailing list