Skip to main content

The Geospatial Neighborhood Analysis Package

Project description

geosnap

The Geospatial Neighborhood Analysis Package

Continuous Integration codecov PyPI - Python Version PyPI Conda (channel only) Conda GitHub commits since latest release (branch) DOI

geosnap provides a suite of tools for exploring, modeling, and visualizing the social context and spatial extent of neighborhoods and regions over time. It brings together state-of-the-art techniques from geodemographics, regionalization, spatial data science, and segregation analysis to support social science research, public policy analysis, and urban planning. It provides a simple interface tailored to formal analysis of spatiotemporal urban data.

DC Transitions

Main Features

  • fast, efficient tooling for standardizing data from multiple time periods into a shared geographic representation appropriate for spatiotemporal analysis

  • analytical methods for understanding sociospatial structure in neighborhoods, cities, and regions, using unsupervised ML from scikit-learn and spatial optimization from PySAL

    • classic and spatial analytic methods for diagnosing model fit, and locating (spatial) statistical outliers
  • novel techniques for understanding the evolution of neighborhoods over time, including identifying hotspots of local neighborhood change, as well as modeling and simulating neighborhood conditions into the future

  • quick access to a large database of commonly-used neighborhood indicators from U.S. providers including Census, EPA, LEHD, NCES, and NLCD, streamed from the cloud thanks to quilt and the highly-performant geoparquet file format.

Why

Understanding neighborhood context is critical for social science research, public policy analysis, and urban planning. The social meaning, formal definition, and formal operationalization of "neighborhood" depends on the study or application, however, so neighborhood analysis and modeling requires both flexibility and adherence to a formal pipeline. Maintaining that balance is challenging for a variety of reasons:

  • many different physical and social data can characterize a neighborhood (e.g. its proximity to the urban core, its share of residents with a high school education, or the median price of its apartments) so there are countless ways to model neighborhoods by choosing different subsets of attributes to define them

  • conceptually, neighborhoods evolve through both space and time, meaning their socially-construed boundaries can shift over time, as can their demographic makeup.

  • geographic tabulation units change boundaries over time, meaning the raw data are aggregated to different areal units at different points in time.

  • the relevant dimensions of neighborhood change are fluid, as are the thresholds that define meaningful change

To address those challenges, geosnap incorporates tools from the PySAL ecosystem and scikit-learn along with internal data-wrangling that helps keep inputs and outputs simple for users. It operates on long-form geodataframes and includes logic for common transformations, like harmonizing geographic boundaries over time, and standardizing variables within their time-period prior to conducting pooled geodemographic clustering.

This means that while geosnap has native support for commonly-used datasets like the Longitudinal Tract Database (LTDB), or the Neighborhood Change Database (NCDB), it can also incorporate a wide variety of datasets, at any spatial resolution, as long as the user understands the implications of the interpolation process.

Research Questions

The package supports social scientists examining questions such as:

  • Where are the socially-homogenous districts in the city?
    • Have the composition of these districts or their location shifted over time?
  • What are the characteristics of prototypical neighborhoods in city or region X?
  • Have the locations of different neighborhood prototypes changed over time? e.g:
    • do central-city neighborhoods show signs of gentrification?(and/or does poverty appear to be suburbanizing?)
    • is there equitable access to fair housing in high-opportunity neighborhoods (or a dearth of resources in highly-segregated neighborhoods)?
  • Which neighborhoods have experienced dramatic change in several important variables? (and are they clustered together in space?)
  • If spatial and temporal trends hold, how might we expect neighborhoods to look in the future?
    • how does the region look differently if units 1,2, and 3 are changed to a different type in the current time period?
  • Has the region become more or less segregated over time?
    • at which spatial scales?
    • is the change statistically significant?

Installation

We recommend installing geosnap via a package manager that supports installing conda packages from conda-forge. Installing directly from the Python Package Index (PyPI) is also supported.

Installation via Miniforge

mamba install -c conda-forge geosnap

Installation via Pixi

Installation via pixi is supported, excluding pixi global install:

pixi init name_of_my_project
cd name_of_my_project
pixi add geosnap

Installation via pip

pip install geosnap

Installation via uv

uv pip install geosnap

User Guide

See the User Guide for a gentle introduction to using geosnap for neighborhood research

API Documentation

See the API docs for a thorough explanation of geosnap's core functionality

Development

geosnap development is hosted on github

To get started with the development version, clone this repository or download it manually then cd into the directory and run the following commands:

conda env create -f environment.yml
conda activate geosnap 
pip install -e . --no-deps

This will download the appropriate dependencies and install geosnap in its own conda environment.

Bug reports

To search for or report bugs, please see geosnap’s issues

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.

Citation

For a generic citation of geosnap, we recommend the following:

@misc{Knaap2019,
author = {Knaap, Elijah and Kang, Wei and Rey, Sergio and Wolf, Levi John and Cortes, Renan Xavier and Han, Su},
doi = {10.5281/ZENODO.3526163},
title = {{geosnap: The Geospatial Neighborhood Analysis Package}},
url = {https://zenodo.org/record/3526163},
year = {2019}
}

If you need to cite a specific release of the package, please find the appropriate version on Zenodo

Funding

This project is supported by NSF Award #1733705, Neighborhoods in Space-Time Contexts

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geosnap-0.16.0.tar.gz (29.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geosnap-0.16.0-py3-none-any.whl (193.4 kB view details)

Uploaded Python 3

File details

Details for the file geosnap-0.16.0.tar.gz.

File metadata

  • Download URL: geosnap-0.16.0.tar.gz
  • Upload date:
  • Size: 29.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geosnap-0.16.0.tar.gz
Algorithm Hash digest
SHA256 b37698cf1eedef3f70106d31d871b24a6eb44cf9ac3c358423d18106ccb68753
MD5 372e9d17f20a553e0514eb7154a241db
BLAKE2b-256 4146d1b49331d18c7736a6af9620c2b7a2e8d7cd77dd076273717789d1685c5d

See more details on using hashes here.

File details

Details for the file geosnap-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: geosnap-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 193.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geosnap-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0db30b354c28a57eddac4c3dccd3cbc6525bf45fce515f0d73c6ce3a582c2848
MD5 69ca47c2e7b6374f947638bb4dc765f1
BLAKE2b-256 5641be21cf34be7ad9a8ebebe4d272c2969dbcb9ca5f4827d41123cc88702180

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page