Skip to content

Calculating the Height of an R-Tree: Where Did I Go Wrong? #275

@MasoumehVahedi

Description

@MasoumehVahedi

Hello all,

I've been trying to calculate the height of an R-tree after inserting my data set. Based on my understanding, I've attempted to use the properties of the index to calculate the height, but the results don't seem right.

Here's the data and the method I used:

leaf_capacity = 100
internalNode_capacity = 100
pagesize = 4096
fanout = 113

n = len(LandPolygons)  # The size of my dataset
M = internalNode_capacity
L = leaf_capacity

h = 1  # Starting with the leaf level
while n > L * (M ** (h - 1)):
    h += 1

print("Height of r-tree:", h)

When using a dataset of about one million polygons, I consistently get a height of 2, which doesn't seem right. Could someone help me identify where I might be making an error, or offer insights on how the height should be correctly calculated?

Any help or pointers would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions