spatial-access is a Python package designed for measuring spatial accessibility to services. It provides tools to construct road networks, represent facilities and demand points, and compute various accessibility metrics like the Two-Step Floating Catchment Area (2SFCA) method. The current version is 1.0.2, and releases are made as needed to address issues and introduce features.
pip install spatial-accessVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a simple road network, define facilities and demand points using GeoDataFrames, and then compute spatial accessibility using the Two-Step Floating Catchment Area (2SFCA) method. It uses dummy data to ensure the example is runnable out-of-the-box.
Upgrade to version 1.0.2 or newer. Alternatively, ensure your input network is a single connected component or filter to the largest connected component before processing.
Upgrade to version 1.0.2 or newer, which gracefully handles attempts to drop non-existent columns. For older versions, ensure all specified columns for removal actually exist in the DataFrame.
Always ensure that `nodes`, `edges`, `facilities`, and `demand` GeoDataFrames have a consistent CRS. Reproject them if necessary using `.to_crs()` before creating `Network` or `Access` objects. For example: `gdf.to_crs('EPSG:26918')` for projected coordinates suitable for distance calculations.Verify that the column names passed to `sa.Network` and `sa.Access` constructors (e.g., `weight_col`, `facility_col_name`, `demand_col_name`) exactly match the column names in your input GeoDataFrames.