<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 4, 2020 at 6:43 AM Balázs Dukai <<a href="mailto:B.Dukai@tudelft.nl" target="_blank">B.Dukai@tudelft.nl</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
1. My primary, technical question is how to reset the "bounds" Option on <br>
a Reader in a loop?<br></blockquote><div><br></div><div>You don't. Just start over every time. prepare() does processing to prepare the query from the EPT source. You need make sure it's executed for each query. Probably easiest is just to recreate the reader/pipeline in some function for each bounding box.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2. A more "meta" question is if the process above is sensible and <br>
efficient in terms of PDAL API use for a retrieving the points within a <br>
given polygon, for many many polygons :-)?<br></blockquote><div><br></div><div>If you're retrieving things from EPT through PDAL, yes. The EPT spec is public and you're welcome to write your own implementation that does exactly what you want.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">3. For the time being we have our own point-in-polygon implementation, <br>
hence I'm only querying the EPT for the bounding boxes of the polygons. <br>
Once the points in the bbox are retrieved, we do the actual <br>
point-in-polygon test. But I've been looking into the Crop Filter to <br>
eventually completely replace our point-in-polygon implementation. As <br>
far as I understand I would need to feed the Crop Filter with the WKT of <br>
the polygon, which would have some overhead for casting back-and-forth <br>
to WKT. Is the Crop Filter a reasonable choice for replacing the <br>
point-in-polygon query in the process above?<br></blockquote><div><br></div><div>The PDAL EPT reader will do this for you. See the `polygon` option. The PDAL point-in-polygon algorithm seems to be better than most. It's optimized for checking many points in a polygon. I believe that the algorithm source is documented in the code.</div><div><br></div></div></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div></div>