fixing bugs and adding contours to the payload

This commit is contained in:
Stuart Lynn 2016-05-18 17:32:14 -04:00
parent e59befae82
commit 874b5318ff
2 changed files with 17 additions and 14 deletions

View File

@ -1,17 +1,3 @@
CREATE OR REPLACE FUNCTION
CDB_Contours (
subquery TEXT,
grid_size NUMERIC DEFAULT 100,
bandwidth NUMERIC DEFAULT 0.0001,
levels NUMERIC[] DEFAULT null
)
RETURNS table (level Numeric, geom text )
AS $$
RETURN QUERY
select level, ST_GeomFromText(geom_text, 4326) as geom from _CDB_Contours(subquery,grid_size,bandwidth,levels);
RETURN;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION
_CDB_Contours (
@ -26,3 +12,19 @@ AS $$
# TODO: use named parameters or a dictionary
return cdb_generate_contours(subquery, grid_size, bandwidth, levels)
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION
CDB_Contours (
subquery TEXT,
grid_size NUMERIC DEFAULT 100,
bandwidth NUMERIC DEFAULT 0.0001,
levels NUMERIC[] DEFAULT null
)
RETURNS table (level Numeric, geom text )
AS $$
BEGIN
RETURN QUERY
select l as level, ST_GeomFromText(geom_text, 4326) as geom from _CDB_Contours(subquery,grid_size,bandwidth,levels);
END;
$$ LANGUAGE plpgsql;

View File

@ -1,2 +1,3 @@
import random_seeds
import clustering
import contours