PySAL (Python Spatial Analysis Library) is an open-source Python library and ecosystem for spatial data science. It provides tools for geocomputation, spatial analysis, spatial statistics, spatial econometrics, and geovisualization. The project is distributed as a metapackage and as a set of smaller packages that provide tools for spatial weights, exploratory spatial data analysis, spatial regression, regionalization, point-pattern analysis, and mapping.
History PySAL began in 2005 as a collaboration between Sergio J. Rey and Luc Anselin. Its initial design drew on spatial analysis functionality developed for GeoDa and Space-Time Analysis of Regional Systems (STARS). The library was first formally released in July 2010 as a single Python package. The project was restructured as a metapackage in 2018. The first 2.x release, PySAL 2.0.0, followed in January 2019 and dropped support for Python 2 in favor of Python 3. The reorganization separated the metapackage from packages with more specific responsibilities and made it possible to install individual components independently.
Features PySAL's packages are grouped into four parts:
lib contains core data structures and methods, including libpysal for spatial weights, computational geometry, graph construction, and example datasets. explore contains exploratory and descriptive methods, including esda for exploratory spatial data analysis, giddy for spatial dynamics, pointpats for point-pattern analysis, and packages for inequality, segregation, urban morphology, and spatial networks. model contains statistical and econometric methods, including mgwr for multiscale geographically weighted regression and spreg for spatial regression and econometrics. viz contains map classification and statistical visualization tools, including mapclassify and splot. The library supports the construction and analysis of spatial weights matrices, measures of spatial autocorrelation such as Moran's I, exploratory spatial and spatiotemporal data analysis, spatial econometrics, regionalization, and geovisualization. PySAL is released under the BSD 3-Clause License.
Applications PySAL's spatial econometrics implementations have been compared with implementations for MATLAB, Stata, and R. A 2012 study incorporated PySAL and other open-source packages into a web-based environment for exploratory spatiotemporal data analysis. The textbook GIS Algorithms introduces PySAL through examples of spatial weights and Moran's I. University courses on geographic data science have used PySAL for mapping and spatial-weights exercises. PySAL has been used for Local Moran's I and network computations in traffic collision research, for local indicators of spatial association in epidemiological studies, and for point-pattern analysis in microbiome research.
See also GeoPandas GeoDa
References
External links Official website Source code on GitHub
