Replies: 3 comments
-
I've had similar thoughts. Why limit this to Python? What about a more usable C++ API? |
Beta Was this translation helpful? Give feedback.
-
That's also a good idea. Just want to make sure the encapsulation doesn't hide the flexibility of the current quadtree functions. I'd like to request some comments from @trxcllnt since noderapids depends on C++ API. |
Beta Was this translation helpful? Give feedback.
-
I considered having a quadtree class in C++, but decided against it due to differences in ownership semantics between C++ and Python/JS. If we had an owning That's just duplicating work, so unless we're trying to expose a nice C++ API for other C++ library consumers, I don't think it's strictly necessary to have a |
Beta Was this translation helpful? Give feedback.
-
Is this a new feature, an improvement, or a change to existing functionality?
Improvement
How would you describe the priority of this feature request
Low (would be nice)
Please provide a clear description of problem you would like to solve.
Today, cuspatial's support for quadtree is mainly encapsulated in these APIs:
quadtree_on_points
inindexing.py
join_quadtree_and_bounding_boxes
injoin.py
quadtree_point_in_polygon
injoin.py
quadtree_point_to_nearest_linestring
injoin.py
These APIs mainly serves two use cases:
In current release, to perform a PiP test, a user would do the following:
Further downstream dataframe opeartion could stem out from these spatial operations such as spatial join. For a GIS user, to achieve a spatial join with these operations today would require calling the above APIs in sequence, passing the result from one API to another, often needing to track the use of parameters. The burden of maintaining the consistency of the quadtree usage becomes a user burden, albeit it's unnecessary.
The result from the last API also requires further interpretation. For example, the return of
quadtree_point_in_polygon
require remapping thepoint_index
column with thepoint_indices
argument. Besides, the polygon index refers to parts index if the input is made of a multipolygon.It would be helpful to use a custom class
Point_Quadtree
to hide some of the implementation detail to the user, as well as persisting the structure of point quadtrees across different set of polygon calls. Node rapids has made some effort on that end:https://github.com/rapidsai/node/blob/7a330e31ebe1badc325c995c855cf3d375a1ea9d/modules/cuspatial/src/quadtree.ts#L65
With such introduction, I would imagine:
Describe any alternatives you have considered
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions