Skip to content

feat: add approximate AUS postcode coordinates - #116

Closed
jkrenge wants to merge 1 commit into
masterfrom
codex/aus-geocode-20261104
Closed

jkrenge wants to merge 1 commit into
masterfrom
codex/aus-geocode-20261104

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-location analysis needs approximate postcode points. AUS previously returned undefined for every coordinate lookup. This adds 3,044 distinct full-postcode points, with leading zeros retained.

coordinates(AUS, postcode)
  trim surrounding whitespace and require four digits
  look up one representative point
  return [longitude, latitude] strings, or undefined

Source: GeoNames AU.zip, retrieved/exported 2026-11-04, CC BY 4.0. Input: 18,566 locality rows / 3,170 codes. Retain 16,443 rows at accuracy 4 or 6, then average distinct coordinate pairs per postcode without duplicate-row weighting. Output: 3,044 records / unique postcodes. Source, hash, regeneration, attribution, primary-source sample checks, and limits are in docs/geocode-AUS.md.

This is incomplete coverage. Estimated rows (levels 1–3) are excluded, including mainland points incorrectly assigned to Norfolk, Christmas, and Cocos Islands. Rural points can be far from towns: the Birdsville sample is about 53 km from the Queensland Government town-area reference. Means are not official postal centroids or physical scan locations; no distance or fraud product is added.

Evidence

  • Before: AUS is absent from the geocode allowlist and has no dataset.
    After: actual lookup tests pass for Darwin 0800, Sydney 2000, Birdsville 4482, and Lord Howe 2898, with all 3,044 records checked through the runtime lookup.
  • 99 tests pass. npm run lint, npm run format:check, and npm run validate:data pass; validation retains two existing AUT/BEL warnings.
  • Generator tests cover duplicate/order invariance, estimated-row exclusion, invalid data, coordinate ranges, postcode uniqueness, accepted surrounding spaces, and unknown/malformed/omitted codes. Regeneration matches committed data byte for byte.

Merge Danger

Door: two-way

Blast Radius: AUS

Only AUS data, generation, documentation, tests, and required runtime wiring change. Existing countries, exports, and coordinate string behavior stay unchanged. lib/geocode.js overlaps other country work; preserve all country entries when resolving conflicts. No merge, deployment, or publish is requested. Coverage is partial and rural accuracy has no guaranteed error bound.

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

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:04:12.288293Z 35b9658 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