diff --git a/client/renderer/interface.yaml b/client/renderer/interface.yaml index 80f1642..c07cffc 100644 --- a/client/renderer/interface.yaml +++ b/client/renderer/interface.yaml @@ -250,7 +250,7 @@ params: - { name: geom, type: Geometry } - { name: measure_id, type: text } - - { name: normalize, type: text, default: "'area'"} + - { name: normalize, type: text, default: 'NULL'} - { name: boundary_id, type: text, default: 'NULL' } - { name: time_span, type: text, default: 'NULL'} @@ -275,7 +275,7 @@ params: - { name: geom, type: Geometry } - { name: name, type: text } - - { name: normalize, type: text, default: "'area'"} + - { name: normalize, type: text, default: 'NULL'} - { name: boundary_id, type: text, default: 'NULL' } - { name: time_span, type: text, default: 'NULL'} @@ -291,7 +291,7 @@ return_type: numeric params: - { name: geom, type: Geometry } - - { name: normalize, type: text, default: "'area'"} + - { name: normalize, type: text, default: 'NULL'} - { name: boundary_id, type: text, default: 'NULL' } - { name: time_span, type: text, default: 'NULL'} diff --git a/client/test/expected/90_data_observatory_test.out b/client/test/expected/90_data_observatory_test.out index 75af3a9..013e041 100644 --- a/client/test/expected/90_data_observatory_test.out +++ b/client/test/expected/90_data_observatory_test.out @@ -92,7 +92,7 @@ BEGIN RETURN QUERY SELECT '0101000020E610000037CB75821A7C52C0BA8784EFFD594440'::geometry as the_geom, '36047048900'::text as geom_refs; END; $$ LANGUAGE 'plpgsql'; -CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getmeasure (username text, orgname text, geom Geometry, measure_id text, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) +CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getmeasure (username text, orgname text, geom Geometry, measure_id text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) RETURNS numeric AS $$ DECLARE ret numeric; @@ -122,7 +122,7 @@ BEGIN RETURN ret; END; $$ LANGUAGE 'plpgsql'; -CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getuscensusmeasure (username text, orgname text, geom Geometry, name text, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) +CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getuscensusmeasure (username text, orgname text, geom Geometry, name text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) RETURNS numeric AS $$ DECLARE ret numeric; @@ -142,7 +142,7 @@ BEGIN RETURN ret; END; $$ LANGUAGE 'plpgsql'; -CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getpopulation (username text, orgname text, geom Geometry, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) +CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getpopulation (username text, orgname text, geom Geometry, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) RETURNS numeric AS $$ DECLARE ret numeric; @@ -268,7 +268,7 @@ CONTEXT: PL/pgSQL function obs_getpointsbypointandradius(geometry,numeric,text, (1 row) SELECT obs_getmeasure(ST_SetSRID(ST_Point(-73.936669 , 40.704512), 4326), 'us.census.acs.B01001001'::text); -NOTICE: cdb_dataservices_client._obs_getmeasure(7): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.obs_getmeasure invoked with params (test_user, , 0101000020E6100000548B8862F27B52C0DDD1FF722D5A4440, us.census.acs.B01001001, area, , ) +NOTICE: cdb_dataservices_client._obs_getmeasure(7): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.obs_getmeasure invoked with params (test_user, , 0101000020E6100000548B8862F27B52C0DDD1FF722D5A4440, us.census.acs.B01001001, , , ) CONTEXT: SQL statement "SELECT cdb_dataservices_client._obs_getmeasure(username, orgname, geom, measure_id, normalize, boundary_id, time_span)" PL/pgSQL function obs_getmeasure(geometry,text,text,text,text) line 16 at SQL statement obs_getmeasure @@ -295,7 +295,7 @@ PL/pgSQL function obs_getcategory(geometry,text,text,text) line 16 at SQL statem (1 row) SELECT obs_getuscensusmeasure(ST_SetSRID(ST_Point(-73.936669 , 40.704512), 4326), 'male population'::text); -NOTICE: cdb_dataservices_client._obs_getuscensusmeasure(7): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.obs_getuscensusmeasure invoked with params (test_user, , 0101000020E6100000548B8862F27B52C0DDD1FF722D5A4440, male population, area, , ) +NOTICE: cdb_dataservices_client._obs_getuscensusmeasure(7): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.obs_getuscensusmeasure invoked with params (test_user, , 0101000020E6100000548B8862F27B52C0DDD1FF722D5A4440, male population, , , ) CONTEXT: SQL statement "SELECT cdb_dataservices_client._obs_getuscensusmeasure(username, orgname, geom, name, normalize, boundary_id, time_span)" PL/pgSQL function obs_getuscensusmeasure(geometry,text,text,text,text) line 16 at SQL statement obs_getuscensusmeasure @@ -313,7 +313,7 @@ PL/pgSQL function obs_getuscensuscategory(geometry,text,text,text) line 16 at SQ (1 row) SELECT obs_getpopulation(ST_SetSRID(ST_Point(-73.936669 , 40.704512), 4326)); -NOTICE: cdb_dataservices_client._obs_getpopulation(6): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.obs_getpopulation invoked with params (test_user, , 0101000020E6100000548B8862F27B52C0DDD1FF722D5A4440, area, , ) +NOTICE: cdb_dataservices_client._obs_getpopulation(6): [contrib_regression] REMOTE NOTICE: cdb_dataservices_server.obs_getpopulation invoked with params (test_user, , 0101000020E6100000548B8862F27B52C0DDD1FF722D5A4440, , , ) CONTEXT: SQL statement "SELECT cdb_dataservices_client._obs_getpopulation(username, orgname, geom, normalize, boundary_id, time_span)" PL/pgSQL function obs_getpopulation(geometry,text,text,text) line 16 at SQL statement obs_getpopulation diff --git a/client/test/sql/90_data_observatory_test.sql b/client/test/sql/90_data_observatory_test.sql index 5eff910..92fb8bd 100644 --- a/client/test/sql/90_data_observatory_test.sql +++ b/client/test/sql/90_data_observatory_test.sql @@ -104,7 +104,7 @@ BEGIN END; $$ LANGUAGE 'plpgsql'; -CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getmeasure (username text, orgname text, geom Geometry, measure_id text, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) +CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getmeasure (username text, orgname text, geom Geometry, measure_id text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) RETURNS numeric AS $$ DECLARE ret numeric; @@ -137,7 +137,7 @@ BEGIN END; $$ LANGUAGE 'plpgsql'; -CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getuscensusmeasure (username text, orgname text, geom Geometry, name text, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) +CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getuscensusmeasure (username text, orgname text, geom Geometry, name text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) RETURNS numeric AS $$ DECLARE ret numeric; @@ -159,7 +159,7 @@ BEGIN END; $$ LANGUAGE 'plpgsql'; -CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getpopulation (username text, orgname text, geom Geometry, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) +CREATE OR REPLACE FUNCTION cdb_dataservices_server.obs_getpopulation (username text, orgname text, geom Geometry, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL) RETURNS numeric AS $$ DECLARE ret numeric; diff --git a/server/extension/sql/110_data_observatory_augmentation.sql b/server/extension/sql/110_data_observatory_augmentation.sql index dc96c93..d75bcb1 100644 --- a/server/extension/sql/110_data_observatory_augmentation.sql +++ b/server/extension/sql/110_data_observatory_augmentation.sql @@ -231,7 +231,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetMeasure( orgname TEXT, geom geometry(Geometry, 4326), measure_id TEXT, - normalize TEXT DEFAULT 'area', + normalize TEXT DEFAULT NULL, boundary_id TEXT DEFAULT NULL, time_span TEXT DEFAULT NULL) RETURNS NUMERIC AS $$ @@ -244,7 +244,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetMeasure( orgname TEXT, geom geometry(Geometry, 4326), measure_id TEXT, - normalize TEXT DEFAULT 'area', + normalize TEXT DEFAULT NULL, boundary_id TEXT DEFAULT NULL, time_span TEXT DEFAULT NULL) RETURNS NUMERIC AS $$ @@ -339,7 +339,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetUSCensusMeasure( orgname TEXT, geom geometry(Geometry, 4326), name TEXT, - normalize TEXT DEFAULT 'area', + normalize TEXT DEFAULT NULL, boundary_id TEXT DEFAULT NULL, time_span TEXT DEFAULT NULL) RETURNS NUMERIC AS $$ @@ -352,7 +352,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetUSCensusMeasure( orgname TEXT, geom geometry(Geometry, 4326), name TEXT, - normalize TEXT DEFAULT 'area', + normalize TEXT DEFAULT NULL, boundary_id TEXT DEFAULT NULL, time_span TEXT DEFAULT NULL) RETURNS NUMERIC AS $$ @@ -446,7 +446,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetPopulation( username TEXT, orgname TEXT, geom geometry(Geometry, 4326), - normalize TEXT DEFAULT 'area', + normalize TEXT DEFAULT NULL, boundary_id TEXT DEFAULT NULL, time_span TEXT DEFAULT NULL) RETURNS NUMERIC AS $$ @@ -458,7 +458,7 @@ CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetPopulation( username TEXT, orgname TEXT, geom geometry(Geometry, 4326), - normalize TEXT DEFAULT 'area', + normalize TEXT DEFAULT NULL, boundary_id TEXT DEFAULT NULL, time_span TEXT DEFAULT NULL) RETURNS NUMERIC AS $$