Skip to content

feat: add Swiss postal geocodes from swisstopo - #101

Closed
jkrenge wants to merge 1 commit into
masterfrom
codex/che-postal-geocoding
Closed

jkrenge wants to merge 1 commit into
masterfrom
codex/che-postal-geocoding

Conversation

@jkrenge

@jkrenge jkrenge commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by consolidated postal geocoding PR #124. This PR's head commit is retained in the combined branch. Combined CI passes on Node.js 24/26 and static checks.


Summary

Add Swiss postal geocodes for approximate delivery-to-return location comparisons.

swisstopo WGS84 CSV → distinct points per postcode → deterministic medoid
                    → 3,177 CHE records → existing coordinates lookup

Source: Federal Office of Topography swisstopo, November 2026 release, retrieved 2026-11-04. Its OGD terms permit commercial processing and redistribution with attribution. Source details, checksum, generator and limits are in docs/geocode-CHE.md.

The 5,697 Swiss source rows become 3,177 unique four-digit building-address postcodes. Liechtenstein and non-building postcodes are excluded. Each output is a source-point medoid, not a postal centroid. Duplicate rows add no weight. Precision is suitable only for approximate location comparisons; rural and Alpine codes can span substantial distances.

Evidence

  • Before: CHE was unsupported and returned undefined.
    After: actual lookup tests cover all 3,177 codes, Zürich, Alpine/shared codes, Samnaun, space suffixes and unknown/excluded codes.
  • All 98 tests pass; npm run lint, npm run format:check, and npm run validate:data pass. Data validation retains the two existing AUT/BEL warnings.
  • Generator assertions check duplicate-independent deterministic selection; source archive SHA-256 matches STAC metadata.
  • Existing [longitude, latitude] string results, normalization, exports and types remain compatible.

Merge Danger

Door: two-way

Blast Radius: CHE

Only one existing shared-file line changes: the CHE entry in lib/geocode.js. Other country PRs can conflict there. No merge, deployment or publication is part of this PR. No live consumer or measured distance validation was run.

@jkrenge
jkrenge requested a review from a team as a code owner November 4, 2026 22:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T22:03:27.169826Z ac17aad PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jkrenge jkrenge closed this Nov 4, 2026
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