Skip to content
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

How can I return all children and their bounds for non leaf and leaf nodes #1

Open
ziya61 opened this issue Feb 15, 2018 · 2 comments

Comments

@ziya61
Copy link

ziya61 commented Feb 15, 2018

I want to return all children and their bounds for a rtree object. How can I do that I want to return all data structucture as following example;

mbr=Rectangle [x1=10.0, y1=4.0, x2=62.0, y2=85.0] #root
mbr=Rectangle [x1=28.0, y1=4.0, x2=34.0, y2=85.0] #children
entry=Entry [value=2, geometry=Point [x=29.0, y=4.0]] #leaf
entry=Entry [value=1, geometry=Point [x=28.0, y=19.0]]
entry=Entry [value=4, geometry=Point [x=34.0, y=85.0]]
mbr=Rectangle [x1=10.0, y1=45.0, x2=62.0, y2=63.0] #children
entry=Entry [value=5, geometry=Point [x=62.0, y=45.0]]
entry=Entry [value=3, geometry=Point [x=10.0, y=63.0]]

@Microndgt
Copy link

Try walk method in RTree?

for node in rtree.walk(lambda o: True):
    print(node)

@BenHaimItay
Copy link

Small fix:

for node in rtree.walk(lambda *o: True):
    print(node)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants