State/Province Code
geography.location.state_code2-letter state or province abbreviation. Locale-specific due to country-dependent subdivision codes (e.g., US states, CA provinces, AU states/territories).
Casts to
VARCHAR
Scope
Locale-specific
Locales
EN_US, EN_CA, EN_AU
Per-locale rule
| EN_AU | 8 values, e.g. ACT, NSW, NT |
| EN_CA | 13 values, e.g. AB, BC, MB |
| EN_US | 56 values, e.g. AL, AK, AZ |
Shape
Pattern
^[A-Z]{2}$| Value | Length | Shape |
|---|---|---|
| CA | 2 | matches |
| NY | 2 | matches |
| TX | 2 | matches |
| FL | 2 | matches |
| ON | 2 | matches |
| C | 1 | rejected: one character short |
Told apart
1 of the 5 other location types accept every one of these samples on shape alone.
- Country Codematches them by pattern
Going the other way, this type's own rule accepts 5 of 5 samples of Country Code.
Detection notes
New in v13. Separated from country_code remap (state_code→country_code was causing US state abbreviations like OR, CA, FL to train as country codes). Locale-specific: US (50 states + DC + territories), CA (13 provinces/territories), AU (8 states/territories). AU codes are 2-3 letters but universal pattern is ^[A-Z]{2}$ for the dominant case.
Use it
CLI · DuckDB
$ finetype infer -i "CA" --mode column
→ geography.location.state_code
SELECT ft_infer('CA');
-- → 'geography.location.state_code'Cast expression
UPPER(CAST({col} AS VARCHAR))Schema
https://meridian.online/schemas/geography.location.state_code · Frictionless type string
finetype taxonomy geography.location.state_code -o json-schemaAliases
state_abbreviationprovince_code