Code Monkey home page Code Monkey logo

pysal.github.io's Introduction

Python Spatial Analysis Library

Unit Tests PyPI version Anaconda-Server Badge Discord Code style: black DOI

PySAL, the Python spatial analysis library, is an open source cross-platform library for geospatial data science with an emphasis on geospatial vector data written in Python. It supports the development of high level applications for spatial analysis, such as

  • detection of spatial clusters, hot-spots, and outliers
  • construction of graphs from spatial data
  • spatial regression and statistical modeling on geographically embedded networks
  • spatial econometrics
  • exploratory spatio-temporal data analysis

PySAL Components

PySAL is a family of packages for spatial data science and is divided into four major components:

Lib

solve a wide variety of computational geometry problems including graph construction from polygonal lattices, lines, and points, construction and interactive editing of spatial weights matrices & graphs - computation of alpha shapes, spatial indices, and spatial-topological relationships, and reading and writing of sparse graph data, as well as pure python readers of spatial vector data. Unike other PySAL modules, these functions are exposed together as a single package.

  • libpysal : libpysal provides foundational algorithms and data structures that support the rest of the library. This currently includes the following modules: input/output (io), which provides readers and writers for common geospatial file formats; weights (weights), which provides the main class to store spatial weights matrices, as well as several utilities to manipulate and operate on them; computational geometry (cg), with several algorithms, such as Voronoi tessellations or alpha shapes that efficiently process geometric shapes; and an additional module with example data sets (examples).

Explore

The explore layer includes modules to conduct exploratory analysis of spatial and spatio-temporal data. At a high level, packages in explore are focused on enabling the user to better understand patterns in the data and suggest new interesting questions rather than answer existing ones. They include methods to characterize the structure of spatial distributions (either on networks, in continuous space, or on polygonal lattices). In addition, this domain offers methods to examine the dynamics of these distributions, such as how their composition or spatial extent changes over time.

  • esda : esda implements methods for the analysis of both global (map-wide) and local (focal) spatial autocorrelation, for both continuous and binary data. In addition, the package increasingly offers cutting-edge statistics about boundary strength and measures of aggregation error in statistical analyses

  • giddy : giddy is an extension of esda to spatio-temporal data. The package hosts state-of-the-art methods that explicitly consider the role of space in the dynamics of distributions over time

  • inequality : inequality provides indices for measuring inequality over space and time. These comprise classic measures such as the Theil T information index and the Gini index in mean deviation form; but also spatially-explicit measures that incorporate the location and spatial configuration of observations in the calculation of inequality measures.

  • momepy : momepy is a library for quantitative analysis of urban form - urban morphometrics. It aims to provide a wide range of tools for a systematic and exhaustive analysis of urban form. It can work with a wide range of elements, while focused on building footprints and street networks. momepy stands for Morphological Measuring in Python.

  • pointpats : pointpats supports the statistical analysis of point data, including methods to characterize the spatial structure of an observed point pattern: a collection of locations where some phenomena of interest have been recorded. This includes measures of centrography which provide overall geometric summaries of the point pattern, including central tendency, dispersion, intensity, and extent.

  • segregation : segregation package calculates over 40 different segregation indices and provides a suite of additional features for measurement, visualization, and hypothesis testing that together represent the state-of-the-art in quantitative segregation analysis.

  • spaghetti : spaghetti supports the the spatial analysis of graphs, networks, topology, and inference. It includes functionality for the statistical testing of clusters on networks, a robust all-to-all Dijkstra shortest path algorithm with multiprocessing functionality, and high-performance geometric and spatial computations using geopandas that are necessary for high-resolution interpolation along networks, and the ability to connect near-network observations onto the network

Model

In contrast to explore, the model layer focuses on confirmatory analysis. In particular, its packages focus on the estimation of spatial relationships in data with a variety of linear, generalized-linear, generalized-additive, nonlinear, multi-level, and local regression models.

  • mgwr : mgwr provides scalable algorithms for estimation, inference, and prediction using single- and multi-scale geographically-weighted regression models in a variety of generalized linear model frameworks, as well model diagnostics tools

  • spglm : spglm implements a set of generalized linear regression techniques, including Gaussian, Poisson, and Logistic regression, that allow for sparse matrix operations in their computation and estimation to lower memory overhead and decreased computation time.

  • spint : spint provides a collection of tools to study spatial interaction processes and analyze spatial interaction data. It includes functionality to facilitate the calibration and interpretation of a family of gravity-type spatial interaction models, including those with production constraints, attraction constraints, or a combination of the two.

  • spreg : spreg supports the estimation of classic and spatial econometric models. Currently it contains methods for estimating standard Ordinary Least Squares (OLS), Two Stage Least Squares (2SLS) and Seemingly Unrelated Regressions (SUR), in addition to various tests of homokestadicity, normality, spatial randomness, and different types of spatial autocorrelation. It also includes a suite of tests for spatial dependence in models with binary dependent variables.

  • spvcm : spvcm provides a general framework for estimating spatially-correlated variance components models. This class of models allows for spatial dependence in the variance components, so that nearby groups may affect one another. It also also provides a general-purpose framework for estimating models using Gibbs sampling in Python, accelerated by the numba package.

  • tobler : tobler provides functionality for for areal interpolation and dasymetric mapping. Its name is an homage to the legendary geographer Waldo Tobler a pioneer of dozens of spatial analytical methods. tobler includes functionality for interpolating data using area-weighted approaches, regression model-based approaches that leverage remotely-sensed raster data as auxiliary information, and hybrid approaches.

  • access : access aims to make it easy for analysis to calculate measures of spatial accessibility. This work has traditionally had two challenges: [1] to calculate accurate travel time matrices at scale and [2] to derive measures of access using the travel times and supply and demand locations. access implements classic spatial access models, allowing easy comparison of methodologies and assumptions.

  • spopt: spopt is an open-source Python library for solving optimization problems with spatial data. Originating from the original region module in PySAL, it is under active development for the inclusion of newly proposed models and methods for regionalization, facility location, and transportation-oriented solutions.

Viz

The viz layer provides functionality to support the creation of geovisualisations and visual representations of outputs from a variety of spatial analyses. Visualization plays a central role in modern spatial/geographic data science. Current packages provide classification methods for choropleth mapping and a common API for linking PySAL outputs to visualization tool-kits in the Python ecosystem.

  • legendgram : legendgram is a small package that provides "legendgrams" legends that visualize the distribution of observations by color in a given map. These distributional visualizations for map classification schemes assist in analytical cartography and spatial data visualization

  • mapclassify : mapclassify provides functionality for Choropleth map classification. Currently, fifteen different classification schemes are available, including a highly-optimized implementation of Fisher-Jenks optimal classification. Each scheme inherits a common structure that ensures computations are scalable and supports applications in streaming contexts.

  • splot : splot provides statistical visualizations for spatial analysis. It methods for visualizing global and local spatial autocorrelation (through Moran scatterplots and cluster maps), temporal analysis of cluster dynamics (through heatmaps and rose diagrams), and multivariate choropleth mapping (through value-by-alpha maps. A high level API supports the creation of publication-ready visualizations

Installation

PySAL is available through Anaconda (in the defaults or conda-forge channel) We recommend installing PySAL from conda-forge:

conda config --add channels conda-forge
conda install pysal

PySAL can also be installed using pip:

pip install pysal

As of version 2.0.0 PySAL has shifted to Python 3 only.

Users who need an older stable version of PySAL that is Python 2 compatible can install version 1.14.3 through pip or conda:

conda install pysal==1.14.3

Documentation

For help on using PySAL, check out the following resources:

Development

As of version 2.0.0, PySAL is now a collection of affiliated geographic data science packages. Changes to the code for any of the subpackages should be directed at the respective upstream repositories, and not made here. Infrastructural changes for the meta-package, like those for tooling, building the package, and code standards, will be considered.

Development is hosted on github.

Discussions of development as well as help for users occurs on the developer list as well as in PySAL's Discord channel.

Getting Involved

If you are interested in contributing to PySAL please see our development guidelines.

Bug reports

To search for or report bugs, please see PySAL's issues.

Build Instructions

To build the meta-package pysal see tools/README.md.

License information

See the file "LICENSE.txt" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

pysal.github.io's People

Contributors

darribas avatar ecv19 avatar fiendskrah avatar gegen07 avatar jgaboardi avatar jlaura avatar knaaptime avatar ljwolf avatar pedrovma avatar sjsrey avatar slumnitz avatar weikang9009 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysal.github.io's Issues

Website refactoring

Brainstorming features to add/upgrade to pysal.org

More dynamic carousel (#205)

  • arrows are invisible, auto-rotation is too slow
  • should include
    • recent items from pysal.org/news
    • examples from the package pages
    • recent publications that cite PySAL
      • google scholar notifications
      • could be a standing item at PySAL dev meetings
  • Aside from the logo, items should be different each time someone loads the website e.g.
    • one package example, one news item, one recent publication that cites PySAL
    • each of the above items falls into a category - could have different buckets of categories that the carousel pulls from

Inconsistent paging for some packages

One goal of the refactor is to structure these pages more consistently. Some packages lead to a pysal.org html page, while others go to a github repository or a 404. The list of packages that do not direct to an internal page are:

  • momenpy goes to external site
  • pointpats goes to external 404
  • mgwr goes to external site
  • spglm goes to github repository
  • spint goes to github repository
  • spreg only has a video
  • spvcm goes to github repository
  • legendgram goes to github repository

Where should installation be?

Currently, installation page is nested inside documentation in the menu bar. We discussed shifting it to an individual item in the menu bar to make it more discoverable.

retroactive `tobler` release?

tobler's first release was the end of december (iirc), but we could add a retroactive announcement just for the sake of completeness. Would that be worth it?

Not trigger rebuild?

It seems that the website is not updated with changes to this repo. Any idea how to configure it?

core developers

Our About section includes mostly folks who are currently active developers, but also includes folks who are not currently active. Also, people who have made significant contributions in the past are not included. I propose we have two sections. Something simple like "Current Core Developers" and "Past Core Developers" would alleviate this discrepancy. Thoughts?

Clean up artifacts and organize repo

Now that we have decided on a fresh logo scheme, it may be time to give some attention to the website infrastructure. There are a ton of artifacts from the old website design and the guts could use a clean up, etc. I suggest we cut a release for posterity/reproducibility's sake (like what we did in logo) and then trim the fat from pysal.github.io.

`spopt` AGILE project

Once I get confirmation on #208, we need to make an entry for the current spopt AGILE project:

Rongbo Xu, Nick Bearman, Huanfa Chen, Qunshan Zhao, James Gaboardi, and Levi Wolf are working on a project to further develop the Location Allocation components within spopt. This project will also enable spopt to be applied across a wider variety of location-allocation tasks, these tools will contribute to a project in the Institute of Education at UCL to help large-scale student teacher training placement allocation. This is a joint project between the University of Glasgow and University College London, with funding from AGILE and the two universities.

cc @qszhao @nickbearman @ljwolf @rongboxu @huanfachen @paddyroddy
xref https://github.com/UCL/ioe-teacher-training-placements/issues/29#issuecomment-1436146016

Where did the submodule contract go?

We used to have recorded the list of guidelines needed for subpackages to get distributed in the old website. We called this the "submodule contract," mimicking the sklearn contract.

We should probably put this into our contributing documentation. This would require

  • finding it in the old website source
  • moving it into the wiki

Figure out communication to github.io from readthedocs.org

If the user goes to pysal.github.io, it is straightforward to access the documentation in pysal.readthedocs.org However, if the user wants to go back to the (up to date) home page in pysal.github.io from pysal.readthedocs.org, there is currently no link. This could involve setting up a way so that docs generated by sphinx pointed to pysal.github.io in certain pages (home, upcoming events, news and funding). Alternatively, these pages could be removed from sphinx and kept only under pysal.github.io

update submodule contract

the submodule contracts have diverged between the site & the wiki.

we need to:

  1. update the site's submodule contract from the wiki
  2. delete the submodule contract in the wiki
  3. update any links to submodule contract coming in from elsewhere (maybe the migrating directions?)

instructions on how to work with the website

For new users:

  1. git clone --recurse-submodules [email protected]:pysal/pysal.site
    this grabs the current copy of both the build scripts (which are in pysal/pysal.site), and the current user-facing website (which is in pysal/pysal.github.io). For git purposes, think of this like two independent repos. The first, pysal.site, stores all the stuff we used to build the website, plus a snapshot of the website (in build/html). The second, pysal.github.io, lives within build/html, and is tracked independently. There's a remote (called origin by default) for both, and both refer to pysal's copy.
  2. Each individual who wants to work on the site needs to add their fork of the public-facing website and the private-facing build stuff. To do this:
    1. cd pysal.site/build/html changes the working directory to the public-facing website.
    2. pick a good, memorable name for your personal copy. I often call mine wolf. Then, git remote add wolf [email protected]:ljwolf/pysal.github.io. This adds my fork to the public-facing site and calls it wolf.
    3. go back to the git root: cd ../../ and make sure you're in pysal.site
    4. Then, to add your fork of the private building area, use git remote add wolf [email protected]:ljwolf/pysal.site.

Now, your repository has the two modules, the "root" module pysal.site, which is the private building area, and the "submodule", stored in build/html, which refers to pysal.github.io and which only contains static html files.

Every time you run make html, this dumps into the public submodule, build/html, which is linked to https://github.com/pysal/pysal.github.io.
Changes to build/html can be added from inside and pushed to pysal.github.io.
But, pysal.site only records the commit referring to changes in pysal.github,.io.

sponsor row

it would be nice to do a row of sponsor logos at the bottom of the landing page similar to pandas and scikit. Apart from numfocus, nsf, the assorted universities, do we have others we could feature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.