reworking CDB_WeightedMean to be an aggregate function

This commit is contained in:
Stuart Lynn
2016-06-10 13:06:49 +00:00
parent cc4579461d
commit 7f3b23f67a
3 changed files with 43 additions and 21 deletions

View File

@@ -3,4 +3,4 @@
SELECT count(DISTINCT cluster_no) as clusters from cdb_crankshaft.cdb_kmeans('select * from ppoints', 2);
SELECT count(*) clusters from cdb_crankshaft.cdb_WeightedMean( 'select *, code::INTEGER as cluster from ppoints' , 'value', 'cluster' );
SELECT count(*) clusters from (select cdb_crankshaft.CDB_WeightedMean(the_geom, value::NUMERIC), code from ppoints group by code) p;