Annex A - NGS Country, State & County Codes
This ANNEX contains a list of the countries, states, and counties in the NGS database (NGSIDB) where NGS currently has or expects to have control points.
Note: Country and state symbols listed herein are assigned by NGS and may not agree with other standards for place names. Wherever possible, these codes conform to FIPS 10-4.
2.0 Get the Latest Country, State, and County Codes
You can generate the latest NGS country, state, and county codes list (a.k.a. COUNTRY.DAT file) from the NGS integrated database (NGSIDB). The format of this file is shown below.
2.1 The COUNTRY.DAT File Format
A sample of the COUNTRY.DAT file looks like the following:
...
RA*;UK;UNITED KINGDOM
RB*;UK;UNIDENTIFIED COUNTY IN UNITED KINGDOM
RA*;UR;SOVIET UNION
RB*;UR;UNIDENTIFIED REPUBLIC OF THE SOVIET UNION
RA*;US;UNITED STATES OF AMERICA
RB*;AK;ALASKA
RC*;013;ALEUTIANS EAST BOROUGH
RC*;016;ALEUTIANS WEST CENSUS
RC*;020;ANCHORAGE BOROUGH
RC*;050;BETHEL CENSUS
RC*;060;BRISTOL BAY BOROUGH
RC*;068;DENALI BOROUGH
RC*;070;DILLINGHAM CENSUS
RC*;090;FAIRBANKS NORTH STAR
RC*;100;HAINES BOROUGH
RC*;110;JUNEAU BOROUGH
RC*;122;KENAI PENINSULA BOROUGH
RC*;130;KETCHIKAN GATEWAY BOROUGH
RC*;150;KODIAK ISLAND BOROUGH
RC*;164;LAKE AND PENINSULA
RC*;170;MATANUSKA-SUSITNA BOROUGH
RC*;180;NOME CENSUS
RC*;185;NORTH SLOPE BOROUGH
RC*;188;NORTHWEST ARTIC BOROUGH
RC*;201;PRINCE WALES-OUT KETCH
RC*;220;SITKA BOROUGH
RC*;232;SKAGWAY-HOONAH-ANGOON
RC*;240;SOUTHEAST FAIRBANKS
RC*;261;VALDEZ-CORDOVA CENSUS
RC*;270;WADE HAMPTON CENSUS
RC*;280;WRANGELL-PETERSBURG
RC*;282;YAKUTAT BOROUGH
RC*;290;YUKON-KOYUKUK CENSUS
RB*;AL;ALABAMA
RC*;001;AUTAUGA
RC*;003;BALDWIN
...
Typically, records in the COUNTRY.DAT file appear as such:
COUNTRY_RECORD
STATE_RECORD 1
COUNTY_RECORD 1
COUNTY_RECORD 2
COUNTY_RECORD 3
...
COUNTY_RECORD N-1
COUNTY_RECORD N
STATE_RECORD 2
COUNTY_RECORD 1
COUNTY_RECORD 2
COUNTY_RECORD 3
...
COUNTY_RECORD N-1
COUNTY_RECORD N
STATE_RECORD 3
COUNTY_RECORD 1
COUNTY_RECORD 2
COUNTY_RECORD 3
...
COUNTY_RECORD N-1
COUNTY_RECORD N
...
STATE_RECORD N-1
COUNTY_RECORD 1
COUNTY_RECORD 2
COUNTY_RECORD 3
...
COUNTY_RECORD N-1
COUNTY_RECORD N
STATE_RECORD N
COUNTY_RECORD 1
COUNTY_RECORD 2
COUNTY_RECORD 3
...
COUNTY_RECORD N-1
COUNTY_RECORD N
There are three record types in the COUNTRY.DAT file. They are:
The COUNTRY.DAT Record Types | |
Record Type Code | Meaning |
RA*; | Record is a country record |
RB*; | Record is a state record |
RC*; | Record is a county record |
A Country record has the format:
Country Record Format | ||||
Field Number | Field | Columns | Length | Value |
1 | Record Type Code | 001-004 | 4 | RA*; |
2 | Country Code | 005-006 | 2 | country FIPS code |
3 | Separator | 007-007 | 1 | ; |
4 | Country Fullname | 008-047 | 40 | fullname of country (i.e. "UNITED STATES OF AMERICA") |
5 | Newline | 048-048 | 1 | '\n' |
A state record has the format:
State Record Format | ||||
Field Number | Field | Columns | Length | Value |
1 | Record Type Code | 001-004 | 4 | RB*; |
2 | State Code | 005-006 | 2 | abbreviated state code (i.e. "AK") |
3 | Separator | 007-007 | 1 | ; |
4 | State Fullname | 008-047 | 40 | fullname of state (i.e. "Alaska") |
5 | Newline | 048-048 | 1 | '\n' |
A county record has the format:
County Record Format | ||||
Field Number | Field | Columns | Length | Value |
1 | Record Type Code | 001-004 | 4 | RC*; |
2 | County Code | 005-007 | 3 | county FIPS code (i.e. "020") |
3 | Separator | 008-008 | 1 | ; |
4 | County Fullname | 009-033 | 25 | fullname of county (i.e. "ANCHORAGE") |
5 | Newline | 034-034 | 1 | '\n' |
It should be noted that the Country Fullname field of the COUNTRY record, the State Fullname field of the STATE record, and the County Fullname field of the COUNTY record are padded with trailing blanks if their character length is not exactly 40, 40, and 25, respectively.
In NGSIDB, each country (COUNTRY record) has at least one state (STATE record). It may be an "unidentified" state, but there is always a state. Thus, all states for each country are written to the COUNTRY.DAT file. By contrast, for a country whose state has no county, no COUNTY record is written to the COUNTRY.DAT file for that particular state.
3.0 Instructions for Creating a COUNTRY.DAT File for the WDDPROC Software Suite
If you wish to generate an updated country.dat file for use in the WDDPROC Software Suite, simply follow the instructions below. The country.dat file is used by the WDESC program (a program within the WDDPROC Software Suite).
Step | Instruction |
---|---|
1 | Select Get the Latest Country, State, & County Codes from the Annex A home page. |
2 | Click on the word generate in the right frame to generate the latest country, state, and county codes from the NGSIDB. |
3 | Click on the right frame where the generated country, state, and county codes are displayed. |
4 | If you are using Internet Explorer (IE):
(a) Right-mouse click in the right frame and choose Select All from the pop-up menu. (b) Choose Copy from the Edit menu. (c) Click on the Microsoft [START] button and then select the menupath Programs.., Accessories..., Notepad. (d) On the Notepad menu select the menupath Edit, Paste to bring the data into the current window. (e) In the Save in field select the directory of the WDDPROC.EXE program (e.g. generally located at C:\WDDPROC). (f) Press the [Save] button. The country.dat file is now updated in the WDDPROC Software Suite.
If you are using Netscape: (a) From the Netscape File menu select the menu option Save As.... (b) Enter country.dat into the File name field. (c) In the Save in field select the directory of the WDDPROC.exe program (i.e. generally located at C:\WDDPROC). (d) Press the [Save] button. The country.dat file will be updated in the WDDPROC Software Suite. |
5 | On your PC (a) select the [START] button (b) select Programs..., (c) select Accessories..., then (d) select Notepad. (e) Edit out all the HTML at the top and the bottom of the document (i.e. the stuff between and including the "<" and ">" characters). (f) Save the file again as country.dat. |
6 | Place the country.dat file on your PC in the same directory as the WDESC program. |
7 | Run the WDESC program. The fields that are affected by the country.dat file are (1) the Country, State, and County codes on the Project Header Form, and (2) the Country, State, and County fields on the Description Header Form. |
8 | If you are having problems with the WDESC program recognizing the changed country.dat file, you will need to get into the Microsoft
Registry. To do this: (a) on your PC press the [START] button. (b) Select Run... from the menu. (c) When the Run window comes up, enter regedit into the Open field and press the [OK] button. (d) In the Registry Edit window double-click on the HKEY_CURRENT_USER folder, followed by the Software folder, followed by the National Geodetic Survey folder, and finally the WDesc folder. In the right frame of the Registry Editor window, is a list of Name/Data pairs. The country.dat_location name's data field should be something like "C:\WDDPROC\country.dat". See step 6. |