Merge branch 'develop' into add-getmeasurebyid
This commit is contained in:
@@ -65,12 +65,12 @@ SELECT
|
||||
|
||||
SELECT cdb_observatory._OBS_GetRelatedColumn(
|
||||
Array[
|
||||
'es.ine.pop_0_4',
|
||||
'es.ine.t3_1',
|
||||
'us.census.acs.B01003001',
|
||||
'us.census.acs.B01001002'
|
||||
],
|
||||
'denominator'
|
||||
) = '{es.ine.total_pop,NULL,us.census.acs.B01003001}' As _OBS_GetRelatedColumn_test;
|
||||
) = '{es.ine.t1_1,NULL,us.census.acs.B01003001}' As _OBS_GetRelatedColumn_test;
|
||||
|
||||
-- should give back a standardized measure name
|
||||
SELECT cdb_observatory._OBS_StandardizeMeasureName('test 343 %% 2 qqq }}{{}}') = 'test_343_2_qqq' As _OBS_StandardizeMeasureName_test;
|
||||
|
||||
@@ -150,7 +150,7 @@ SELECT abs(OBS_GetMeasure_total_pop_point - 10923.093200390833950) / 10923.09320
|
||||
|
||||
-- Poly-based OBS_GetMeasure, default normalization (none)
|
||||
-- is result within 0.1% of expected
|
||||
SELECT abs(OBS_GetMeasure_total_pop_polygon - 9833.47316573952) / 9833.47316573952 < 0.001 As OBS_GetMeasure_total_pop_polygon_test FROM
|
||||
SELECT abs(OBS_GetMeasure_total_pop_polygon - 12327.3133495107) / 12327.3133495107 < 0.001 As OBS_GetMeasure_total_pop_polygon_test FROM
|
||||
cdb_observatory.OBS_GetMeasure(
|
||||
cdb_observatory._TestArea(),
|
||||
'us.census.acs.B01003001'
|
||||
@@ -164,7 +164,7 @@ SELECT (abs(cdb_observatory.OBS_GetMeasure(
|
||||
-- Poly-based OBS_GetMeasure with denominator normalization
|
||||
SELECT abs(cdb_observatory.OBS_GetMeasure(
|
||||
cdb_observatory._TestArea(),
|
||||
'us.census.acs.B01001002', 'denominator') - 0.50597531462834994530) / 0.49026340444793965457 < 0.001 As OBS_GetMeasure_total_male_poly_denominator;
|
||||
'us.census.acs.B01001002', 'denominator') - 0.49026340444793965457) / 0.49026340444793965457 < 0.001 As OBS_GetMeasure_total_male_poly_denominator;
|
||||
|
||||
-- Point-based OBS_GetCategory
|
||||
SELECT cdb_observatory.OBS_GetCategory(
|
||||
@@ -181,7 +181,7 @@ SELECT (abs(OBS_GetPopulation - 10923.093200390833950) / 10923.093200390833950)
|
||||
) As m(OBS_GetPopulation);
|
||||
|
||||
-- Poly-based OBS_GetPopulation, default normalization (none)
|
||||
SELECT (abs(obs_getpopulation_polygon - 9833.47316573952) / 9833.47316573952) < 0.001 As obs_getpopulation_polygon_test
|
||||
SELECT (abs(obs_getpopulation_polygon - 12327.3133495107) / 12327.3133495107) < 0.001 As obs_getpopulation_polygon_test
|
||||
FROM
|
||||
cdb_observatory.OBS_GetPopulation(
|
||||
cdb_observatory._TestArea()
|
||||
@@ -193,7 +193,7 @@ SELECT (abs(cdb_observatory.obs_getuscensusmeasure(
|
||||
|
||||
-- Poly-based OBS_GetUSCensusMeasure, default normalization (none)
|
||||
SELECT (abs(cdb_observatory.obs_getuscensusmeasure(
|
||||
cdb_observatory._testarea(), 'male population') - 4975.49467892449) / 4975.49467892449) < 0.001 As obs_getuscensusmeasure;
|
||||
cdb_observatory._testarea(), 'male population') - 6043.63061042765) / 6043.63061042765) < 0.001 As obs_getuscensusmeasure;
|
||||
|
||||
-- Point-based OBS_GetUSCensusCategory
|
||||
SELECT cdb_observatory.OBS_GetUSCensusCategory(
|
||||
|
||||
@@ -24,10 +24,13 @@ FROM cdb_observatory._OBS_SearchTables(
|
||||
'1988' -- year before first tiger data was collected
|
||||
) As t(table_name, timespan);
|
||||
|
||||
SELECT *
|
||||
FROM cdb_observatory.OBS_Search('total_pop');
|
||||
SELECT COUNT(*) > 0 AS _OBS_SearchTotalPop
|
||||
FROM cdb_observatory.OBS_Search('total_pop')
|
||||
AS t(id, description, name, aggregate, source);
|
||||
|
||||
SELECT *
|
||||
FROM cdb_observatory.OBS_GetAvailableBoundaries(cdb_observatory._TestPoint());
|
||||
SELECT COUNT(*) > 0 AS _OBS_GetAvailableBoundariesExist
|
||||
FROM cdb_observatory.OBS_GetAvailableBoundaries(
|
||||
cdb_observatory._TestPoint()
|
||||
) AS t(boundary_id, description, time_span, tablename);
|
||||
|
||||
\i test/fixtures/drop_fixtures.sql
|
||||
|
||||
Reference in New Issue
Block a user