-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Doc: flatgeobuf: document amount of RAM needed for packed Hilbert RTree building #8490
Conversation
CC @bjornharrtell Can you confirm or infirm my theory about the RAM requirement ? sizeof(NodeItem) == 40 clearly , and we need 2 instances per feature: one in the list provided to the PackedRTree constructor, and another one for the PackedRTree._nodeItems[] ? |
Without diving deep I would say that seems correct yes. But I don't immediately understand/recall why I had to have this double representation. |
Looked into it a bit and think it should be possible to avoid the duplication, but I'm not sure when I will find the time and brain power to do it so I think this docs change is correct for now. |
@rouault actually "at least the number of features times 80 bytes" can be misleading, it'a bit more. The private _nodeItems also include nodes for all levels above the lowest. |
any estimation of that amount? Perhaps some log2(number of features) * something involved ? |
It depends on node size but in GDAL it's not configurable so it's set to 16. The full tree size can be calculated like this: gdal/ogr/ogrsf_frmts/flatgeobuf/packedrtree.cpp Lines 436 to 443 in b33e3b3
Where in the case of GDAL nodeSizeMin is 16. Subtract by numItems * 40 and that should be the size of the part of the tree that is above the feature level. There is probably some nice mathemetic way to formulate this but I'm not clever enough right now. :) |
So, assuming numNodes would be a power of 16 to simplify things (and if it is not, that should be really close), that's |
Cf thread at https://lists.osgeo.org/pipermail/gdal-dev/2023-September/057727.html