<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 15, 2016 at 11:40 AM, Helimap Postmaster <span dir="ltr"><<a href="mailto:postmaster@helimap.ch" target="_blank">postmaster@helimap.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr"><div><div><div><div><div><div>Hello all,<br><br></div>This is a follow-up on a discussion started on liblas-devel mailing list with subject 'How to use a cached reader (c++)'.<br><br></div>The
question it has come to is, how can I change the pdal cloud container?
The cloud container, not the point container, that is, the container
that stores all the points.<br><br></div>I've seen that pdal <a href="https://github.com/PDAL/PDAL/blob/master/include/pdal/PointView.hpp#L66" target="_blank">uses a std::set as a container</a>
for the cloud, but std::set doesn't play with the parallel access of an
openmp 2.0 for loop, which can only handle std::vector or std::queue.</div></div></div></div></div></div></blockquote><div><br></div><div>Well, not exactly. By default PDAL has a set of buffers that contain the points. You're welcome to implement a class derived from BasePointTable and arrange the data as you like.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div>Is
it possible to re-implement PointView class to use a
std::vector<PointViewPtr>? Is it possible for me to access this
vector?<br></div></div></div></div></div></blockquote><div><br></div><div>If what you're wanting to do is simply loop through points that you read, you'd only have a single view into a single table. The access is direct from the view to the table. The table, by default, stores data in a vector of blocks, the blocks being memory containing points.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div>The first simple scenario is that I read the full
pointcloud and store it into a std::vector<PointViewPtr>, then I
process each point in parallel in an openmp for loop, and finally I save
the modified std::vector to a new las file. The process is roughly
adding color to each las point.<br></div></div></div></div></div></blockquote><div><br></div><div>I'm not sure why you need openmp, but I won't question. If your colorizing algorithm is slow, then perhaps some threading system will be helpful. But I'm not sure that you're worrying anything that is necessarily a problem given what you've said so far. I certainly can't see any reason for a vector of point views. If you're reading a single file, one PointView should suffice and be all that is normally created. All points should be accessible through the one PointView.</div><div><br></div><div>The normal way to attack these problems is to first come up with a single-threaded solution and then optimize through threading as necessary. Writing the base code will clarify issues and allow others to help you better than we can at this time.</div><div><br></div><div>Best,</div><div><br></div><div>-- <br></div></div><div class="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div></div>