Rhoana / pyrtree

An R-Tree implementation
36 stars 19 forks source link

How to create a R-tree with given points? #2

Closed WuZhuoran closed 5 years ago

WuZhuoran commented 6 years ago

Hi, thank you for writing pyrtree tools. I am not using it. I have a few points. such as

ID X Y
1 1.0 2.0
2 3.0 4.0

How can I insert all the point with (X,Y) as its location and ID as an identity?

I have reviewed your test examples, the thing is that how to create the rectangle?

Thank you! Please provide us more example, thank you!

adisuissa commented 6 years ago

Just to be clear, it's a code copied from https://code.google.com/archive/p/pyrtree/source/default/source and all credits go to the original developers. I've added the original description of the project that shows how to add a rectangle, and how to query the r-tree.

Microndgt commented 5 years ago

@WuZhuoran Class Rect uses two points to create a rectangle. The point 1 is bottom-left corner of the rectangle, and the point 2 is top-right corner of the rectangle. So for your case, you can create a rectangle using ID 1 and ID 2 like this:

Rect(1.0, 2.0, 3.0, 4.0)
WuZhuoran commented 5 years ago

@Microndgt Thank you. Solved.