feat(postcodes/NZ): 900 New Zealand postcodes (#1039)#1519
Merged
Conversation
Adds New Zealand's 4-digit postcodes from the WaimateWihongi/nz-postcodes mirror (OpenStreetMap-derived, NOT GeoNames-derived). Why --- Closes the NZ gap on issue #1039. NZ Post's bulk feed is paid; OSM is the cleanest publicly redistributable mirror. Coverage -------- - 900 postcodes / 100% state FK - All 17 CSC NZ regions covered - Each row carries WGS-84 lat/lng centroid + structured locality State FK strategy ----------------- Source's 'name' field is inconsistently structured — sometimes the second comma-separated field is the region (e.g. 'Whangarei District, Northland, ...'); sometimes it's a sub-region district / city / community. DESC_TO_ISO2 (33-entry hand map) handles: - 17 CSC regions in canonical English form (with a 'Manawatū-Whanganui' alias for the source's macron variant) - 16 sub-region descriptors mapping to their parent CSC region: Far North District -> NTL Christchurch / Christchurch City / multiple 'X Community' -> CAN Lower Hutt / Porirua / Martinborough Community / S. Wairarapa -> WGN Napier City -> HKB Central Otago District / Queenstown-Lakes District -> OTA Southland District -> STL License ------- WaimateWihongi/nz-postcodes: no formal LICENSE. Upstream: OpenStreetMap (per repo README, Nominatim-derived). Tier 5 per #1039 license-tier policy. NOT GeoNames-derived. Each row: source: "osm-via-waimate-wihongi" Validation ---------- - python3 -m py_compile passes - 100% regex match (^\d{4}$) - 100% state_id valid + state.country_id == 158 + state_code agrees - No auto-managed fields (id, created_at, updated_at, flag) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
CSC Validation ReportPR Format
Labels applied:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Source
WaimateWihongi/nz-postcodes—postcodes.json(200 KB)State FK strategy
Source's
namefield is inconsistently structured — sometimes the second comma-separated field is the region; sometimes it's a sub-region district/city/community.DESC_TO_ISO2(33-entry hand map) handles:Manawatū-Whanganuimacron alias)Far North District→ NTLChristchurch/Christchurch City/ 6 community labels → CANLower Hutt/Porirua/Martinborough Community/South Wairarapa District→ WGNNapier City→ HKBCentral Otago District/Queenstown-Lakes District→ OTASouthland District→ STLDistribution (top 5)
All 17 regions covered.
Test plan
python3 -m py_compile bin/scripts/sync/import_new_zealand_postcodes.py^\d{4}$id,created_at,updated_at,flag)🤖 Generated with Claude Code