Skip to content

Correct the region Q3 describes - #132

Merged
jiayuasu merged 1 commit into
mainfrom
correct-q3-region-description
Jul 26, 2026
Merged

Correct the region Q3 describes#132
jiayuasu merged 1 commit into
mainfrom
correct-q3-region-description

Conversation

@jiayuasu

Copy link
Copy Markdown
Member

Q3 filters trips against this ring:

POLYGON((-111.9060 34.7347, -111.6160 34.7347, -111.6160 35.0047, -111.9060 35.0047, -111.9060 34.7347))

Everywhere it appears, it is described as a "10km bounding box" which, with the 0.045° buffer, gives a "15km radius". Neither figure is right.

The ring spans 0.290° of longitude by 0.270° of latitude. At its centre latitude (34.8697 °N, which is exactly the Sedona centre the other queries use):

Longitude 0.290° × 111.32 km × cos(34.87°) ≈ 26.5 km east–west
Latitude 0.270° × 110.94 km ≈ 30.0 km north–south
From the centre 13.2 km E–W, 15.0 km N–S
Corners √(13.2² + 15.0²) ≈ 20.0 km, or 25.0 km once the buffer is added

So the "10km box" label understates the region by about 3×, and the query reaches ~25 km from the centre rather than 15 km.

What changes

Comments and prose only. The polygon literal, the thresholds and the result sets are untouched, so the committed ground-truth answers still apply and nothing needs regenerating.

  • spatialbench-queries/print_queries.py — the SQL source of truth: the -- Q3: header and the inline polygon comment
  • spatialbench-queries/{geopandas_queries,spatial_polars,pycanopy_queries}.py — the three dataframe implementations repeat the claim in their Q3 docstrings
  • notebooks/queries.ipynb — the source of the rendered page
  • docs/queries.md, docs/queries.zh.md — heading and prose, kept in sync with the notebook

The buffer's existing ~5km annotation for 0.045° is deliberately left alone. It is accurate in latitude (0.045° ≈ 5.0 km) and follows the same degree-to-kilometre convention the rest of the geometry suite uses for 0.45 "= 50 km" and 0.0045 "≈ 500 m" — revisiting that convention is a separate discussion, and it is the reason the geography suite in #131 exists.

Found while writing the geography counterpart of this query in #131, where the same label had been carried over.

Verification

python3 spatialbench-queries/print_queries.py SedonaDB   # 12 queries, SQL unchanged
mkdocs build --strict

git diff is 13 lines across 7 files; the notebook round-trips with only the two intended strings changed, and docs/queries.md is verified still in sync with the notebook's Q3 cell.

Q3 filters trips against this ring:

  POLYGON((-111.9060 34.7347, -111.6160 34.7347, -111.6160 35.0047,
           -111.9060 35.0047, -111.9060 34.7347))

which is described everywhere as a "10km bounding box" giving a "15km radius"
once the 0.045 degree buffer is added. Neither figure is right. The ring spans
0.290 degrees of longitude by 0.270 of latitude, and at its center latitude
(34.8697 N) that is about 26.5 km east-west by 30 km north-south -- roughly 13
and 15 km from the center along each axis, with the corners about 20 km out, or
25 km once the buffer is added. The "10km box" label understates the region by
about 3x.

Only comments and prose change; the polygon literal, the thresholds and the
result sets are untouched, so the committed answers still apply.

Updated in the SQL source of truth (print_queries.py), the three dataframe
implementations that repeat the claim in their docstrings, the notebook, and the
rendered docs in both languages. The buffer's existing "~5km" annotation for
0.045 degrees is left alone: it is accurate in latitude and follows the same
degree-to-kilometre convention the rest of the geometry suite uses.
@jiayuasu
jiayuasu force-pushed the correct-q3-region-description branch from e474223 to c50f594 Compare July 26, 2026 06:36
@jiayuasu
jiayuasu merged commit 68fbe5d into main Jul 26, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant