This PR adds new functions which expose the spatial lag for Moran's I local (regular and rate). We need this functionality to create data science dashboards that communicate the moran's i scatter plot (described here). This also starts the process of deprecating the existing Moran's I functions (see #196 for more) in favor of ones with better names:
Note this changes the internal function _CDB_AreasOfInterestLocal (and ...Rate) to ~return the spatial_lag column~ to rely on the _CDB_MoransILocal function instead. The existing public functions CDB_AreasOfInterestLocal and CDB_AreasOfInterestLocalRate are not affected (signatures remain the same), but their internals were refactored to accommodate the addition of the CDB_MoransILocal and CDB_MoransILocalRate functions.
ToDo
[x] awaiting info about whether to return standardized value (and standardized spatial lag) -- decision to included both
Other ToDos
[x] All declared geometries are geometry(Geometry, 4326) for general geoms, or geometry(Point, 4326)
[x] Existing functions in crankshaft python library called from the extension are kept at least from version N to version N+1 (to avoid breakage during upgrades).
[x] Docs for public-facing functions are written
[x] New functions follow the naming conventions: CDB_NameOfFunction. Where internal functions begin with an underscore
This PR adds new functions which expose the spatial lag for Moran's I local (regular and rate). We need this functionality to create data science dashboards that communicate the moran's i scatter plot (described here). This also starts the process of deprecating the existing Moran's I functions (see #196 for more) in favor of ones with better names:
CDB_AreasOfInterestLocal
-->CDB_MoransILocal
CDB_AreasOfInterestLocalRate
-->CDB_MoransILocalRate
Note this changes the internal function
_CDB_AreasOfInterestLocal
(and...Rate
) to ~return thespatial_lag
column~ to rely on the_CDB_MoransILocal
function instead. The existing public functionsCDB_AreasOfInterestLocal
andCDB_AreasOfInterestLocalRate
are not affected (signatures remain the same), but their internals were refactored to accommodate the addition of theCDB_MoransILocal
andCDB_MoransILocalRate
functions.ToDo
Other ToDos
geometry(Geometry, 4326)
for general geoms, orgeometry(Point, 4326)
CDB_NameOfFunction
. Where internal functions begin with an underscoreedit removed some of the PR items that are now irrelevant
closes https://github.com/CartoDB/crankshaft/issues/201