On my quest to create test data for spatial statistics, I’ve discovered income data for Austria per municipality on a news paper website:
For further analysis, I decided to limit the area to Vienna and Lower Austria. Since the income data included GKZ “Gemeindekennzahl” IDs, it was possible to join them to municipalities extracted from OpenStreetMap using QuickOSM for QGIS. GRASS v.clean was used to clean the vector topology to the point where PySAL was able to compute spatial weights.
Using PySAL, I then computed income clusters: blue regions represent low clusters while red regions represent high clusters …
The results show a statistically significant cluster of low income in the north west, in the area called Waldviertel, as well as a cluster of high income containing many of the municipalities surrounding Vienna, an area often referred to as the “Speckgürtel” (“bacon belt”).
Update 2017: Please follow the instructions on the OSGeo4W website: https://trac.osgeo.org/osgeo4w/wiki/ExternalPythonPackages
Update 2015: I now recommend this workflow based on Nathan’s post on installing Python setup tools:
- Download ez_setup.py
python ez_setup.py in your OSGeo4W shell
easy_install pysal in your OSGeo4W shell
Today’s post is a summary of how to install PySAL on Windows for OSGeo4W Python.
The most important resource was https://trac.osgeo.org/osgeo4w/wiki/ExternalPythonPackages
In the OSGeo4W Shell run:
C:\Users\anita_000\Desktop>curl http://python-distribute.org/distribute_setup.py | python
Update: Note that python-distribute.org has gone down since I posted this. See http://www.gossamer-threads.com/lists/python/python/1158958 for more info.
Then download https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py to the Desktop and run:
When pip is ready, install PySAL:
C:\Users\anita_000\Desktop>pip install pysal
Test the installation:
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win 32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysal