|
|
|
@@ -89,7 +89,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -117,7 +116,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -145,7 +143,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -173,7 +170,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -201,7 +197,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -229,7 +224,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -257,7 +251,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -285,7 +278,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -313,7 +305,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -341,7 +332,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -369,7 +359,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -397,7 +386,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -425,7 +413,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -453,7 +440,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -481,7 +467,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -509,7 +494,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -537,7 +521,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -565,7 +548,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -593,14 +575,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_get_demographic_snapshot (geom geometry(Geometry, 4326), time_span text DEFAULT '2009 - 2013'::text, geometry_level text DEFAULT '"us.census.tiger".block_group'::text)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_get_demographic_snapshot (geom geometry(Geometry, 4326), time_span text DEFAULT '2009 - 2013'::text, geometry_level text DEFAULT NULL)
|
|
|
|
|
RETURNS json AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
ret json;
|
|
|
|
@@ -621,14 +602,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_get_segment_snapshot (geom geometry(Geometry, 4326), geometry_level text DEFAULT '"us.census.tiger".census_tract'::text)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_get_segment_snapshot (geom geometry(Geometry, 4326), geometry_level text DEFAULT NULL)
|
|
|
|
|
RETURNS json AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
ret json;
|
|
|
|
@@ -649,7 +629,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -677,7 +656,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -705,7 +683,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -733,7 +710,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -761,7 +737,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -789,14 +764,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getboundariesbygeometry (geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getboundariesbygeometry (geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
|
|
|
|
@@ -817,14 +791,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getboundariesbypointandradius (geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getboundariesbypointandradius (geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
|
|
|
|
@@ -845,14 +818,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getpointsbygeometry (geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getpointsbygeometry (geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
|
|
|
|
@@ -873,14 +845,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getpointsbypointandradius (geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getpointsbypointandradius (geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
|
|
|
|
@@ -901,14 +872,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getmeasure (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_client.obs_getmeasure (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;
|
|
|
|
@@ -929,7 +899,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -957,7 +926,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -985,14 +953,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getuscensusmeasure (geom Geometry, name text, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getuscensusmeasure (geom Geometry, name text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
RETURNS numeric AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
ret numeric;
|
|
|
|
@@ -1013,7 +980,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -1041,14 +1007,13 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getpopulation (geom Geometry, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_getpopulation (geom Geometry, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
RETURNS numeric AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
ret numeric;
|
|
|
|
@@ -1069,7 +1034,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -1097,7 +1061,6 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
@@ -1125,7 +1088,33 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
--
|
|
|
|
|
-- Public dataservices API function
|
|
|
|
|
--
|
|
|
|
|
-- These are the only ones with permissions to publicuser role
|
|
|
|
|
-- and should also be the only ones with SECURITY DEFINER
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.obs_dumpversion ()
|
|
|
|
|
RETURNS text AS $$
|
|
|
|
|
DECLARE
|
|
|
|
|
ret text;
|
|
|
|
|
username text;
|
|
|
|
|
orgname text;
|
|
|
|
|
BEGIN
|
|
|
|
|
IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN
|
|
|
|
|
RAISE EXCEPTION 'The api_key must be provided';
|
|
|
|
|
END IF;
|
|
|
|
|
SELECT u, o INTO username, orgname FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text);
|
|
|
|
|
-- JSON value stored "" is taken as literal
|
|
|
|
|
IF username IS NULL OR username = '' OR username = '""' THEN
|
|
|
|
|
RAISE EXCEPTION 'Username is a mandatory argument, check it out';
|
|
|
|
|
END IF;
|
|
|
|
|
|
|
|
|
|
SELECT * FROM cdb_dataservices_client._obs_dumpversion(username, orgname) INTO ret;
|
|
|
|
|
RETURN ret;
|
|
|
|
|
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;
|
|
|
|
|
CREATE TYPE cdb_dataservices_client.ds_fdw_metadata as (schemaname text, tabname text, servername text);
|
|
|
|
|
CREATE TYPE cdb_dataservices_client.ds_return_metadata as (colnames text[], coltypes text[]);
|
|
|
|
|
|
|
|
|
@@ -1389,7 +1378,9 @@ RETURNS boolean AS $$
|
|
|
|
|
CONNECT _server_conn_str();
|
|
|
|
|
TARGET cdb_dataservices_server._OBS_DisconnectUserTable;
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_admin0_polygon (username text, organization_name text, country_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1398,6 +1389,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_admin1_polygon (username text, organization_name text, admin1_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1406,6 +1398,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_admin1_polygon (username text, organization_name text, admin1_name text, country_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1414,6 +1407,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_namedplace_point (username text, organization_name text, city_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1422,6 +1416,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_namedplace_point (username text, organization_name text, city_name text, country_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1430,6 +1425,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_namedplace_point (username text, organization_name text, city_name text, admin1_name text, country_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1438,6 +1434,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_postalcode_polygon (username text, organization_name text, postal_code text, country_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1446,6 +1443,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_postalcode_point (username text, organization_name text, postal_code text, country_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1454,6 +1452,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_ipaddress_point (username text, organization_name text, ip_address text)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1462,6 +1461,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_geocode_street_point (username text, organization_name text, searchtext text, city text DEFAULT NULL, state_province text DEFAULT NULL, country text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1470,6 +1470,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point (username text, organization_name text, searchtext text, city text DEFAULT NULL, state_province text DEFAULT NULL, country text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1478,6 +1479,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_google_geocode_street_point (username text, organization_name text, searchtext text, city text DEFAULT NULL, state_province text DEFAULT NULL, country text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1486,6 +1488,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_mapzen_geocode_street_point (username text, organization_name text, searchtext text, city text DEFAULT NULL, state_province text DEFAULT NULL, country text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1494,6 +1497,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_isodistance (username text, organization_name text, source geometry(Geometry, 4326), mode text, range integer[], options text[] DEFAULT ARRAY[]::text[])
|
|
|
|
|
|
|
|
|
|
RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1502,6 +1506,7 @@ RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_isochrone (username text, organization_name text, source geometry(Geometry, 4326), mode text, range integer[], options text[] DEFAULT ARRAY[]::text[])
|
|
|
|
|
|
|
|
|
|
RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1510,6 +1515,7 @@ RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_mapzen_isochrone (username text, organization_name text, source geometry(Geometry, 4326), mode text, range integer[], options text[] DEFAULT ARRAY[]::text[])
|
|
|
|
|
|
|
|
|
|
RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1518,6 +1524,7 @@ RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_mapzen_isodistance (username text, organization_name text, source geometry(Geometry, 4326), mode text, range integer[], options text[] DEFAULT ARRAY[]::text[])
|
|
|
|
|
|
|
|
|
|
RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1526,6 +1533,7 @@ RETURNS SETOF cdb_dataservices_client.isoline AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_route_point_to_point (username text, organization_name text, origin geometry(Point, 4326), destination geometry(Point, 4326), mode text, options text[] DEFAULT ARRAY[]::text[], units text DEFAULT 'kilometers')
|
|
|
|
|
|
|
|
|
|
RETURNS cdb_dataservices_client.simple_route AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1534,6 +1542,7 @@ RETURNS cdb_dataservices_client.simple_route AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_route_with_waypoints (username text, organization_name text, waypoints geometry(Point, 4326)[], mode text, options text[] DEFAULT ARRAY[]::text[], units text DEFAULT 'kilometers')
|
|
|
|
|
|
|
|
|
|
RETURNS cdb_dataservices_client.simple_route AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1541,7 +1550,8 @@ RETURNS cdb_dataservices_client.simple_route AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_get_demographic_snapshot (username text, organization_name text, geom geometry(Geometry, 4326), time_span text DEFAULT '2009 - 2013'::text, geometry_level text DEFAULT '"us.census.tiger".block_group'::text)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_get_demographic_snapshot (username text, organization_name text, geom geometry(Geometry, 4326), time_span text DEFAULT '2009 - 2013'::text, geometry_level text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS json AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1549,7 +1559,8 @@ RETURNS json AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_get_segment_snapshot (username text, organization_name text, geom geometry(Geometry, 4326), geometry_level text DEFAULT '"us.census.tiger".census_tract'::text)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_get_segment_snapshot (username text, organization_name text, geom geometry(Geometry, 4326), geometry_level text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS json AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1558,6 +1569,7 @@ RETURNS json AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getdemographicsnapshot (username text, organization_name text, geom geometry(Geometry, 4326), time_span text DEFAULT NULL, geometry_level text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS SETOF JSON AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1566,6 +1578,7 @@ RETURNS SETOF JSON AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getsegmentsnapshot (username text, organization_name text, geom geometry(Geometry, 4326), geometry_level text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS SETOF JSON AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1574,6 +1587,7 @@ RETURNS SETOF JSON AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundary (username text, organization_name text, geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1582,6 +1596,7 @@ RETURNS Geometry AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundaryid (username text, organization_name text, geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS text AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1590,6 +1605,7 @@ RETURNS text AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundarybyid (username text, organization_name text, geometry_id text, boundary_id text, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS Geometry AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1597,7 +1613,8 @@ RETURNS Geometry AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundariesbygeometry (username text, organization_name text, geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundariesbygeometry (username text, organization_name text, geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1605,7 +1622,8 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundariesbypointandradius (username text, organization_name text, geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getboundariesbypointandradius (username text, organization_name text, geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1613,7 +1631,8 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getpointsbygeometry (username text, organization_name text, geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getpointsbygeometry (username text, organization_name text, geom geometry(Geometry, 4326), boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1621,7 +1640,8 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getpointsbypointandradius (username text, organization_name text, geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT 'intersects')
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getpointsbypointandradius (username text, organization_name text, geom geometry(Geometry, 4326), radius numeric, boundary_id text, time_span text DEFAULT NULL, overlap_type text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1629,7 +1649,8 @@ RETURNS TABLE(the_geom geometry, geom_refs text) AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getmeasure (username text, organization_name 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_client._obs_getmeasure (username text, organization_name text, geom Geometry, measure_id text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS numeric AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1638,6 +1659,7 @@ RETURNS numeric AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getmeasurebyid (username text, organization_name text, geom_ref text, measure_id text, boundary_id text, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS numeric AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1646,6 +1668,7 @@ RETURNS numeric AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getcategory (username text, organization_name text, geom Geometry, category_id text, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS text AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1653,7 +1676,8 @@ RETURNS text AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getuscensusmeasure (username text, organization_name 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_client._obs_getuscensusmeasure (username text, organization_name text, geom Geometry, name text, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS numeric AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1662,6 +1686,7 @@ RETURNS numeric AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getuscensuscategory (username text, organization_name text, geom Geometry, name text, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS text AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1669,7 +1694,8 @@ RETURNS text AS $$
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getpopulation (username text, organization_name text, geom Geometry, normalize text DEFAULT 'area', boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getpopulation (username text, organization_name text, geom Geometry, normalize text DEFAULT NULL, boundary_id text DEFAULT NULL, time_span text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS numeric AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1678,6 +1704,7 @@ RETURNS numeric AS $$
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_search (username text, organization_name text, search_term text, relevant_boundary text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS TABLE(id text, description text, name text, aggregate text, source text) AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1686,6 +1713,7 @@ RETURNS TABLE(id text, description text, name text, aggregate text, source text)
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_getavailableboundaries (username text, organization_name text, geom Geometry, timespan text DEFAULT NULL)
|
|
|
|
|
|
|
|
|
|
RETURNS TABLE(boundary_id text, description text, time_span text, tablename text) AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
@@ -1693,6 +1721,14 @@ RETURNS TABLE(boundary_id text, description text, time_span text, tablename text
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._obs_dumpversion (username text, organization_name text)
|
|
|
|
|
|
|
|
|
|
RETURNS text AS $$
|
|
|
|
|
CONNECT cdb_dataservices_client._server_conn_str();
|
|
|
|
|
|
|
|
|
|
SELECT * FROM cdb_dataservices_server.obs_dumpversion (username, organization_name);
|
|
|
|
|
|
|
|
|
|
$$ LANGUAGE plproxy;
|
|
|
|
|
-- Make sure by default there are no permissions for publicuser
|
|
|
|
|
-- NOTE: this happens at extension creation time, as part of an implicit transaction.
|
|
|
|
|
REVOKE ALL PRIVILEGES ON SCHEMA cdb_dataservices_client FROM PUBLIC, publicuser CASCADE;
|
|
|
|
@@ -1739,5 +1775,6 @@ GRANT EXECUTE ON FUNCTION cdb_dataservices_client.obs_getuscensuscategory(geom G
|
|
|
|
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.obs_getpopulation(geom Geometry, normalize text, boundary_id text, time_span text) TO publicuser;
|
|
|
|
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.obs_search(search_term text, relevant_boundary text) TO publicuser;
|
|
|
|
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.obs_getavailableboundaries(geom Geometry, timespan text) TO publicuser;
|
|
|
|
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.obs_dumpversion() TO publicuser;
|
|
|
|
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._obs_augmenttable(table_name text, function_name text, params json) TO publicuser;
|
|
|
|
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._obs_gettable(table_name text, output_table_name text, function_name text, params json) TO publicuser;
|