Share one bounding box accumulator across TWKB sub-writers

Abierto
#722 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
data

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
176
Forks
27
Merge medio
1 d 14 h
PR fusionados (30 d)
4

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de peterstace/simplefeatures

Todos los issues de peterstace/simplefeatures

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.