@aciesai/fips-county-codes 中文文档教程
用于查找 FIPS 县代码的工具。
Example
const fips = require('fips-county-codes');
fips.get({
"state": "AL",
"county": "Chambers"
});
// 017
fips.get({
"fips": "017"
});
// {
// "state": "AL",
// "county": "Chambers"
// }
Options
Option | Description | type |
---|---|---|
fips | A three digit fips code | string |
state | Two letter state abbrviation | string |
county | County name | string |
Source
美国人口普查局(2010 年)。 以下是全美国的 CSV 数据。
Data manipulation
我对数据集所做的唯一更改是在 CSV 文件中包含一个标题行; 我使用 csv2json 将数据集转换为 JSON。 我没有尝试改变类型。 所有字段都是 String
类型。
Field descriptions
Field Name | Field Description | Example |
---|---|---|
state | State Postal Code | FL |
statefp | State FIPS Code | 12 |
countyfp | County FIPS Code | 011 |
countyname | County name | Broward County |
classfp | FIPS Class Code | H1 |
FIPS Class Codes
- H1: identifies an active county or statistically equivalent entity that does not qualify under subclass C7 or H6.
- H4: identifies a legally defined inactive or nonfunctioning county or statistically equivalent entity that does not qualify under subclass H6.
- H5: identifies census areas in Alaska, a statistical county equivalent entity.
- H6: identifies a county or statistically equivalent entity that is areally coextensive or governmentally consolidated with an incorporated place, part of an incorporated place, or a consolidated city.
- C7: identifies an incorporated place that is an independent city; that is, it also serves as a county equivalent because it is not part of any county, and a minor civil division (MCD) equivalent because it is not part of any MCD.
Browser support
所有现代浏览器。 对于 IE11 支持,您必须填充 Array.find()
。
Tests
npm test
License
A tool for looking up FIPS county codes.
Example
const fips = require('fips-county-codes');
fips.get({
"state": "AL",
"county": "Chambers"
});
// 017
fips.get({
"fips": "017"
});
// {
// "state": "AL",
// "county": "Chambers"
// }
Options
Option | Description | type |
---|---|---|
fips | A three digit fips code | string |
state | Two letter state abbrviation | string |
county | County name | string |
Source
U.S. Census Bureau (2010). Here is the CSV data for all of the United States.
Data manipulation
The only change I made to the dataset was to include a header row in the CSV file; I use csv2json to convert dataset to JSON. I did not attempt to change types. All fields are of type String
.
Field descriptions
Field Name | Field Description | Example |
---|---|---|
state | State Postal Code | FL |
statefp | State FIPS Code | 12 |
countyfp | County FIPS Code | 011 |
countyname | County name | Broward County |
classfp | FIPS Class Code | H1 |
FIPS Class Codes
- H1: identifies an active county or statistically equivalent entity that does not qualify under subclass C7 or H6.
- H4: identifies a legally defined inactive or nonfunctioning county or statistically equivalent entity that does not qualify under subclass H6.
- H5: identifies census areas in Alaska, a statistical county equivalent entity.
- H6: identifies a county or statistically equivalent entity that is areally coextensive or governmentally consolidated with an incorporated place, part of an incorporated place, or a consolidated city.
- C7: identifies an incorporated place that is an independent city; that is, it also serves as a county equivalent because it is not part of any county, and a minor civil division (MCD) equivalent because it is not part of any MCD.
Browser support
All modern browsers. For IE11 support, you must polyfill Array.find()
.
Tests
npm test