Skip to content

feat: add Finland postal-area geocoding - #109

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

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

FIN currently returns no coordinates. Add 3,018 unique five-digit postal-area points from Statistics Finland's 2026 Paavo layer, retrieved 2026-11-04, under CC BY 4.0 with attribution.

coordinates(FIN, postal code)
  -> FIN allowlist entry
  -> geocode/FIN.json
  -> [longitude, latitude] strings

Points are area-weighted geometric centroids in the WGS84 longitude/latitude plane, with holes subtracted and MultiPolygon parts included. This is approximate area-level geocoding, not address or site accuracy. Special recipient and PO box codes without polygons remain unsupported. Åland is included. Large northern/rural areas can have errors of many kilometres; centroids can lie outside the area or in water.

Add a standard-library Python generator with assert checks, country-focused offline tests, and source/licence/method documentation in docs/geocode-FIN.md. Preserve all other countries, existing normalization, string output, and unknown-code behavior. Shared-file overlap with other country PRs is limited to lib/geocode.js's allowlist.

Evidence

  • Before: FIN is absent from the geocode allowlist and has no data file; lookup returns undefined.
    After: all 3,018 codes resolve; pinned official-layer examples cover Helsinki, Salla, Utsjoki, Mariehamn and Nauvo.
  • npm test: 98 passed.
  • npm run lint, npm run format:check, npm run validate:data: passed. Data validation retains two existing AUT/BEL warnings.
  • Generator checks source CRS/year/count, unique code format, finite coordinate bounds, square, hole and MultiPolygon centroid examples.
  • Source, licence.

Merge Danger

Door: two-way

Static additive data and one allowlist entry; no publish, deployment or merge performed.

Blast Radius: FIN

Callers now receive area coordinates for supported FIN codes. Distance accuracy is limited by postal-area size and the centroid method. No independent address-level accuracy check 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:52.336004Z 18713b9 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