Share one bounding box accumulator across TWKB sub-writers

オープン
#722 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
data

調査の方向性

Start with writeGeometryCollection and copytwkbWriter, which create the per-child TWKB writers, then look at writePointArray where each coordinate updates bboxValid, bboxMin and bboxMax. The widenBBox helper comes from PR #720, which is not on master, so confirm that PR's status before starting. Pick one option: share the parent's box state with sub-writers, or move the min/max update into a shared helper. Done means one place maintains the bounding box and the existing TWKB tests still pass.

索引モデルが issue の本文から書いたものです。

説明

cleanup

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:

  1. 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.
  2. 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.

主要言語
Go
スター
176
フォーク
27
平均マージ
1日 14時間
マージ済み PR(30日)
4

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

peterstace/simplefeatures のほかの issue

peterstace/simplefeatures の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。