Metadata-Version: 2.4
Name: gasfca
Version: 1.3.0
Summary: High-performance Gaussian Two-Step Floating Catchment Area (Ga2SFCA) accessibility analysis tool
Author-email: 大城智算团队 <1071974905@qq.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Yao2028908/gasfca
Project-URL: Repository, https://github.com/Yao2028908/gasfca
Project-URL: Bug Tracker, https://github.com/Yao2028908/gasfca/issues
Keywords: GIS,accessibility,urban-planning,spatial-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: geopandas>=0.12.0
Requires-Dist: pandas>=1.5.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: pyproj>=3.4.0
Requires-Dist: scipy>=1.9.0
Requires-Dist: networkit>=11.2.1
Requires-Dist: numba>=0.57.0
Requires-Dist: rasterio>=1.3.0
Requires-Dist: shapely>=2.0.0
Requires-Dist: matplotlib>=3.6.0
Requires-Dist: tqdm>=4.64.0
Requires-Dist: pyogrio>=0.4.0
Dynamic: license-file

# GASFCA

**Gaussian Two-Step Floating Catchment Area (Ga2SFCA)** — a high-performance urban public resource accessibility analysis tool for territorial spatial planning, urban governance and public service equalization research.

Built on real road networks, Gaussian distance decay and Numba parallel acceleration, it provides an end-to-end automated pipeline:

```
Data preprocessing -> Road topology optimization -> Shortest path solving
-> Multi-threshold accessibility -> IDW raster generation -> Quantile visualization
```

Supports automatic adaptation of **point / polygon data**, and one-click output of vector (shp/gpkg/geojson), table (csv/xlsx), raster (tif) and thematic maps. Suitable for accessibility assessment of parks, healthcare, education, elderly care and other public resources.

## Features

- ✅ **Point / polygon auto-adaptation**: polygons are projected, area-computed and converted to centroids automatically
- ✅ **Real road-network distance**: NetworKit ultra-fast shortest paths
- ✅ **Numba parallel acceleration**: far faster than manual GIS workflows
- ✅ **Multi-threshold batch computation**: e.g. 1000/1500/3000/5000 m
- ✅ **Gaussian distance-decay model**: close to real travel behavior
- ✅ **IDW continuous accessibility raster generation**
- ✅ **Per-image independent quantile visualization**: robust for skewed data
- ✅ **Multi-format export**: shp / gpkg / geojson / csv / xlsx
- ✅ **xlsx multi-case merge**: each run appended as one sheet (per case/category)
- ✅ **Progress bars** throughout the pipeline

## Installation

```bash
pip install gasfca
```

## Quick Start

```python
from gasfca import run_gasfca

# Input data paths (any OGR-supported vector format)
supply_path = "supply.geojson"
demand_path = "demand.shp"
road_path   = "road.gpkg"

run_gasfca(
    supply_path=supply_path,
    demand_path=demand_path,
    road_path=road_path,
    supply_field="value",      # numeric field of the supply points
    demand_field="value",      # numeric field of the demand points
    d0_list=[1000, 1500, 3000, 5000],   # distance thresholds (meters)
    target_crs=3857,           # target projected CRS (metric units)
    cell_size=100,             # raster cell size (meters)
    output_dir="result",       # unified output directory
    output_formats=("shp", "gpkg", "geojson", "csv", "xlsx"),
    case_name=None,            # None = auto timestamp; used as the Excel sheet name
    generate_plots=True,
)
```

### Output structure

```
result/
├── vector/accessibility.{shp,gpkg,geojson}   # vector results with geometry
├── table/accessibility.csv                    # attribute table (no geometry)
├── table/accessibility.xlsx                   # multi-case merge: one sheet per run
├── raster/Ai_1000.tif, ...                    # IDW rasters
└── raster/quantile_plots/*.png                # quantile visualizations
```

## License

MIT
