fix module call
This commit is contained in:
@@ -15,7 +15,7 @@ import crankshaft.pysal_utils as pu
|
||||
# High level interface ---------------------------------------
|
||||
|
||||
def getis_ord(subquery, attr,
|
||||
w_type, num_ngbrs, permutations, geom_col, id_col):
|
||||
w_type, num_ngbrs, geom_col, id_col):
|
||||
"""
|
||||
Getis-Ord's G
|
||||
Implementation building neighbors with a PostGIS database and Getis-Ord's G
|
||||
@@ -39,13 +39,13 @@ def getis_ord(subquery, attr,
|
||||
# if there are no neighbors, exit
|
||||
if len(result) == 0:
|
||||
return pu.empty_zipped_array(3)
|
||||
except plpy.SPIError, e:
|
||||
plpy.error('Query failed: %s' % e)
|
||||
except plpy.SPIError, err:
|
||||
plpy.error('Query failed: %s' % err)
|
||||
|
||||
attr_vals = pu.get_attributes(result)
|
||||
weight = pu.get_weight(result, w_type, num_ngbrs)
|
||||
|
||||
# calculate LISA values
|
||||
getis = ps.esda.getisord(attr_vals, weight, star=True)
|
||||
getis = ps.esda.getisord.G_Local(attr_vals, weight, star=True)
|
||||
|
||||
return zip(getis.z_sim, getis.p_sim, weight.id_order)
|
||||
|
||||
Reference in New Issue
Block a user