From dcab63f3b3e191ae47d44379a0fb89ffe8cc549f Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Tue, 27 Feb 2018 15:36:27 -0500 Subject: [PATCH] update deprecated private funcs to return all but spatial lag --- src/pg/sql/10_moran.sql | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pg/sql/10_moran.sql b/src/pg/sql/10_moran.sql index 1428bc0..45e1e1e 100644 --- a/src/pg/sql/10_moran.sql +++ b/src/pg/sql/10_moran.sql @@ -36,8 +36,10 @@ RETURNS TABLE ( AS $$ from crankshaft.clustering import Moran moran = Moran() - return moran.local_stat(subquery, column_name, w_type, - num_ngbrs, permutations, geom_col, id_col) + result = moran.local_stat(subquery, column_name, w_type, + num_ngbrs, permutations, geom_col, id_col) + # remove spatial lag + return [r[:-1] for r in result] $$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- Moran's I Local (internal function) @@ -210,7 +212,9 @@ AS $$ from crankshaft.clustering import Moran moran = Moran() # TODO: use named parameters or a dictionary - return moran.local_rate_stat(subquery, numerator, denominator, w_type, num_ngbrs, permutations, geom_col, id_col) + result = moran.local_rate_stat(subquery, numerator, denominator, w_type, num_ngbrs, permutations, geom_col, id_col) + # remove spatial lag + return [r[:-1] for r in result] $$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE; -- Moran's I Local Rate (public-facing function) - DEPRECATED