-
Notifications
You must be signed in to change notification settings - Fork 443
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
Support read and initialize internal structure of STRtree and Quadtree #634
Conversation
Signed-off-by: Jia Yu <jiayu198910@gmail.com>
I'm not crazy about making the internals of the trees public, since that breaks encapsulation in a big way. And once those methods are public they can't be changed. How about making them package-private? Then you can add classes to the package to do what you want to do. What is your actual use case? |
I have been thinking about separating the structure of the R-tree from the building technique, to allow for different kinds of packing (and maybe even eventually a fully dynamic R-tree). The idea is that there would be tree builder classes which all produce a common Rtree structure. This is very much a WIP, though. |
@jiayuasu thanks for putting these PRs up. For the access modifiers for the tree indexes, can you link us to the Sedona code which uses it? |
Catch up the latest JTS update
Signed-off-by: Jia Yu <jiayu198910@gmail.com>
Actually it is better to use setters and getters rather than give access to the internal fields. This will allow initialization behaviour to be include (where needed). The setters and getters should be package private. For instance, instead of exposing a |
Here's an even better idea: provide constructors on |
Signed-off-by: Jia Yu <jiayu198910@gmail.com>
Signed-off-by: Jia Yu <jiayu198910@gmail.com>
@dr-jts Hi Martin, I have updated the PR accordingly. In particular, I added a few constructors to STRtree. |
Looks good. A few unit tests would be even better... Otherwise is this done? |
Signed-off-by: Jia Yu <jiayu198910@gmail.com>
@dr-jts Just added two unit tests for the new constructors. I think the PR is done now. And I will be waiting for the release of 1.18.0 :) |
Looks good. It occurred to me that it would be reasonable to have a method |
This PR is to change the access modifiers of tree indexes and add setter/getters.
By making these changes, external libraries such as Apache Sedona (GeoSpark) will be able to directly assemble a Quad-Tree or R-Tree index without going through the time-consuming insert and build phases.
This is particularly useful for external libraries to write their own index serializers (as in this code).
Signed-off-by: Jia Yu jiayu198910@gmail.com