UN-LOCODE Codelist
Files | Size | Format | Created | Updated | License | Source |
---|---|---|---|---|---|---|
6 | 7.64 MB | csv | 3 months ago | Open Data Commons Public Domain Dedication and License v1.0 | UNECE |
The United Nations Code for Trade and Transport Locations is a code list mantained by UNECE, United Nations agency, to facilitate trade. Data comes from the UNECE page, released at least once a yea...
Data Files
File | Description | Size | Last modified | Download |
---|---|---|---|---|
code-list | 7.39 MB | 7 days ago | code-list | |
country-codes | 4.18 kB | 3 months ago | country-codes | |
function-classifiers | 300 B | 3 months ago | function-classifiers | |
status-indicators | 827 B | 3 months ago | status-indicators | |
subdivision-codes | 233 kB | 7 days ago | subdivision-codes | |
alias | 4.77 kB | 7 days ago | alias |
Data Previews
code-list
Schema
name | type | description | pattern |
---|---|---|---|
Change | string | + (newly added); X (to be removed); | (changed); # (name changed); = (reference entry); ! (US location with duplicate IATA code) | |
Country | string | ISO 3166 alpha-2 Country Code, defined in countryCodes.csv | [A-Z]{2} |
Location | string | [A-Z2-9]{3} | |
Name | string | ||
NameWoDiacritics | string | ||
Subdivision | string | Defined in subdivisionCodes.csv | |
Status | string | Defined in statusIndicators.csv | |
Function | string | Defined in functionClassifiers.csv | [01-][2-][3-][4-][5-][6-][7-][B-] |
Date | string | ym | [0-9]{4} |
IATA | string | IATA code if different from LOCODE | |
Coordinates | string | DDMM[N/S] DDDMM[W/E] | [0-9]{4}[NS] [0-9]{5}[WE] |
Remarks | string |
country-codes
Schema
name | type |
---|---|
CountryCode | string |
CountryName | string |
function-classifiers
Schema
name | type |
---|---|
FunctionCode | string |
FunctionDescription | string |
status-indicators
Schema
name | type |
---|---|
STStatus | string |
STDescription | string |
subdivision-codes
Schema
name | type |
---|---|
SUCountry | string |
SUCode | string |
SUName | string |
The United Nations Code for Trade and Transport Locations is a code list mantained by UNECE, United Nations agency, to facilitate trade.
Data
Data comes from the UNECE page, released at least once a year.
Preparation
As the original release files have encoding problems, we need to process both the mdb and the csv release. To build the dataset we use the csv version of the current edition.
Tools needed: MDBTools and CSVKit.
Download the current edition from UNECE and put it into the root directory.
Then execute bash scripts/prepare_edition_mdb.sh loc{ed}mdb.zip
, where {ed}
identify the release.
To integrate the data from the csv then run the python file
Prerequisites:
pip install pandas titlecase
Run:
python scripts/integrate.py loc232csv.zip
The provided prepare.py
file would work alone when the original csv file will be fixed upstream.
License
All data is licensed under the ODC Public Domain Dedication and Licence (PDDL).