[pdal] Fwd: EPT points in polygon with the C++ API
Andrew Bell
andrew.bell.ia at gmail.com
Tue Feb 4 06:59:19 PST 2020
On Tue, Feb 4, 2020 at 6:43 AM Balázs Dukai <B.Dukai at tudelft.nl> wrote:
>
> 1. My primary, technical question is how to reset the "bounds" Option on
> a Reader in a loop?
>
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.
> 2. A more "meta" question is if the process above is sensible and
> efficient in terms of PDAL API use for a retrieving the points within a
> given polygon, for many many polygons :-)?
>
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.
3. For the time being we have our own point-in-polygon implementation,
> hence I'm only querying the EPT for the bounding boxes of the polygons.
> Once the points in the bbox are retrieved, we do the actual
> point-in-polygon test. But I've been looking into the Crop Filter to
> eventually completely replace our point-in-polygon implementation. As
> far as I understand I would need to feed the Crop Filter with the WKT of
> the polygon, which would have some overhead for casting back-and-forth
> to WKT. Is the Crop Filter a reasonable choice for replacing the
> point-in-polygon query in the process above?
>
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.
--
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20200204/09d889c7/attachment.html>
More information about the pdal
mailing list