Skip to main content

spatial-tda

image image

image

A Python package for Topological Data Analysis(TDA) in spatial data.

Introduction

Spatial-TDA is a Python package designed for extracting topological information from spatial data with minimal coding. It provides an intuitive framework for applying topological data analysis (TDA) to geospatial datasets, enabling researchers and analysts to explore spatial connectivity, adjacency relationships, and persistent homology efficiently. Built on GeoPandas, Gudhi, and Matplotlib, the package integrates seamless workflows for adjacency detection, simplicial complex construction, and persistent homology computation while maintaining geospatial integrity. With automatic adjacency extraction, Adjacency simplicial complex formation(Filtering up/ Filtering down), and topological visualization tools, Spatial-TDA simplifies geospatial TDA workflows, making it ideal for applications in epidemiology, environmental studies and spatial network analysis. Through a combination of computational efficiency and easy-to-use functions, Spatial-TDA bridges the gap between geospatial analytics and topological insights, enabling users to quantify and visualize higher-order spatial structures** with just a few lines of code.

Usage

Launch the interactive notebook tutorial for the spatial-tda Python package with Google Colab:(upcoming)

Key Features

The AdjacencySimplex class and the compute_persistence function provide a comprehensive framework for processing geospatial data, constructing simplicial complexes, and performing topological data analysis (TDA). These functionalities enable the study of spatial structures and relationships with a focus on spatial adjacency, simplicial complexes, and persistent homology. The key features include:

Geospatial Data Processing and Filtering

  • Threshold-based filtering: Users can define minimum and maximum thresholds to focus on specific data ranges.
  • Geospatial integrity maintenance: The framework ensures that processed data retains its geometric properties and CRS for further spatial analysis.

Adjacency Computation and Simplicial Complex Construction

  • Computing adjacency relationships: The class currently uses the Queen contiguity method to define adjacency, where regions are considered neighbors if they share at least one vertex. However, support for additional adjacency methods will be added soon, providing greater flexibility for geospatial topological analysis.
  • Generating simplicial complexes: The class constructs Adjacency simplicial complexes using adjacency relationships for both filtering up and filtering down methods, enabling higher-order topological analysis with greater flexibility and precision.

Persistent Homology and Topological Summaries

  • Computing persistence diagrams: The compute_persistence function constructs a Simplex Tree using Gudhi, assigning filtration values based on the input variable.
  • Topological summaries (TDA metrics): The function computes essential TDA summaries for dimension zero, including:
    • Total Lifespan (TL): The sum of persistence intervals.
    • Average Lifespan (AL): The mean lifespan of connected components.
    • Total Mid-Lifespan (TML): The sum of midpoints of persistence intervals.
    • Average Mid-Lifespan (AML): The average of midpoints of persistence intervals.

Efficient Computational Design

  • Optimized spatial computations: The class efficiently processes adjacency relationships, even for large datasets.
  • Integration with Pandas, GeoPandas, and Gudhi: The framework seamlessly works with popular Python libraries for geospatial and topological data analysis.
  • Dynamic variable selection: Users can select any numerical attribute to control filtering and sorting.

These features make the AdjacencySimplex class and compute_persistence function powerful tools for geospatial topological data analysis, helping researchers explore spatial connectivity, adjacency structures, and persistent homology in geospatial datasets. Whether for epidemiology, environmental studies, urban planning, or regional connectivity analysis, this framework provides an intuitive and structured approach to spatial TDA.

Citations

If you find spatial-tda useful in your research, please consider citing the following paper(still working on) to support my work. Thank you for your support.

Metadata

Release files for spatial-tda 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spatial-tda 0.1.9
File Size Uploaded Provenance Actions
spatial_tda-0.1.9.tar.gz 12.4 MB Without provenance Details for spatial_tda-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spatial-tda 0.1.9
File Interpreter ABI Platform Actions
spatial_tda-0.1.9-py2.py3-none-any.whl Python 2, Python 3 none any Details for spatial_tda-0.1.9-py2.py3-none-any.whl

Total release size: 12.4 MB

Release files / spatial_tda-0.1.9.tar.gz

Download URL spatial_tda-0.1.9.tar.gz
Size 12.4 MB
Tags Source
SHA-256 checksum
How to use checksums
7e787497361b90f845eafa7f6a52bf9ac82e6e65b79af2be681be229f9b93b1b
BLAKE2b-256 checksum
How to use checksums
1d692d263eec363fea1af5d3e4a2375238896f8d37403aaf7e78e779a3e31c8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / spatial_tda-0.1.9-py2.py3-none-any.whl

Download URL spatial_tda-0.1.9-py2.py3-none-any.whl
Size 10.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3078a443382dca13e345e977428de2f0bc9a52eef1e48b23d3f3ec4711266e05
BLAKE2b-256 checksum
How to use checksums
d15a596ab24656feaacea2b84ee3b7647d3ada276be638022c849509366ae3f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for spatial-tda 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page