<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Directly writing into the “WKB” format is what the pdal folks do (I think, still). <div class=""><br class=""></div><div class=""><a href="https://github.com/pgpointcloud/pointcloud/blob/master/lib/pc_api.h#L406" class="">https://github.com/pgpointcloud/pointcloud/blob/master/lib/pc_api.h#L406</a></div><div class=""><br class=""></div><div class="">Surprised the format is not laid out in docs anywhere I can see.</div><div class=""><br class=""></div><div class="">P<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 16, 2018, at 8:38 AM, David Serret Mayer <<a href="mailto:david.serret@eigendynamics.com" class="">david.serret@eigendynamics.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Hi!</div><div class=""><br class=""></div><div class="">I am looking to increase the performance of the uploading process with pgpointcloud and pqxx. <br class=""></div><div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><span style="font-family:monospace,monospace" class="">...<br class="">pqxx::work work(conn);<br class="">std::string command ("<br class="">INSERT INTO patches (pa) SELECT PC_MakePatch (1, ARRAY[")<br class=""><br class="">for(auto& point : point_vector){<br class="">    command += std::to_string(point.x);<br class="">    command += ", "<br class="">    command += std::to_string(point.y);<br class="">    command += ", "<br class="">    command += std::to_string(point.z);<br class="">    command += ", "<br class="">    command += std::to_string(point.i);<br class="">    command += ", "<br class="">}<br class="">command += "]));)");"<br class="">work.exec(command);<br class="">...</span><div class=""><div class=""><code class=""><br class=""></code></div><div class=""><code class="">Is there a more efficient method. I feel doing everything from strings should not be</code></div><div class=""><code class="">faster. And the code above scales horribly with bigger point clouds. <br class=""></code></div><div class=""><code class=""><br class=""></code></div><div class=""><code class=""><br class=""></code></div><div class=""><code class="">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. <br class=""></code></div><div class=""><code class=""><br class=""></code></div><div class=""><code class=""><br class=""></code></div><div class=""><code class="">Thank you in advance. <br class=""></code></div><div class=""><code class=""></code><code class=""></code><code class=""></code></div></div><span style="font-family:monospace,monospace" class=""></span><br class=""><span style="font-family:monospace,monospace" class=""></span><div class=""><span style="font-family:monospace,monospace" class=""><br class=""></span></div><div class=""><div class=""><div class=""><br class="">-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><b class="">David Serret </b>- R&D Engineer at Eigen Dynamics SL<br class=""><img src="http://www.eigendynamics.com/wp-content/uploads/2017/02/EigenLogo200dpi-1.jpg" width="200" height="88" class=""></div></div></div></div></div></div></div></div>
_______________________________________________<br class="">pgpointcloud mailing list<br class=""><a href="mailto:pgpointcloud@lists.osgeo.org" class="">pgpointcloud@lists.osgeo.org</a><br class="">https://lists.osgeo.org/mailman/listinfo/pgpointcloud</div></blockquote></div><br class=""></div></body></html>