Skip to content

"Near / 0 miles" is S2-cell adjacency, not true distance — labels are misleading #31

Description

@prayaslashkari

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 mileshops = 0BIND(?s2anchor AS ?s2target) — well and facility must be in the same S2 Level‑13 cell.
  • ~1 milehops = 1?s2anchor kwg-ont:sfTouches | owl:sameAs ?s2targetadjacent 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

  1. 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.)
  2. Add a tooltip explaining the cell-based definition.
  3. Implement true distance filtering (geospatial geof:distance / buffer) — accurate but heavier and slower.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions