Skip to content

feat: add Hungary postal geocoding - #106

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

jkrenge wants to merge 1 commit into
masterfrom
codex/hun-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 Hungary postal geocoding for approximate delivery-to-return distance analysis.

HUN full four-digit postcode → 3,046-code dataset → [longitude, latitude]

Source: GeoNames HU.zip, retrieved 2026-11-04, export timestamp 2026-11-04. CC BY 4.0, with attribution and source hashes in docs/geocode-HUN.md. The generator combines 3,571 locality rows into 3,046 unique codes by averaging distinct coordinate pairs. Duplicate source rows do not add weight.

This provides approximate locality points, not postal-area centroids. Complete national coverage and coordinate error bounds are unverified. Budapest codes can share a city point. Primary postal/municipal sources confirm urban, rural and border sample code associations; they do not independently certify coordinate precision.

HUN accepts a full four-digit code and surrounding whitespace. Unknown or malformed codes return undefined. Coordinate strings and [longitude, latitude] order match existing behavior. Other countries retain their behavior. No dependency, export, type or region-data change.

Evidence

  • Before: HUN was outside the geocode allowlist and returned undefined.
  • After: actual lookup tests pass for 1014, 9945, 3999, shared code 7370, aliases, whitespace, malformed codes and unknown codes. All 3,046 points pass format, uniqueness and finite coordinate bounds checks.
  • npm test: 99 passed.
  • npm run lint, npm run format:check, npm run validate:data: passed. Data validation retains two existing AUT/BEL warnings.
  • Generator assertions check duplicate-insensitive averaging and source validation.

Merge Danger

Door: two-way

Blast Radius: HUN

Changes can be reverted without data migration. Approximate points can give inaccurate distances, especially within Budapest and shared rural postal areas. The package audit reports seven existing dependency findings (six moderate, one high); dependencies are unchanged.

lib/geocode.js overlaps with concurrent country PRs. Preserve all country entries and country-specific normalization during conflict resolution. This PR starts from default-branch commit 8a7bd9b2941b5c094a2707e8f386c18286d8318c; no other country PR was merged into the branch. No merge, publish, deployment or production write was performed.

@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:31.813257Z b92dc74 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