OpenDataAnalytics / gaia

Gaia is a geospatial analysis library jointly developed by Kitware and Epidemico.
31 stars 15 forks source link

Add pysal spatial weight functions to gaia #42

Open chuehlien opened 8 years ago

chuehlien commented 8 years ago

Many spatial analysis functions in pysal rely on spatial weights, so we're adding this first.

TODO:

aashish24 commented 8 years ago

@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.

aashish24 commented 8 years ago

@chuehlien thanks for adding this on the github.

aashish24 commented 8 years ago

ping @chuehlien

chuehlien commented 8 years ago

Hey @aashish24 , some basic use cases for pysal are as follows:

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!

aashish24 commented 8 years ago

@chuehlien local and global autocorrelation would be most interesting. Let's try to get these two done first.

chuehlien commented 8 years ago

@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.

chuehlien commented 8 years ago

@aashish24 let me know if there are any additional processes to prioritize.