You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share one bounding box accumulator across TWKB sub-writers #722
This issue assumes that #720 will be merged. It is about widenBBox, which that PR adds and which isn't on master yet. If #720 is closed without merging, this issue can be closed too. Nothing here is externally detectable.
writeGeometryCollection writes each child with its own twkbWriter (from copytwkbWriter), and each writer tracks its own bounding box in bboxValid, bboxMin and bboxMax. #720 adds widenBBox, which merges a child writer's box into the parent's after the child is written. That leaves two places that maintain the box: writePointArray for each coordinate, and widenBBox for each child.
Two ways to bring that back to one place:
Have copytwkbWriter give the sub-writer the parent's bounding box state, for example as a pointer to a small struct holding the three fields. writePointArray then extends the collection's box directly and widenBBox can be deleted. Sub-writers don't write a bounding box, and they use the parent's precision, so the values are already on the same integer scale.
Keep a box per writer and move the min/max update into one helper, such as extendBBox(d, lo, hi), which writePointArray calls with lo == hi and widenBBox calls with the child's range.
Option 1 removes more code and handles nested collections without a merging step.
Activity