Census Data: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 3: | Line 3: | ||
Note that the [[Census Map]] page also contains some similar information, but focuses on drawing maps with the resulting data. This page focuses specifically on the API and extracting data from the API. | Note that the [[Census Map]] page also contains some similar information, but focuses on drawing maps with the resulting data. This page focuses specifically on the API and extracting data from the API. | ||
=Overview= | |||
Let's start with what we're obtaining from the API and what we need to draw a map. | Let's start with what we're obtaining from the API and what we need to draw a map. | ||
| Line 10: | Line 10: | ||
Both the data and the geographical entities are organized hierarchically. For example, a single table about poverty might have poverty statics broken down by demographics or education level, resulting in several dozen columns. The geographical entities are likewise organized in a hierarchy including the country, states, counties, and census tracts. | Both the data and the geographical entities are organized hierarchically. For example, a single table about poverty might have poverty statics broken down by demographics or education level, resulting in several dozen columns. The geographical entities are likewise organized in a hierarchy including the country, states, counties, and census tracts. | ||
==Geographical Information: References== | |||
Starting with some references: | |||
The Census Reporter Geography page (https://censusreporter.org/topics/geography/) contains a list of codes for geographical hierarchies: | |||
* 010 - United States | |||
* 040 - States | |||
* 050 - Counties | |||
* 140 - Census tracts | |||
* 310 - Metropolitan and micropolitan areas (cities) | |||
* 500 - Congressional district | |||
* 860 - Zip codes | |||
The Missouri Census Data Center's Geography page has a much more extensive overview of codes (https://factfinder.census.gov/help/en/summary_level_code_list.htm) and hierarchies (http://mcdc.missouri.edu/geography/sumlevs/index.shtml), including congressional districts | |||
The official census documentation contains a page on geographic terms and concepts: https://www.census.gov/geo/reference/gtc/gtc_cousub.html | |||
==Geographical Information: API== | |||
When we call the geo API, we have a lot of ways to obtain information. We must specify the following: | |||
* What geographical hierarchy level do we want information about? (The final results will be aggregated by this hierarchy type) | |||
* What geographical entity ID are we passing in? (We have to specify some entity with some ID to limit the results, so we decide what geographical hierarchy level) | |||
* The specific ID of the geographical entity | |||
Revision as of 05:37, 20 February 2018
This page covers the use of the census reporter API to obtain census data: https://github.com/censusreporter/censusreporter
Note that the Census Map page also contains some similar information, but focuses on drawing maps with the resulting data. This page focuses specifically on the API and extracting data from the API.
Overview
Let's start with what we're obtaining from the API and what we need to draw a map.
The census API provides a gateway to census data, which is essentially a very large number of tables of data (the columns), broken down into components and sub-components, for hundreds of thousands of geographical entities (the rows). We can think of each piece of data about a particular location as a cell in a giant spreadsheet.
Both the data and the geographical entities are organized hierarchically. For example, a single table about poverty might have poverty statics broken down by demographics or education level, resulting in several dozen columns. The geographical entities are likewise organized in a hierarchy including the country, states, counties, and census tracts.
Geographical Information: References
Starting with some references:
The Census Reporter Geography page (https://censusreporter.org/topics/geography/) contains a list of codes for geographical hierarchies:
- 010 - United States
- 040 - States
- 050 - Counties
- 140 - Census tracts
- 310 - Metropolitan and micropolitan areas (cities)
- 500 - Congressional district
- 860 - Zip codes
The Missouri Census Data Center's Geography page has a much more extensive overview of codes (https://factfinder.census.gov/help/en/summary_level_code_list.htm) and hierarchies (http://mcdc.missouri.edu/geography/sumlevs/index.shtml), including congressional districts
The official census documentation contains a page on geographic terms and concepts: https://www.census.gov/geo/reference/gtc/gtc_cousub.html
Geographical Information: API
When we call the geo API, we have a lot of ways to obtain information. We must specify the following:
- What geographical hierarchy level do we want information about? (The final results will be aggregated by this hierarchy type)
- What geographical entity ID are we passing in? (We have to specify some entity with some ID to limit the results, so we decide what geographical hierarchy level)
- The specific ID of the geographical entity