Replies: 2 comments 2 replies
-
In general I want something like index on a lot of geometry and it contains point. auto index = MutableS2Index from all shapes in batch geometry;
auto query = MakeS2ContainsPointQuery(&index, S2VertexModel::CLOSED);
for shape in batch:
if (query.ShapeContains(shape, p)) ... |
Beta Was this translation helpful? Give feedback.
-
Right now the best way is probably S2BooleanOperation with Intersects, but that won't work for many shapes intersecting many other shapes. I'm working on bulk spatial queries that can take two indices and return all pairs that satisfy a given predicate efficiently. Containment first and intersection after, I think we're planning to release these but it probably won't be until Q1. |
Beta Was this translation helpful? Give feedback.
-
I have N polygons (X) and 1 polygon (Y).
I want to find all polygons from X which intersects with Y as fast as possible.
Of course I can just make a for loop X and intersect each polygon with Y.
But it's not effective :( A lot of allocation and other work.
I know I can create single S2ShapeIndex from X.
And then intersect it with Y.
I thought maybe it will be faster if exist way to get initial shapes from intersection result?
Beta Was this translation helpful? Give feedback.
All reactions