One R-tree node, as stored: { f64 min_x, f64 min_y, f64 max_x, f64 max_y, u64 offset }, all little-endian, 40 bytes, no padding
(packed_rtree/mod.rs:23-33, :56-77).
offset HAS TWO MEANINGS and which one applies is decided by the level
the node was read from, never by the node itself:
on an INTERNAL node it is the index of the node's FIRST CHILD within
the flat node array (packed_rtree/mod.rs:385, :531);
on a LEAF node it is a byte offset RELATIVE TO featureBegin
(writer/mod.rs:207-215).
Reading a leaf's offset as a child index (or the reverse) traverses
without erroring and returns wrong answers, so search.ts derives
leaf-ness from the trusted level and not from the value.
One R-tree node, as stored:
{ f64 min_x, f64 min_y, f64 max_x, f64 max_y, u64 offset }, all little-endian, 40 bytes, no padding (packed_rtree/mod.rs:23-33, :56-77).offsetHAS TWO MEANINGS and which one applies is decided by the level the node was read from, never by the node itself:featureBegin(writer/mod.rs:207-215). Reading a leaf's offset as a child index (or the reverse) traverses without erroring and returns wrong answers, sosearch.tsderives leaf-ness from the trusted level and not from the value.