[pgpointcloud] Uploading to pgpointcloud with pqxx

Paul Ramsey pramsey at cleverelephant.ca
Tue Oct 16 08:50:29 PDT 2018


Directly writing into the “WKB” format is what the pdal folks do (I think, still). 

https://github.com/pgpointcloud/pointcloud/blob/master/lib/pc_api.h#L406 <https://github.com/pgpointcloud/pointcloud/blob/master/lib/pc_api.h#L406>

Surprised the format is not laid out in docs anywhere I can see.

P

> On Oct 16, 2018, at 8:38 AM, David Serret Mayer <david.serret at eigendynamics.com> wrote:
> 
> Hi!
> 
> I am looking to increase the performance of the uploading process with pgpointcloud and pqxx. 
> 
> After a bit of profiling and playing around I have seen that with the documentation on the README, by appending a huge string and then  executing the sql code like this:
> 
> ...
> pqxx::work work(conn);
> std::string command ("
> INSERT INTO patches (pa) SELECT PC_MakePatch (1, ARRAY[")
> 
> for(auto& point : point_vector){
>     command += std::to_string(point.x);
>     command += ", "
>     command += std::to_string(point.y);
>     command += ", "
>     command += std::to_string(point.z);
>     command += ", "
>     command += std::to_string(point.i);
>     command += ", "
> }
> command += "]));)");"
> work.exec(command);
> ...
> 
> Is there a more efficient method. I feel doing everything from strings should not be
> faster. And the code above scales horribly with bigger point clouds. 
> 
> 
> Also, I have tried to see what the guys at PDAL are doing and I think **of course** they are doing much better than me :P. Any code sample or read regarding this topic would be appreciated. 
> 
> 
> Thank you in advance. 
> 
> 
> 
> -- 
> David Serret - R&D Engineer at Eigen Dynamics SL
> 
> _______________________________________________
> pgpointcloud mailing list
> pgpointcloud at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pgpointcloud

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgpointcloud/attachments/20181016/a6460172/attachment.html>


More information about the pgpointcloud mailing list