Correct the region Q3 describes - #132
Merged
Merged
Conversation
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
force-pushed
the
correct-q3-region-description
branch
from
July 26, 2026 06:36
e474223 to
c50f594
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Q3 filters trips against this ring:
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):
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 commentspatialbench-queries/{geopandas_queries,spatial_polars,pycanopy_queries}.py— the three dataframe implementations repeat the claim in their Q3 docstringsnotebooks/queries.ipynb— the source of the rendered pagedocs/queries.md,docs/queries.zh.md— heading and prose, kept in sync with the notebookThe buffer's existing
~5kmannotation 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 for0.45"= 50 km" and0.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 --strictgit diffis 13 lines across 7 files; the notebook round-trips with only the two intended strings changed, anddocs/queries.mdis verified still in sync with the notebook's Q3 cell.