From 6e9f4a03d11367e61ed87f3113869f06736e4657 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Wed, 20 Apr 2016 13:28:27 -0400 Subject: [PATCH 01/15] Adding OBS_search function and tests --- src/pg/sql/42_observatory_exploration.sql | 33 +++++++++++++++++++ .../42_observatroy_exploration_test.out | 29 ++++++++++++++++ .../sql/42_observatory_exploration_test.sql | 3 ++ 3 files changed, 65 insertions(+) create mode 100644 src/pg/sql/42_observatory_exploration.sql create mode 100644 src/pg/test/expected/42_observatroy_exploration_test.out create mode 100644 src/pg/test/sql/42_observatory_exploration_test.sql diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql new file mode 100644 index 0000000..fd6961f --- /dev/null +++ b/src/pg/sql/42_observatory_exploration.sql @@ -0,0 +1,33 @@ +-- Functions used to search the observatory for measures +-------------------------------------------------------------------------------- +-- TODO allow the user to specify the boundary to search for measures +-- + +CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search( + search_term text, + relevant_boundary text DEFAULT null +) +RETURNS TABLE(description text, name text, aggregate text, source text) as $$ +DECLARE + boundary_term text; +BEGIN + IF relevant_boundary then + boundary_term = ''; + else + boundary_term = ''; + END IF; + + RETURN QUERY + EXECUTE format($string$ + SELECT description, + name, + aggregate, + replace(split_part(id,'".', 1),'"', '') source + FROM observatory.OBS_column + where name ilike '%%%s%%' + or description ilike '%%%s%%' + %s + $string$, search_term, search_term,boundary_term); + RETURN; +END +$$ LANGUAGE plpgsql; diff --git a/src/pg/test/expected/42_observatroy_exploration_test.out b/src/pg/test/expected/42_observatroy_exploration_test.out new file mode 100644 index 0000000..b95c1f4 --- /dev/null +++ b/src/pg/test/expected/42_observatroy_exploration_test.out @@ -0,0 +1,29 @@ +\i test/sql/load_fixtures.sql +SET client_min_messages TO WARNING; +\set ECHO none +Loading obs_table.sql fixture file... +Done. +Loading obs_column.sql fixture file... +Done. +Loading obs_column_table.sql fixture file... +Done. +Loading obs_column_to_column.sql fixture file... +Done. +Loading obs_85328201013baa14e8e8a4a57a01e6f6fbc5f9b1.sql fixture file... +Done. +Loading obs_3e7cc9cfd403b912c57b42d5f9195af9ce2f3cdb.sql fixture file... +Done. +Loading obs_ab038198aaab3f3cb055758638ee4de28ad70146.sql fixture file... +Done. +Loading obs_a92e1111ad3177676471d66bb8036e6d057f271b.sql fixture file... +Done. +Loading obs_11ee8b82c877c073438bc935a91d3dfccef875d1.sql fixture file... +Done. +Loading obs_d34555209878e8c4b37cf0b2b3d072ff129ec470.sql fixture file... +Done. +obs_search_stu +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +("The total number of all people living in a geographic area.","Total Population",sum,es.ine) +("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Total Population",sum,us.census.acs) +("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Quantile:Total Population",quantile,us.census.acs) +(3 rows) diff --git a/src/pg/test/sql/42_observatory_exploration_test.sql b/src/pg/test/sql/42_observatory_exploration_test.sql new file mode 100644 index 0000000..22c811e --- /dev/null +++ b/src/pg/test/sql/42_observatory_exploration_test.sql @@ -0,0 +1,3 @@ +\i test/sql/load_fixtures.sql + +SELECT cdb_observatory.OBS_Search('total_pop'); From a29876f47f6b4e7b5f85b13ce3caef0761b73499 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Wed, 20 Apr 2016 13:42:13 -0400 Subject: [PATCH 02/15] making obs_search a bit more secure --- src/pg/sql/42_observatory_exploration.sql | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index fd6961f..b845e85 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -3,7 +3,7 @@ -- TODO allow the user to specify the boundary to search for measures -- -CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search( +CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search_STU( search_term text, relevant_boundary text DEFAULT null ) @@ -24,10 +24,21 @@ BEGIN aggregate, replace(split_part(id,'".', 1),'"', '') source FROM observatory.OBS_column - where name ilike '%%%s%%' - or description ilike '%%%s%%' + where name ilike '%'|| %L || '%' + or description ilike '%'|| %L || '%' %s $string$, search_term, search_term,boundary_term); RETURN; END $$ LANGUAGE plpgsql; + + +CREATE OR REPLACE FUNCTION OBS_GetAvailableBoundaries(geometry location) +RETURNS TABLE(description text, name text, id text) as $$ +BEGIN + RETURN QUERY + EXECUTE format($string$ + Select description, name, id FROM observatory.OBS_column + $string$) +END +$$ From b8d42a41dd1ed9f5cde34caa2f644a9a01ff316c Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Wed, 20 Apr 2016 15:28:45 -0400 Subject: [PATCH 03/15] adding OBS_GetAvailableBoundaries --- src/pg/sql/42_observatory_exploration.sql | 43 ++++++++++++++++--- .../sql/42_observatory_exploration_test.sql | 2 + 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index b845e85..a6063fa 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -24,8 +24,8 @@ BEGIN aggregate, replace(split_part(id,'".', 1),'"', '') source FROM observatory.OBS_column - where name ilike '%'|| %L || '%' - or description ilike '%'|| %L || '%' + where name ilike '%%' || %L || '%%' + or description ilike '%%' || %L || '%%' %s $string$, search_term, search_term,boundary_term); RETURN; @@ -33,12 +33,41 @@ END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION OBS_GetAvailableBoundaries(geometry location) +-- Functions to return the geometry levels that a point is part of +-------------------------------------------------------------------------------- +-- TODO add test response + +CREATE OR REPLACE FUNCTION OBS_GetAvailableBoundaries( + geom geometry, + time_span text DEFAULT null) RETURNS TABLE(description text, name text, id text) as $$ +DECLARE + timespan_query TEXT DEFAULT ''; BEGIN + + IF time_span != null THEN + timespan_query = format('AND timespan = %L', time_span); + END IF; + RETURN QUERY - EXECUTE format($string$ - Select description, name, id FROM observatory.OBS_column - $string$) + EXECUTE + $string$ + select + column_id, + obs_column.description, + table_id + FROM + observatory.OBS_table, + observatory.OBS_column_table, + observatory.OBS_column + WHERE + observatory.OBS_column_table.column_id = observatory.obs_column.id + AND + observatory.OBS_column.type='Geometry' + AND + $1 && bounds::box2d + $string$ || timespan_query + USING geom + RETURN; END -$$ +$$ LANGUAGE plpgsql; diff --git a/src/pg/test/sql/42_observatory_exploration_test.sql b/src/pg/test/sql/42_observatory_exploration_test.sql index 22c811e..f9173ee 100644 --- a/src/pg/test/sql/42_observatory_exploration_test.sql +++ b/src/pg/test/sql/42_observatory_exploration_test.sql @@ -1,3 +1,5 @@ \i test/sql/load_fixtures.sql SELECT cdb_observatory.OBS_Search('total_pop'); + +SELECT * from cdb_observatory.OBS_GetAvailableBoundaries(_test_point()); From 83119d0720bcbe80f05601c86b360e189fc2628b Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:12:23 -0400 Subject: [PATCH 04/15] fix expectation typo --- ...y_exploration_test.out => 42_observatory_exploration_test.out} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/pg/test/expected/{42_observatroy_exploration_test.out => 42_observatory_exploration_test.out} (100%) diff --git a/src/pg/test/expected/42_observatroy_exploration_test.out b/src/pg/test/expected/42_observatory_exploration_test.out similarity index 100% rename from src/pg/test/expected/42_observatroy_exploration_test.out rename to src/pg/test/expected/42_observatory_exploration_test.out From d016c4b4bd3cfe13623bdac5850c7e09f3c036b6 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:15:39 -0400 Subject: [PATCH 05/15] remove typo in sql def --- src/pg/sql/42_observatory_exploration.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index a6063fa..e929052 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -3,7 +3,7 @@ -- TODO allow the user to specify the boundary to search for measures -- -CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search_STU( +CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search( search_term text, relevant_boundary text DEFAULT null ) From 1f6347aa23d03e2e3d7530a47b6fb5007d200e87 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:18:20 -0400 Subject: [PATCH 06/15] adjusting expectations to reflect reality of the situation --- src/pg/test/expected/42_observatory_exploration_test.out | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pg/test/expected/42_observatory_exploration_test.out b/src/pg/test/expected/42_observatory_exploration_test.out index b95c1f4..9f84d39 100644 --- a/src/pg/test/expected/42_observatory_exploration_test.out +++ b/src/pg/test/expected/42_observatory_exploration_test.out @@ -21,9 +21,9 @@ Loading obs_11ee8b82c877c073438bc935a91d3dfccef875d1.sql fixture file... Done. Loading obs_d34555209878e8c4b37cf0b2b3d072ff129ec470.sql fixture file... Done. -obs_search_stu + obs_search ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -("The total number of all people living in a geographic area.","Total Population",sum,es.ine) -("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Total Population",sum,us.census.acs) -("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Quantile:Total Population",quantile,us.census.acs) + ("The total number of all people living in a geographic area.","Total Population",sum,es.ine) + ("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Total Population",sum,us.census.acs) + ("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Quantile:Total Population",quantile,us.census.acs) (3 rows) From 73f4a682cf336cc3476835e2c261f483ae47a15c Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:22:13 -0400 Subject: [PATCH 07/15] fix whitespace and testpoint --- src/pg/test/expected/42_observatory_exploration_test.out | 2 +- src/pg/test/sql/42_observatory_exploration_test.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pg/test/expected/42_observatory_exploration_test.out b/src/pg/test/expected/42_observatory_exploration_test.out index 9f84d39..3191605 100644 --- a/src/pg/test/expected/42_observatory_exploration_test.out +++ b/src/pg/test/expected/42_observatory_exploration_test.out @@ -21,7 +21,7 @@ Loading obs_11ee8b82c877c073438bc935a91d3dfccef875d1.sql fixture file... Done. Loading obs_d34555209878e8c4b37cf0b2b3d072ff129ec470.sql fixture file... Done. - obs_search + obs_search ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ("The total number of all people living in a geographic area.","Total Population",sum,es.ine) ("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Total Population",sum,us.census.acs) diff --git a/src/pg/test/sql/42_observatory_exploration_test.sql b/src/pg/test/sql/42_observatory_exploration_test.sql index f9173ee..4a08e87 100644 --- a/src/pg/test/sql/42_observatory_exploration_test.sql +++ b/src/pg/test/sql/42_observatory_exploration_test.sql @@ -2,4 +2,4 @@ SELECT cdb_observatory.OBS_Search('total_pop'); -SELECT * from cdb_observatory.OBS_GetAvailableBoundaries(_test_point()); +SELECT * from cdb_observatory.OBS_GetAvailableBoundaries(cdb_observatory._test_point()); From 594c6b5d8068da2d62ef68b0427ba88843294264 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:23:57 -0400 Subject: [PATCH 08/15] test_point => TestPoint --- src/pg/test/sql/42_observatory_exploration_test.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg/test/sql/42_observatory_exploration_test.sql b/src/pg/test/sql/42_observatory_exploration_test.sql index 4a08e87..479caf3 100644 --- a/src/pg/test/sql/42_observatory_exploration_test.sql +++ b/src/pg/test/sql/42_observatory_exploration_test.sql @@ -2,4 +2,4 @@ SELECT cdb_observatory.OBS_Search('total_pop'); -SELECT * from cdb_observatory.OBS_GetAvailableBoundaries(cdb_observatory._test_point()); +SELECT * from cdb_observatory.OBS_GetAvailableBoundaries(cdb_observatory._TestPoint()); From 6696d4fcf5ae4351394313d503f94ab1fc2e3359 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:45:24 -0400 Subject: [PATCH 09/15] adding id to return for obs_search, fixing OBS_GetAvailableBoundaries --- src/pg/sql/42_observatory_exploration.sql | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index e929052..0460237 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -7,7 +7,7 @@ CREATE OR REPLACE FUNCTION cdb_observatory.OBS_Search( search_term text, relevant_boundary text DEFAULT null ) -RETURNS TABLE(description text, name text, aggregate text, source text) as $$ +RETURNS TABLE(id text, description text, name text, aggregate text, source text) as $$ DECLARE boundary_term text; BEGIN @@ -19,7 +19,7 @@ BEGIN RETURN QUERY EXECUTE format($string$ - SELECT description, + SELECT id, description, name, aggregate, replace(split_part(id,'".', 1),'"', '') source @@ -40,7 +40,7 @@ $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION OBS_GetAvailableBoundaries( geom geometry, time_span text DEFAULT null) -RETURNS TABLE(description text, name text, id text) as $$ +RETURNS TABLE(boundary_id text, description text, time_span text, tablename text) as $$ DECLARE timespan_query TEXT DEFAULT ''; BEGIN @@ -53,15 +53,17 @@ BEGIN EXECUTE $string$ select - column_id, + column_id boundary_id, obs_column.description, - table_id + timespan time_span, + tablename FROM observatory.OBS_table, observatory.OBS_column_table, observatory.OBS_column WHERE observatory.OBS_column_table.column_id = observatory.obs_column.id + observatory.OBS_column_table.table_id = observatory.obs_table.id AND observatory.OBS_column.type='Geometry' AND From a6655003aaeb884ff6cec1efb59a240c55969469 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:47:40 -0400 Subject: [PATCH 10/15] fix duplicate var name issue --- src/pg/sql/42_observatory_exploration.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index 0460237..ea87b21 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -53,9 +53,9 @@ BEGIN EXECUTE $string$ select - column_id boundary_id, + column_id, obs_column.description, - timespan time_span, + timespan, tablename FROM observatory.OBS_table, From 851419a927769d04d91d71c28ff99dce913b6963 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:49:41 -0400 Subject: [PATCH 11/15] fix duplicate var name issue --- src/pg/sql/42_observatory_exploration.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index ea87b21..8a72777 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -39,7 +39,7 @@ $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION OBS_GetAvailableBoundaries( geom geometry, - time_span text DEFAULT null) + timespan text DEFAULT null) RETURNS TABLE(boundary_id text, description text, time_span text, tablename text) as $$ DECLARE timespan_query TEXT DEFAULT ''; From 39e9ff32e56a32c3176ea41630841dd56a240ae0 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 16:57:07 -0400 Subject: [PATCH 12/15] missing "and" --- src/pg/sql/42_observatory_exploration.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pg/sql/42_observatory_exploration.sql b/src/pg/sql/42_observatory_exploration.sql index 8a72777..b40a0ae 100644 --- a/src/pg/sql/42_observatory_exploration.sql +++ b/src/pg/sql/42_observatory_exploration.sql @@ -62,7 +62,7 @@ BEGIN observatory.OBS_column_table, observatory.OBS_column WHERE - observatory.OBS_column_table.column_id = observatory.obs_column.id + observatory.OBS_column_table.column_id = observatory.obs_column.id AND observatory.OBS_column_table.table_id = observatory.obs_table.id AND observatory.OBS_column.type='Geometry' From 30c1ed08c0e879110431daeafbc41a8ac6a176ed Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 17:05:29 -0400 Subject: [PATCH 13/15] adjusting expectations --- .../42_observatory_exploration_test.out | 48 +++++++++++++++++-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/src/pg/test/expected/42_observatory_exploration_test.out b/src/pg/test/expected/42_observatory_exploration_test.out index 3191605..6dcf77f 100644 --- a/src/pg/test/expected/42_observatory_exploration_test.out +++ b/src/pg/test/expected/42_observatory_exploration_test.out @@ -21,9 +21,47 @@ Loading obs_11ee8b82c877c073438bc935a91d3dfccef875d1.sql fixture file... Done. Loading obs_d34555209878e8c4b37cf0b2b3d072ff129ec470.sql fixture file... Done. - obs_search ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - ("The total number of all people living in a geographic area.","Total Population",sum,es.ine) - ("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Total Population",sum,us.census.acs) - ("The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Quantile:Total Population",quantile,us.census.acs) + obs_search +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + ("""es.ine"".total_pop","The total number of all people living in a geographic area.","Total Population",sum,es.ine) + ("""us.census.acs"".B01001001","The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Total Population",sum,us.census.acs) + ("""us.census.acs"".B01001001_quantile","The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Quantile:Total Population",quantile,us.census.acs) (3 rows) + + boundary_id | description | time_span | tablename +--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------------------------------- + "us.census.tiger".block_group | Block groups (BGs) are statistical divisions of census tracts, are generally defined to contain between 600 and 3,000 people, and are used to present data and control block numbering. A block group consists of clusters of blocks within the same census tract that have the same first digit of their four-digit census block number. For example, blocks 3001, 3002, 3003, ..., 3999 in census tract 1210.02 belong to BG 3 in that census tract. Most BGs were delineated by local participants in the Census Bureau\u2019s Participant Statistical Areas Program. The Census Bureau delineated BGs only where a local or tribal government declined to participate, and a regional organization or State Data Center was not available to participate.\r +| 2013 | obs_85328201013baa14e8e8a4a57a01e6f6fbc5f9b1 + | \r +| | + | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | + "us.census.tiger".census_tract | Census tracts are identified by an up to four-digit integer number and may have an optional two-digit suffix; for example 1457.02 or 23. The census tract codes consist of six digits with an implied decimal between the fourth and fifth digit corresponding to the basic census tract number but with leading zeroes and trailing zeroes for census tracts without a suffix. The tract number examples above would have codes of 145702 and 002300, respectively.\r +| 2013 | obs_a92e1111ad3177676471d66bb8036e6d057f271b + | \r +| | + | Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.\r +| | + | \r +| | + | The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.\r +| | + | \r +| | + | The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d). | | + "us.census.tiger".state | States and Equivalent Entities are the primary governmental divisions of the United States. In addition to the 50 states, the Census Bureau treats the District of Columbia, Puerto Rico, American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands as the statistical equivalents of states for the purpose of data presentation. | 2013 | obs_f3f0912fe24bc0c976e837b5a116d0c803cc01ce + "us.census.tiger".puma | PUMAs are geographic areas for which the Census Bureau provides selected extracts of raw data from a small sample of census records that are screened to protect confidentiality. These extracts are referred to as public use microdata sample (PUMS) files.\r +| 2013 | obs_0008b162b516c295d7204c9ba043ab5dbc67c59c + | \r +| | + | For the 2010 Census, each state, the District of Columbia, Puerto Rico, and some Island Area participants delineated PUMAs for use in presenting PUMS data based on a 5 percent sample of decennial census or American Community Survey data. These areas are required to contain at least 100,000 people. This is different from Census 2000 when two types of PUMAs were defined: a 5 percent PUMA as for 2010 and an additional super-PUMA designed to provide a 1 percent sample. The PUMAs are identified by a five-digit census code unique within state. | | + "us.census.tiger".zcta5 | ZCTAs are approximate area representations of U.S. Postal Service (USPS) five-digit ZIP Code service areas that the Census Bureau creates using whole blocks to present statistical data from censuses and surveys. The Census Bureau defines ZCTAs by allocating each block that contains addresses to a single ZCTA, usually to the ZCTA that reflects the most frequently occurring ZIP Code for the addresses within that tabulation block. Blocks that do not contain addresses but are completely surrounded by a single ZCTA (enclaves) are assigned to the surrounding ZCTA; those surrounded by multiple ZCTAs will be added to a single ZCTA based on limited buffering performed between multiple ZCTAs. The Census Bureau identifies five-digit ZCTAs using a five-character numeric code that represents the most frequently occurring USPS ZIP Code within that ZCTA, and this code may contain leading zeros.\r +| 2013 | obs_d483723c5cc76c107d9e0af279d1e7056df3c2be + | \r +| | + | There are significant changes to the 2010 ZCTA delineation from that used in 2000. Coverage was extended to include the Island Areas for 2010 so that the United States, Puerto Rico, and the Island Areas have ZCTAs. Unlike 2000, when areas that could not be assigned to a ZCTA were given a generic code ending in \u201cXX\u201d (land area) or \u201cHH\u201d (water area), for 2010 there is no universal coverage by ZCTAs, and only legitimate five-digit areas are defined. The 2010 ZCTAs will better represent the actual Zip Code service areas because the Census Bureau initiated a process before creation of 2010 blocks to add block boundaries that split polygons with large numbers of addresses using different Zip Codes.\r +| | + | \r +| | + | Data users should not use ZCTAs to identify the official USPS ZIP Code for mail delivery. The USPS makes periodic changes to ZIP Codes to support more efficient mail delivery. The ZCTAs process used primarily residential addresses and was biased towards Zip Codes used for city-style mail delivery, thus there may be Zip Codes that are primarily nonresidential or boxes only that may not have a corresponding ZCTA. | | + "us.census.tiger".county | The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and census areas; the latter of which are delineated cooperatively for statistical purposes by the state of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. All of the counties in Connecticut and Rhode Island and nine counties in Massachusetts were dissolved as functioning governmental entities; however, the Census Bureau continues to present data for these historical entities in order to provide comparable geographic units at the county level of the geographic hierarchy for these states and represents them as nonfunctioning legal entities in data products. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: municipios in Puerto Rico, districts and islands in American Samoa, municipalities in the Commonwealth of the Northern Mariana Islands, and islands in the U.S. Virgin Islands. Each county or statistically equivalent entity is assigned a three-character numeric Federal Information Processing Series (FIPS) code based on alphabetical sequence that is unique within state and an eight-digit National Standard feature identifier. | 2013 | obs_b0ef6dd68d5faddbf231fd7f02916b3d00ec43c4 + "us.census.tiger".state | States and Equivalent Entities are the primary governmental divisions of the United States. In addition to the 50 states, the Census Bureau treats the District of Columbia, Puerto Rico, American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands as the statistical equivalents of states for the purpose of data presentation. | 2013 | obs_a20f5260b618a2fe2eb95fc1e23febe0db7db096 + "us.census.tiger".county | The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and census areas; the latter of which are delineated cooperatively for statistical purposes by the state of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. All of the counties in Connecticut and Rhode Island and nine counties in Massachusetts were dissolved as functioning governmental entities; however, the Census Bureau continues to present data for these historical entities in order to provide comparable geographic units at the county level of the geographic hierarchy for these states and represents them as nonfunctioning legal entities in data products. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: municipios in Puerto Rico, districts and islands in American Samoa, municipalities in the Commonwealth of the Northern Mariana Islands, and islands in the U.S. Virgin Islands. Each county or statistically equivalent entity is assigned a three-character numeric Federal Information Processing Series (FIPS) code based on alphabetical sequence that is unique within state and an eight-digit National Standard feature identifier. | 2013 | obs_23da37d4e66e9de2f525572967f8618bde99a8c0 + "us.census.tiger".census_tract | Census tracts are identified by an up to four-digit integer number and may have an optional two-digit suffix; for example 1457.02 or 23. The census tract codes consist of six digits with an implied decimal between the fourth and fifth digit corresponding to the basic census tract number but with leading zeroes and trailing zeroes for census tracts without a suffix. The tract number examples above would have codes of 145702 and 002300, respectively.\r +| 2013 | obs_d125aeef87aaa23287a40b454519ece22ee25acf + | \r +| | + | Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.\r +| | + | \r +| | + | The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.\r +| | + | \r +| | + | The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d). | | + "us.census.tiger".block_group | Block groups (BGs) are statistical divisions of census tracts, are generally defined to contain between 600 and 3,000 people, and are used to present data and control block numbering. A block group consists of clusters of blocks within the same census tract that have the same first digit of their four-digit census block number. For example, blocks 3001, 3002, 3003, ..., 3999 in census tract 1210.02 belong to BG 3 in that census tract. Most BGs were delineated by local participants in the Census Bureau\u2019s Participant Statistical Areas Program. The Census Bureau delineated BGs only where a local or tribal government declined to participate, and a regional organization or State Data Center was not available to participate.\r +| 2013 | obs_d610cb3225f282693b8d4dcd98d2c2e2078354c6 + | \r +| | + | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | +(10 rows) + + From 1702a392b387995c5eca902bfcffc3813f31c6dc Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 17:08:56 -0400 Subject: [PATCH 14/15] add trailing whitespace --- .../42_observatory_exploration_test.out | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/pg/test/expected/42_observatory_exploration_test.out b/src/pg/test/expected/42_observatory_exploration_test.out index 6dcf77f..35065fe 100644 --- a/src/pg/test/expected/42_observatory_exploration_test.out +++ b/src/pg/test/expected/42_observatory_exploration_test.out @@ -31,37 +31,37 @@ Done. boundary_id | description | time_span | tablename --------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------------------------------- "us.census.tiger".block_group | Block groups (BGs) are statistical divisions of census tracts, are generally defined to contain between 600 and 3,000 people, and are used to present data and control block numbering. A block group consists of clusters of blocks within the same census tract that have the same first digit of their four-digit census block number. For example, blocks 3001, 3002, 3003, ..., 3999 in census tract 1210.02 belong to BG 3 in that census tract. Most BGs were delineated by local participants in the Census Bureau\u2019s Participant Statistical Areas Program. The Census Bureau delineated BGs only where a local or tribal government declined to participate, and a regional organization or State Data Center was not available to participate.\r +| 2013 | obs_85328201013baa14e8e8a4a57a01e6f6fbc5f9b1 - | \r +| | - | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | + | \r +| | + | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | "us.census.tiger".census_tract | Census tracts are identified by an up to four-digit integer number and may have an optional two-digit suffix; for example 1457.02 or 23. The census tract codes consist of six digits with an implied decimal between the fourth and fifth digit corresponding to the basic census tract number but with leading zeroes and trailing zeroes for census tracts without a suffix. The tract number examples above would have codes of 145702 and 002300, respectively.\r +| 2013 | obs_a92e1111ad3177676471d66bb8036e6d057f271b - | \r +| | - | Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.\r +| | - | \r +| | - | The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.\r +| | - | \r +| | - | The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d). | | + | \r +| | + | Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.\r +| | + | \r +| | + | The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.\r +| | + | \r +| | + | The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d). | | "us.census.tiger".state | States and Equivalent Entities are the primary governmental divisions of the United States. In addition to the 50 states, the Census Bureau treats the District of Columbia, Puerto Rico, American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands as the statistical equivalents of states for the purpose of data presentation. | 2013 | obs_f3f0912fe24bc0c976e837b5a116d0c803cc01ce "us.census.tiger".puma | PUMAs are geographic areas for which the Census Bureau provides selected extracts of raw data from a small sample of census records that are screened to protect confidentiality. These extracts are referred to as public use microdata sample (PUMS) files.\r +| 2013 | obs_0008b162b516c295d7204c9ba043ab5dbc67c59c - | \r +| | - | For the 2010 Census, each state, the District of Columbia, Puerto Rico, and some Island Area participants delineated PUMAs for use in presenting PUMS data based on a 5 percent sample of decennial census or American Community Survey data. These areas are required to contain at least 100,000 people. This is different from Census 2000 when two types of PUMAs were defined: a 5 percent PUMA as for 2010 and an additional super-PUMA designed to provide a 1 percent sample. The PUMAs are identified by a five-digit census code unique within state. | | + | \r +| | + | For the 2010 Census, each state, the District of Columbia, Puerto Rico, and some Island Area participants delineated PUMAs for use in presenting PUMS data based on a 5 percent sample of decennial census or American Community Survey data. These areas are required to contain at least 100,000 people. This is different from Census 2000 when two types of PUMAs were defined: a 5 percent PUMA as for 2010 and an additional super-PUMA designed to provide a 1 percent sample. The PUMAs are identified by a five-digit census code unique within state. | | "us.census.tiger".zcta5 | ZCTAs are approximate area representations of U.S. Postal Service (USPS) five-digit ZIP Code service areas that the Census Bureau creates using whole blocks to present statistical data from censuses and surveys. The Census Bureau defines ZCTAs by allocating each block that contains addresses to a single ZCTA, usually to the ZCTA that reflects the most frequently occurring ZIP Code for the addresses within that tabulation block. Blocks that do not contain addresses but are completely surrounded by a single ZCTA (enclaves) are assigned to the surrounding ZCTA; those surrounded by multiple ZCTAs will be added to a single ZCTA based on limited buffering performed between multiple ZCTAs. The Census Bureau identifies five-digit ZCTAs using a five-character numeric code that represents the most frequently occurring USPS ZIP Code within that ZCTA, and this code may contain leading zeros.\r +| 2013 | obs_d483723c5cc76c107d9e0af279d1e7056df3c2be - | \r +| | - | There are significant changes to the 2010 ZCTA delineation from that used in 2000. Coverage was extended to include the Island Areas for 2010 so that the United States, Puerto Rico, and the Island Areas have ZCTAs. Unlike 2000, when areas that could not be assigned to a ZCTA were given a generic code ending in \u201cXX\u201d (land area) or \u201cHH\u201d (water area), for 2010 there is no universal coverage by ZCTAs, and only legitimate five-digit areas are defined. The 2010 ZCTAs will better represent the actual Zip Code service areas because the Census Bureau initiated a process before creation of 2010 blocks to add block boundaries that split polygons with large numbers of addresses using different Zip Codes.\r +| | - | \r +| | - | Data users should not use ZCTAs to identify the official USPS ZIP Code for mail delivery. The USPS makes periodic changes to ZIP Codes to support more efficient mail delivery. The ZCTAs process used primarily residential addresses and was biased towards Zip Codes used for city-style mail delivery, thus there may be Zip Codes that are primarily nonresidential or boxes only that may not have a corresponding ZCTA. | | + | \r +| | + | There are significant changes to the 2010 ZCTA delineation from that used in 2000. Coverage was extended to include the Island Areas for 2010 so that the United States, Puerto Rico, and the Island Areas have ZCTAs. Unlike 2000, when areas that could not be assigned to a ZCTA were given a generic code ending in \u201cXX\u201d (land area) or \u201cHH\u201d (water area), for 2010 there is no universal coverage by ZCTAs, and only legitimate five-digit areas are defined. The 2010 ZCTAs will better represent the actual Zip Code service areas because the Census Bureau initiated a process before creation of 2010 blocks to add block boundaries that split polygons with large numbers of addresses using different Zip Codes.\r +| | + | \r +| | + | Data users should not use ZCTAs to identify the official USPS ZIP Code for mail delivery. The USPS makes periodic changes to ZIP Codes to support more efficient mail delivery. The ZCTAs process used primarily residential addresses and was biased towards Zip Codes used for city-style mail delivery, thus there may be Zip Codes that are primarily nonresidential or boxes only that may not have a corresponding ZCTA. | | "us.census.tiger".county | The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and census areas; the latter of which are delineated cooperatively for statistical purposes by the state of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. All of the counties in Connecticut and Rhode Island and nine counties in Massachusetts were dissolved as functioning governmental entities; however, the Census Bureau continues to present data for these historical entities in order to provide comparable geographic units at the county level of the geographic hierarchy for these states and represents them as nonfunctioning legal entities in data products. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: municipios in Puerto Rico, districts and islands in American Samoa, municipalities in the Commonwealth of the Northern Mariana Islands, and islands in the U.S. Virgin Islands. Each county or statistically equivalent entity is assigned a three-character numeric Federal Information Processing Series (FIPS) code based on alphabetical sequence that is unique within state and an eight-digit National Standard feature identifier. | 2013 | obs_b0ef6dd68d5faddbf231fd7f02916b3d00ec43c4 "us.census.tiger".state | States and Equivalent Entities are the primary governmental divisions of the United States. In addition to the 50 states, the Census Bureau treats the District of Columbia, Puerto Rico, American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands as the statistical equivalents of states for the purpose of data presentation. | 2013 | obs_a20f5260b618a2fe2eb95fc1e23febe0db7db096 "us.census.tiger".county | The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and census areas; the latter of which are delineated cooperatively for statistical purposes by the state of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. All of the counties in Connecticut and Rhode Island and nine counties in Massachusetts were dissolved as functioning governmental entities; however, the Census Bureau continues to present data for these historical entities in order to provide comparable geographic units at the county level of the geographic hierarchy for these states and represents them as nonfunctioning legal entities in data products. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: municipios in Puerto Rico, districts and islands in American Samoa, municipalities in the Commonwealth of the Northern Mariana Islands, and islands in the U.S. Virgin Islands. Each county or statistically equivalent entity is assigned a three-character numeric Federal Information Processing Series (FIPS) code based on alphabetical sequence that is unique within state and an eight-digit National Standard feature identifier. | 2013 | obs_23da37d4e66e9de2f525572967f8618bde99a8c0 "us.census.tiger".census_tract | Census tracts are identified by an up to four-digit integer number and may have an optional two-digit suffix; for example 1457.02 or 23. The census tract codes consist of six digits with an implied decimal between the fourth and fifth digit corresponding to the basic census tract number but with leading zeroes and trailing zeroes for census tracts without a suffix. The tract number examples above would have codes of 145702 and 002300, respectively.\r +| 2013 | obs_d125aeef87aaa23287a40b454519ece22ee25acf - | \r +| | - | Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.\r +| | - | \r +| | - | The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.\r +| | - | \r +| | - | The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d). | | + | \r +| | + | Some ranges of census tract numbers in the 2010 Census are used to identify distinctive types of census tracts. The code range in the 9400s is used for those census tracts with a majority of population, housing, or land area associated with an American Indian area and matches the numbering used in Census 2000. The code range in the 9800s is new for 2010 and is used to specifically identify special land-use census tracts; that is, census tracts defined to encompass a large area with little or no residential population with special characteristics, such as large parks or employment areas. The range of census tracts in the 9900s represents census tracts delineated specifically to cover large bodies of water. This is different from Census 2000 when water-only census tracts were assigned codes of all zeroes (000000); 000000 is no longer used as a census tract code for the 2010 Census.\r +| | + | \r +| | + | The Census Bureau uses suffixes to help identify census tract changes for comparison purposes. Census tract suffixes may range from .01 to .98. As part of local review of existing census tracts before each census, some census tracts may have grown enough in population size to qualify as more than one census tract. When a census tract is split, the split parts usually retain the basic number but receive different suffixes. For example, if census tract 14 is split, the new tract numbers would be 14.01 and 14.02. In a few counties, local participants request major changes to, and renumbering of, the census tracts; however, this is generally discouraged. Changes to individual census tract boundaries usually do not result in census tract numbering changes.\r +| | + | \r +| | + | The Census Bureau introduced the concept of tribal census tracts for the first time for Census 2000. Tribal census tracts for that census consisted of the standard county-based census tracts tabulated within American Indian areas, thus allowing for the tracts to ignore state and county boundaries for tabulation. The Census Bureau assigned the 9400 range of numbers to identify specific tribal census tracts; however, not all tribal census tracts used this numbering scheme. For the 2010 Census, tribal census tracts no longer are tied to or numbered in the same way as the county-based census tracts (see \u201cTribal Census Tract\u201d). | | "us.census.tiger".block_group | Block groups (BGs) are statistical divisions of census tracts, are generally defined to contain between 600 and 3,000 people, and are used to present data and control block numbering. A block group consists of clusters of blocks within the same census tract that have the same first digit of their four-digit census block number. For example, blocks 3001, 3002, 3003, ..., 3999 in census tract 1210.02 belong to BG 3 in that census tract. Most BGs were delineated by local participants in the Census Bureau\u2019s Participant Statistical Areas Program. The Census Bureau delineated BGs only where a local or tribal government declined to participate, and a regional organization or State Data Center was not available to participate.\r +| 2013 | obs_d610cb3225f282693b8d4dcd98d2c2e2078354c6 - | \r +| | - | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | + | \r +| | + | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | (10 rows) From 75f4e6d412965ccb3f3993e6583f2f2383e063e1 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 20 Apr 2016 17:11:12 -0400 Subject: [PATCH 15/15] add trailing whitespace --- src/pg/test/expected/42_observatory_exploration_test.out | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pg/test/expected/42_observatory_exploration_test.out b/src/pg/test/expected/42_observatory_exploration_test.out index 35065fe..9db640a 100644 --- a/src/pg/test/expected/42_observatory_exploration_test.out +++ b/src/pg/test/expected/42_observatory_exploration_test.out @@ -28,7 +28,7 @@ Done. ("""us.census.acs"".B01001001_quantile","The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates.","Quantile:Total Population",quantile,us.census.acs) (3 rows) - boundary_id | description | time_span | tablename + boundary_id | description | time_span | tablename --------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------------------------------- "us.census.tiger".block_group | Block groups (BGs) are statistical divisions of census tracts, are generally defined to contain between 600 and 3,000 people, and are used to present data and control block numbering. A block group consists of clusters of blocks within the same census tract that have the same first digit of their four-digit census block number. For example, blocks 3001, 3002, 3003, ..., 3999 in census tract 1210.02 belong to BG 3 in that census tract. Most BGs were delineated by local participants in the Census Bureau\u2019s Participant Statistical Areas Program. The Census Bureau delineated BGs only where a local or tribal government declined to participate, and a regional organization or State Data Center was not available to participate.\r +| 2013 | obs_85328201013baa14e8e8a4a57a01e6f6fbc5f9b1 | \r +| | @@ -64,4 +64,3 @@ Done. | A BG usually covers a contiguous area. Each census tract contains at least one BG, and BGs are uniquely numbered within the census tract. Within the standard census geographic hierarchy, BGs never cross state, county, or census tract boundaries but may cross the boundaries of any other geographic entity. Tribal census tracts and tribal BGs are separate and unique geographic areas defined within federally recognized American Indian reservations and can cross state and county boundaries (see \u201cTribal Census Tract\u201d and \u201cTribal Block Group\u201d). The tribal census tracts and tribal block groups may be completely different from the census tracts and block groups defined by state and county. | | (10 rows) -