Summary
The relationship control labels distances as 0 miles, ~1 mile, ~2 miles, etc., but the underlying spatial join is S2 Level‑13 cell adjacency, not true distance. The labels are misleading.
How it actually works
RelationshipSelector.tsx maps the dropdown value directly to hops, and neighborPath(hops, …) in engine/templates/fusedQueries.ts builds:
0 miles → hops = 0 → BIND(?s2anchor AS ?s2target) — well and facility must be in the same S2 Level‑13 cell.
~1 mile → hops = 1 → ?s2anchor kwg-ont:sfTouches | owl:sameAs ?s2target — adjacent cells.
~N miles → N hops of sfTouches.
An S2 Level‑13 cell is ~1 km across, so:
0 miles really means "same ~1 km cell", i.e. up to ~1–1.5 km apart, not literal zero.
~1 mile means "one cell away", which is a cell-count, not a measured mile.
Measured live on the Bedrock wells near any facility in Maine query (hops = 0): nearest-facility distance per well was min 4 m, median 411 m, max 1,250 m — consistent with same-cell, but clearly not "0 miles".
Impact
Users reading "0 miles" expect co-located points and are surprised when a matched well sits ~1 km from its facility. The mile labels imply a precision the cell-based join doesn't provide.
Options
- Relabel to reflect cell adjacency, e.g. "Same area (≈1 km)", "Adjacent (~1 cell)", … or "within ~N km" with an honest approximation. (Recommended, low effort.)
- Add a tooltip explaining the cell-based definition.
- Implement true distance filtering (geospatial
geof:distance / buffer) — accurate but heavier and slower.
Notes
Summary
The relationship control labels distances as
0 miles,~1 mile,~2 miles, etc., but the underlying spatial join is S2 Level‑13 cell adjacency, not true distance. The labels are misleading.How it actually works
RelationshipSelector.tsxmaps the dropdown value directly tohops, andneighborPath(hops, …)inengine/templates/fusedQueries.tsbuilds:0 miles→hops = 0→BIND(?s2anchor AS ?s2target)— well and facility must be in the same S2 Level‑13 cell.~1 mile→hops = 1→?s2anchor kwg-ont:sfTouches | owl:sameAs ?s2target— adjacent cells.~N miles→ N hops ofsfTouches.An S2 Level‑13 cell is ~1 km across, so:
0 milesreally means "same ~1 km cell", i.e. up to ~1–1.5 km apart, not literal zero.~1 milemeans "one cell away", which is a cell-count, not a measured mile.Measured live on the Bedrock wells near any facility in Maine query (
hops = 0): nearest-facility distance per well was min 4 m, median 411 m, max 1,250 m — consistent with same-cell, but clearly not "0 miles".Impact
Users reading "0 miles" expect co-located points and are surprised when a matched well sits ~1 km from its facility. The mile labels imply a precision the cell-based join doesn't provide.
Options
geof:distance/ buffer) — accurate but heavier and slower.Notes