gaia
gaia copied to clipboard
Add pysal spatial weight functions to gaia
Many spatial analysis functions in pysal rely on spatial weights, so we're adding this first.
TODO:
- add WeightProcess class to processes.py
- add WeightFileIO class to inputs.py
- test WeightProcess class
@chuehlien Could you please describe the use-case so that we can drive our development based on it. I am thinking spatial clustering but I am open for other ideas.
@chuehlien thanks for adding this on the github.
ping @chuehlien
Hey @aashish24 , some basic use cases for pysal are as follows:
- local autocorrelation
- use case: identify "hotspots" in disease outbreak
- return vector layer
- global autocorrelation - quantification of clustering/dispersion
- use case: tests if a certain disease is clustered in a region
- return a json object with with stats. eg, for Moran's I global correlation, return value of Moran's I, expected value under normality assumption, etc
- regionalization
- use case: form contiguous regions of states in the US displaying similar levels of per capita income over the period 1929-2010
- return vector layer
We could write each of them into a process. Let me know what you think, esp on whether these are good processes to add to the api and whether there are additional pysal use cases that should be prioritized. Thanks!
@chuehlien local and global autocorrelation would be most interesting. Let's try to get these two done first.
@aashish24 , I've added processes for local (ClusterProcess) and global autocorrelation (AutocorrelationProcess) to the spatial_weight branch.
Local process takes a vector file and variable column name, and returns a vector layer with the Local Moran's I statistics added. Global autocorrelation takes a vector file and variable column name and returns a json object with Global Moran's I statistics.
I've added the WeightProcess, WeightFileIO, and JsonFileIO classes as well. The WeightProcess or WeightFileIO are not required for the local/global autocorrelation processes to work, so we can remove them if we don't plan to include the process in the API.
I've also created six tests: a parser test and processor test for each of the new processes. The ClusterProcess and AutocorrelationProcess tests takes a while to run since calculating contiguity weight takes a while.
@aashish24 let me know if there are any additional processes to prioritize.