Overview
This is a python module for calculating global (Moran’s I [1]) and local spatial autocorrelation [1.5] using the AMOEBA algorithm [2]. This code works on shapefiles, although a base class is provided to allow the examination of other objects, e.g. from a spatial database.
Usage
The easiest way is to call autocorrelate.py with the name and path of the shapefile, e.g.:
python autocorrelate.py path/to/file/filename.shp
To use in other python programs:
from lcia_autocorrelation.ac_shapefile import AutocorrelationShapefile
ac = AutocorrelationShapefile("filepath")
ac.global_autocorrelation()
Autocorrelation calculations are made using the PySAL library; multiple measures of autocorrelation are possible.
Local Indicators of Spatial Autocorrelation (LISA)
Moran’s I is a single statistic for global autocorrelation. However, the calculation of Moran’s I involves summing the individual cross products of each spatial unit. Local indicators of spatial association (LISA) (Anselin, L. (1995). “Local indicators of spatial association – LISA”. Geographical Analysis, 27, 93-115) uses these local indicators directly, to calculate a local measure of clustering or autocorrelation. The LISA statistic is:
Where I is the autocorrelation statistic, Z is the deviation of the variable of interest from the average, and W is the spatial weight linking i to j.
We use the PySAL library to calculate LISA statistics.
Installation
Using pip:
pip install lcia-autocorrelation
Using easy_install:
easy_install lcia-autocorrelation
Requirements
The following packages are required
numpy
scipy
pysal
rtree
osgeo
django
progressbar
Copyright and License
This code was written by Chris Mutel [3] during his studies at ETH Zurich [4], and is copyright 2011 ETH Zurich. The license is 2-clause BSD.
Metadata
Release files for py_amoeba 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_amoeba-0.2.3.tar.gz | 8.0 kB | Details |
Release files / py_amoeba-0.2.3.tar.gz
| Download URL | py_amoeba-0.2.3.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddbe215d50339df9139e2e27c913107302d9834b5750bc96b03101587801ee3d
|
|
BLAKE2b-256 checksum How to use checksums |
4efbd49ef0aa26e88e9b13f6988078e6e42cee19c1831974ac1353fffd889780
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |