Skip to content

fix: use official France postal-code representative points - #97

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

jkrenge wants to merge 1 commit into
masterfrom
codex/fra-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

Return-distance analysis needs a defined postal-code point. FRA currently selects the first locality from 51,623 legacy rows. Replace these with 6,187 unique postal-code points derived from La Poste's official commune coordinate file.

La Poste CSV → unique commune per postal code → equal-weight mean → FRA lookup

Source: https://data.laposte.fr/datasets/laposte-hexasmal, Licence Ouverte / Open Licence 2.0 (government catalogue). Retrieved 2026-11-04; source data date 2026-10-08; coordinate export date 2026-10-31. Source attribution, checksum, generation method and limits are in docs/geocode-FRA.md.

Coverage: source-listed metropolitan France, Corsica and five overseas departments. Excludes other overseas collectivities and Monaco. These are representative commune-point means, not postal-area centroids or address positions. Repeated locality rows do not add weight. No national completeness claim.

Evidence

  • Before: 20,410 unique legacy codes; duplicate codes return the first locality, with no documented aggregation.
  • After: 6,187 records / unique codes. Offline tests execute every lookup and cover Paris, a shared rural code, leading zeros, Corsica, Réunion, Mayotte, locality suffixes and misses. Generator self-check verifies duplicate invariance.
  • Passed: npm test (98 tests), npm run lint, npm run format:check, npm run validate:data, generator assertions and git diff --check.
  • Data validation retains two existing AUT/BEL unused-name warnings.

Merge Danger

Door: two-way

Revert restores the old file. Existing FRA points change and legacy codes absent from the official file now return undefined, including generic 75000. Results remain [longitude, latitude] strings. No runtime, types, exports, other-country data or dependencies change.

Blast Radius: FRA

Commune points can be shared by urban postal codes. Rural postal codes can cover large areas. Six-decimal storage is not an accuracy guarantee. This PR does not implement distance calculations or fraud decisions. Shared files have no overlap with other country PRs. No merge or deployment is requested.

@jkrenge
jkrenge requested a review from a team as a code owner November 4, 2026 22:01
@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:28.964511Z 87b4812 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