TorahNLP/techum-finder
Computes an approximate techum Shabbos boundary for a chosen point by deriving the halachic "ir" (city) from OpenStreetMap building footprints, squaring it (ribua ha'ir), and extending 2,000 amos.
This is a computational approximation from OpenStreetMap data, not a survey or a psak. Marginal gaps and dwelling/non-dwelling status must be confirmed on the ground by a qualified rav. (Note for future reference, not shown in-app: some poskim, e.g. Rav Hershel Schachter, hold that no location today qualifies as a halachic ir at all - see the comment above HALACHIC_CAVEATS in src/config.js.)
How it works
- Click a point on the map. The nearest building within 70⅔ amos becomes the seed of the ir.
- All
building=*footprints within the working radius are fetched from the Overpass API and clustered into a connected component using an exact polygon-to-polygon nearest-edge distance: - Gaps ≤ 70⅔ amos always join (dwelling continuity).
- Gaps 70⅔–141⅓ amos also join (Mishnah Eruvin 57a; two-cluster join), unless the connecting segment crosses a hard break (major road, rail, waterway, or large open parcel), in which case it's excluded and flagged for manual review.
- The ir's dwellings are bounded by a true N/S/E/W-aligned rectangle, padded outward by 70⅔ amos (ribua ha'ir), then expanded by 2,000 amos on every side (the techum).
- A review panel surfaces hard breaks, unknown-use buildings, weakly-connected outlier dwellings, a bent-shape (L/arc) flag when the ir's extremities exceed the 4,000-amos fill-in cap (Eruvin 55a), and an advisory flag when the techum rectangle reaches a separate, more distant settlement (the genuine "Brooklyn/Manhattan" dispute).
Stack
Vanilla JS ES modules, zero build step. Leaflet is vendored locally under vendor/ so the app has no CDN or bundler dependency. Overpass and Nominatim are called directly from the browser - there is no backend.
Development
npm test # pure-function unit tests for geo/geometry/cluster (Node, no browser)Serve index.html with any static file server to run the app locally (opening it via file:// will not work because it is loaded as an ES module).
Halachic sources
Eruvin 53b-57a; Shulchan Aruch Orach Chaim 398; Rabbi Ribiat, 39 Melachos vol. 4; Halachipedia: Techum; Rabbi Yirmiyohu Kaganoff, *The Basics of Techum Shabbos*.
License
Licensed CC BY-NC 4.0.
