API reference¶
IO Module¶
Accessing Datasets¶
The DataStore class provides access to a fast and efficient database of neighborhood indicators for the United States. The DataStore can read information directly over the web, or it can cache the datasets locally for (shared) repeated use. Large datasets are available quickly with no configuration by accessing methods on the class.
|
Storage for geosnap data. |
|
American Community Survey Data (5-year estimates). |
Table that maps states to their respective BEA regions |
|
|
Census blocks for 2000. |
|
Census blocks for 2010. |
|
Census blocks for 2020. |
Codebook. |
|
Nationwide counties as drawn in 2010. |
|
|
EPA EJScreen Data <https://www.epa.gov/ejscreen>. |
_summary_ |
|
Longitudinal Tract Database (LTDB). |
|
2010 Metropolitan Statistical Area definitions. |
|
Metropolitan Statistical Areas as drawn in 2020. |
|
Geolytics Neighborhood Change Database (NCDB). |
|
|
National Center for Education Statistics (NCES) Data. |
|
Print the location of the local geosnap data storage directory. |
States. |
|
|
Nationwide Census Tracts as drawn in 1990 (cartographic 500k). |
|
Nationwide Census Tracts as drawn in 2000 (cartographic 500k). |
|
Nationwide Census Tracts as drawn in 2010 (cartographic 500k). |
|
Nationwide Census Tracts as drawn in 2020 (cartographic 500k). |
Storing data¶
To store the datasets locally for repeated use, or to register an external dataset with geosnap, such as the Longitudinal Tract Database (LTDB) or the Neighborhood Change Database (NCDB), the io module includes functions for caching data on your local machine. When you instantiate a DataStore class, it will use local files instead of streaming over the web.
|
Save census American Community Survey 5-year data to the local geosnap storage. |
|
Save census data to the local quilt package storage. |
|
Save census 2000 census block data to the local quilt package storage. |
|
Save census 2010 census block data to the local quilt package storage. |
|
Save census 2020 census block data to the local quilt package storage. |
|
Save EPA EJScreen data to the local geosnap storage. |
|
Read & store data from Brown's Longitudinal Tract Database (LTDB). |
|
Read & store data from Geolytics's Neighborhood Change Database. |
|
Save NCES data to the local geosnap storage. |
Querying datasets¶
|
Extract a subset of data from the American Community Survey (ACS). |
|
Extract a subset of data from the decennial U.S. |
|
Extract a subset of data from the EPA EJSCREEN as a long-form geodataframe. |
|
Collect data from GADM as a geodataframe. |
|
Extract a subset of data from Census LEHD/LODES . |
|
Extract a subset of data from the Longitudinal Tract Database (LTDB) as a long-form geodataframe. |
|
Extract a subset of data from the National Center for Educational Statistics as a long-form geodataframe. |
|
Extract a subset of data from the Neighborhood Change Database (NCDB). |
|
Create a pandana.Network object from a geodataframe (via OSMnx graph). |
|
Reproject a pandana.Network object into another coordinate system. |
Analyze Module¶
Neighborhood Clustering Methods¶
Model neighborhood differentiation using multivariate clustering algorithms
|
Create a geodemographic typology by running a cluster analysis on the study area's neighborhood attributes. |
|
Brute-forse search through cluster fit metrics to determine the optimal number of k clusters |
|
Brute force through cluster fit metrics to determine the optimal number of k regions |
|
Create a spatial geodemographic typology by running a cluster analysis on the metro area's neighborhood attributes and including a contiguity constraint. |
Neighborhood Dynamics Methods¶
Model neighborhood change using optimal-matching algorithms or spatial discrete Markov chains
|
Draw a set of class labels for each unit in a geodataframe using transition probabilities defined by a giddy.Spatial_Markov model and the spatial lag of each unit. |
|
Local Indicator of Neighborhood Change |
|
generate local indicators of neighborhood change from a long-form geodataframe |
|
Pairwise sequence analysis and sequence clustering. |
|
Model neighborhood change as a discrete spatial Markov process. |
Segregation Dynamics Methods¶
Rapidly compute and compare changes in segregation measures over time and across space
|
Batch compute singlegroup segregation indices for each time period in parallel. |
|
Batch compute multigroup segregation indices for each time period. |
|
Batch compute multiscalar segregation profiles for each time period in parallel. |
Network Analysis Methods¶
Compute shortest path distance along a network using pandana, and visualize travel time isochrones from local data
|
Create an adjacency list of shortest network-based travel between |
|
Create travel isochrones for several origins simultaneously |
The ModelResults Class¶
Many of geosnap’s analytics methods can return a ModelResults class that stores additional statistics, diagnostics, and plotting methods for inspection
Calculate boundary silhouette scores for each unit. |
|
Calculate Local Indicators of Neighborhood Change (LINC) scores for each unit. |
|
Calculate path silhouette scores for each unit. |
|
Calculate silhouette scores for the each unit. |
|
Plot the boundary silhouette scores for each unit as a choropleth map. |
|
Plot the next-best cluster label for each unit as a choropleth map. |
|
|
Create a diagnostic plot of silhouette scores using scikit-plot. |
Plot the silhouette scores for each unit as a [series of] choropleth map(s). |
|
Plot the path silhouette scores for each unit as a choropleth map. |
|
|
Predict neighborhood labels from the model in future time periods using a spatial Markov transition model |
Harmonize Module¶
|
Use spatial interpolation to standardize neighborhood boundaries over time. |
Visualize Module¶
|
Create an animated gif from a long-form geodataframe timeseries. |
|
Create an animated gif from a director of image files. |
|
Function for index plot of neighborhood sequences within each cluster. |
|
Plot an attribute from a geodataframe arranged as a timeseries with consistent colorscaling. |
|
Plot global and spatially-conditioned transition matrices as heatmaps. |
|
Plot a network graph representation of global and spatially-conditioned transition matrices. |
|
Create matrix of violin plots categorized by a discrete class variable |