feat(postcodes/VI): 6 USVI ZIPs (#1039)#1524
Merged
Merged
Conversation
Mirrors VI-mapped ZIPs from US.json into the separate USVI country
namespace, FK'd to nearest USVI city by centroid distance.
Why
---
USVI uses US ZIPs in the 008xx range, but CSC represents USVI as
its own country (iso2=VI, country_id=242) with 3 island states
(Saint Thomas / Saint John / Saint Croix). Without this mirror,
postcode lookups for VI return empty.
Coverage
--------
- 6 ZIPs / 100% state FK
- All 3 USVI states represented (ST: 00802, SC: 4 codes, SJ: 00830)
State FK strategy
-----------------
Centroid-distance matching against cities/VI.json (20 USVI
localities), then FK to that city's state_id (one of 3 islands).
License
-------
Original source: US Census ZCTA (CC-0).
Each row: source: "us-census-via-vi-mirror"
Validation
----------
- python3 -m py_compile passes
- 100% regex match (^008\d{2}(?:-\d{4})?$)
- 100% state_id valid + state.country_id == 242 + 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: Schema Validation (6 records)✅ All records passed validation Cross-Reference Validation✅ 12 reference(s) verified Source URL Verification✅ 1 source URL(s) accessible ✅ All checks passed | Status: Ready for review |
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
US.jsoninto VI's own country namespace for Can we add a postcode for this? #1039Source
US.jsonunderstate_code='VI'VI.jsonso consumers querying bycountry_code='VI'get the data directlyState FK
Centroid-distance match against
cities/VI.json(20 USVI localities), then FK to that city's state_id (ST/SJ/SC).All 6 codes
Test plan
python3 -m py_compile bin/scripts/sync/import_us_virgin_islands_postcodes.py^008\d{2}(?:-\d{4})?$🤖 Generated with Claude Code