-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More flexible query options (equals, contains, within, intersects, overlaps, touches) #7
Comments
lukas-shawford
changed the title
More flexible query options (contains, within, intersects, overlaps, touches)
More flexible query options (equals, contains, within, intersects, overlaps, touches)
May 3, 2020
Created a wiki page to track the design of this feature: https://github.com/sergkr/rtreelib/wiki/Query-Design There are a lot of possible combinations to consider, and I will see if maybe PostGIS, ArcGIS, or another spatial database system provides a good model to follow. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current
query
method has hardcoded behavior with respect to what counts as a "match" when querying by either aPoint
or aRect
, particularly with respect to borders.From the current README:
And:
Whether this is the desired behavior depends on the use case. Ideally it should be made configurable (with a sensible default).
The current thought is to add an optional
op
parameter, which specifies the operation type using an enum. For example:The above would return entries whose bounding rectangles are contained entirely within the query rectangle
Rect(2, 1, 5, 5)
.Care would need to be taken to ensure that the operation is only applied to the leaf entries, and not the bounding rectangles of intermediate nodes. The query rectangle may fully contain a leaf entry, but only partially intersect with the bounding rectangle of its container node.
The full list of supported operations, and what they mean for various combinations of point vs rectangle queries, and point vs rectangle entries (where the rects may be degenerate, see #6) will need to be researched further. But as a starting point, here are some examples of what might be supported:
Some diagrams to illustrate the difference between "overlaps" and "touches" for rectangular queries (Q) and rectangular entries (E):
Again, more thought will need to be given to what these operations mean when either the query or the entry is a point, or a degenerate rectangle (line segment - note that a rectangle that collapses to a point will be treated as a point for purposes of executing the query).
The text was updated successfully, but these errors were encountered: