[pgpointcloud] Uploading to pgpointcloud with pqxx
David Serret Mayer
david.serret at eigendynamics.com
Tue Oct 16 08:38:33 PDT 2018
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgpointcloud/attachments/20181016/2fddf03d/attachment.html>
More information about the pgpointcloud
mailing list