remove columns from demographicsnapshot that do not appear at BG level

This commit is contained in:
John Krauss 2016-04-13 10:35:53 -04:00
parent 466554a139
commit e89582aed5

View File

@ -21,7 +21,6 @@
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Creates a table of demographic snapshot -- Creates a table of demographic snapshot
-- TODO: Remove since it does address geocoding?
CREATE OR REPLACE FUNCTION OBS_GetDemographicSnapshot(geom geometry) CREATE OR REPLACE FUNCTION OBS_GetDemographicSnapshot(geom geometry)
RETURNS TABLE( RETURNS TABLE(
@ -37,24 +36,24 @@ RETURNS TABLE(
other_race_pop NUMERIC, other_race_pop NUMERIC,
two_or_more_races_pop NUMERIC, two_or_more_races_pop NUMERIC,
not_hispanic_pop NUMERIC, not_hispanic_pop NUMERIC,
not_us_citizen_pop NUMERIC, --not_us_citizen_pop NUMERIC,
workers_16_and_over NUMERIC, --workers_16_and_over NUMERIC,
commuters_by_car_truck_van NUMERIC, --commuters_by_car_truck_van NUMERIC,
commuters_drove_alone NUMERIC, --commuters_drove_alone NUMERIC,
commuters_by_carpool NUMERIC, --commuters_by_carpool NUMERIC,
commuters_by_public_transportation NUMERIC, --commuters_by_public_transportation NUMERIC,
commuters_by_bus NUMERIC, --commuters_by_bus NUMERIC,
commuters_by_subway_or_elevated NUMERIC, --commuters_by_subway_or_elevated NUMERIC,
walked_to_work NUMERIC, --walked_to_work NUMERIC,
worked_at_home NUMERIC, --worked_at_home NUMERIC,
children NUMERIC, --children NUMERIC, -- TODO we should be able to get this at BG
households NUMERIC, households NUMERIC,
population_3_years_over NUMERIC, --population_3_years_over NUMERIC,
in_school NUMERIC, --in_school NUMERIC,
in_grades_1_to_4 NUMERIC, --in_grades_1_to_4 NUMERIC,
in_grades_5_to_8 NUMERIC, --in_grades_5_to_8 NUMERIC,
in_grades_9_to_12 NUMERIC, --in_grades_9_to_12 NUMERIC,
in_undergrad_college NUMERIC, --in_undergrad_college NUMERIC,
pop_25_years_over NUMERIC, pop_25_years_over NUMERIC,
high_school_diploma NUMERIC, high_school_diploma NUMERIC,
less_one_year_college NUMERIC, less_one_year_college NUMERIC,
@ -63,10 +62,10 @@ RETURNS TABLE(
bachelors_degree NUMERIC, bachelors_degree NUMERIC,
masters_degree NUMERIC, masters_degree NUMERIC,
pop_5_years_over NUMERIC, pop_5_years_over NUMERIC,
speak_only_english_at_home NUMERIC, --speak_only_english_at_home NUMERIC,
speak_spanish_at_home NUMERIC, --speak_spanish_at_home NUMERIC,
pop_determined_poverty_status NUMERIC, --pop_determined_poverty_status NUMERIC,
poverty NUMERIC, --poverty NUMERIC,
median_income NUMERIC, median_income NUMERIC,
gini_index NUMERIC, gini_index NUMERIC,
income_per_capita NUMERIC, income_per_capita NUMERIC,
@ -79,12 +78,12 @@ RETURNS TABLE(
owner_occupied_housing_units NUMERIC, owner_occupied_housing_units NUMERIC,
million_dollar_housing_units NUMERIC, million_dollar_housing_units NUMERIC,
mortgaged_housing_units NUMERIC, mortgaged_housing_units NUMERIC,
pop_15_and_over NUMERIC, --pop_15_and_over NUMERIC,
pop_never_married NUMERIC, --pop_never_married NUMERIC,
pop_now_married NUMERIC, --pop_now_married NUMERIC,
pop_separated NUMERIC, --pop_separated NUMERIC,
pop_widowed NUMERIC, --pop_widowed NUMERIC,
pop_divorced NUMERIC, --pop_divorced NUMERIC,
commuters_16_over NUMERIC, commuters_16_over NUMERIC,
commute_less_10_mins NUMERIC, commute_less_10_mins NUMERIC,
commute_10_14_mins NUMERIC, commute_10_14_mins NUMERIC,
@ -130,24 +129,24 @@ BEGIN
'other_race_pop', 'other_race_pop',
'two_or_more_races_pop', 'two_or_more_races_pop',
'not_hispanic_pop', 'not_hispanic_pop',
'not_us_citizen_pop', --'not_us_citizen_pop',
'workers_16_and_over', --'workers_16_and_over',
'commuters_by_car_truck_van', --'commuters_by_car_truck_van',
'commuters_drove_alone', --'commuters_drove_alone',
'commuters_by_carpool', --'commuters_by_carpool',
'commuters_by_public_transportation', --'commuters_by_public_transportation',
'commuters_by_bus', --'commuters_by_bus',
'commuters_by_subway_or_elevated', --'commuters_by_subway_or_elevated',
'walked_to_work', --'walked_to_work',
'worked_at_home', --'worked_at_home',
'children', --'children',
'households', 'households',
'population_3_years_over', --'population_3_years_over',
'in_school', --'in_school',
'in_grades_1_to_4', --'in_grades_1_to_4',
'in_grades_5_to_8', --'in_grades_5_to_8',
'in_grades_9_to_12', --'in_grades_9_to_12',
'in_undergrad_college', --'in_undergrad_college',
'pop_25_years_over', 'pop_25_years_over',
'high_school_diploma', 'high_school_diploma',
'less_one_year_college', 'less_one_year_college',
@ -156,10 +155,10 @@ BEGIN
'bachelors_degree', 'bachelors_degree',
'masters_degree', 'masters_degree',
'pop_5_years_over', 'pop_5_years_over',
'speak_only_english_at_home', --'speak_only_english_at_home',
'speak_spanish_at_home', --'speak_spanish_at_home',
'pop_determined_poverty_status', --'pop_determined_poverty_status',
'poverty', --'poverty',
'median_income', 'median_income',
'gini_index', 'gini_index',
'income_per_capita', 'income_per_capita',
@ -172,12 +171,12 @@ BEGIN
'owner_occupied_housing_units', 'owner_occupied_housing_units',
'million_dollar_housing_units', 'million_dollar_housing_units',
'mortgaged_housing_units', 'mortgaged_housing_units',
'pop_15_and_over', --'pop_15_and_over',
'pop_never_married', --'pop_never_married',
'pop_now_married', --'pop_now_married',
'pop_separated', --'pop_separated',
'pop_widowed', --'pop_widowed',
'pop_divorced', --'pop_divorced',
'commuters_16_over', 'commuters_16_over',
'commute_less_10_mins', 'commute_less_10_mins',
'commute_10_14_mins', 'commute_10_14_mins',