Metadata-Version: 2.1
Name: stco
Version: 0.1.1
Summary: Algorithms for analyzing the stability of spatial clusters over time
Author-email: Luke Zaruba <lukeazaruba@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Luke Zaruba
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/lukezaruba/stco
Project-URL: Issues, https://github.com/lukezaruba/stco/issues
Keywords: GIS,geospatial,spatiotemporal,spatialdatascience
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: esda
Requires-Dist: geopandas
Requires-Dist: numba
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: shapely
Requires-Dist: tqdm
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pre_commit; extra == "dev"

# stco

A Python package for assessing the temporal stability of spatial clustering methods via spatial overlay analysis.

## Introduction

Typically, to look at hotspots of point patterns we might aggregate the points to polygons and use a method like LISA or Getis-Ord Gi\* to find cold and hot spots. With clustering methods like A-DBSCAN, or any other clustering method that removes noise, we can produce cluster footprints to show "hotspots." There are existing ways to examine the spatial stability of clusters (e.g., A-DBSCAN), but what about looking at temporal stability of clusters and how they change over time? Methods like ST-DBSCAN incorporate the temporal dimension directly into the clustering algorithm, which slighly differs from what we are trying to accomplish here, since we want to look at change over time rather then clustering over both space and time. This leads to the question of, is there a way to study the temporal stability of clusters and explore emerging hotspots, in a way similar to that of Esri's Space Time Cube, without having to aggregate the data? The answer is yes, through `stco`.

`stco` seeks to provide a very simple way to analyze spatial clusters over time with the help of overlay analysis, one of the fundamental operations of GIScience. Rather than runnning clustering directly on the spatiotemporal data, we run spatial clustering on periods of time (by subsetting the data and taking "snapshots") of the spatiotemporal data to produce clusters for each time step. After this, a simple or weighted overlay can be used to examine how clusters change over time. In addition, through the STCEC method, cluster overlays can be classified according to the characteristics of the temporal pattern of cluster recognition in a given area.

## Installation

To install `stco` from PyPI, use the following command.

```bash
pip install stco
```

`stco` has been tested in Python 3.9, 3.10, and 3.11, and support for 3.12 is expected to work and will be tested in the near future. `stco` depends on the following packages:

- `esda`
- `geopandas`
- `numba`
- `numpy`
- `pandas`
- `shapely`
- `tqdm`

There are also additional dependencies for development. A comprehensive list of the recommended dependencies and the version used in development can be found in the `requirements.txt` file.

## Examples & Documentation

For examples, refer to the `examples` folder within the repository, which contains several notebooks.

For documentation, refer to the `examples` folder as well as the source code in the `stco` folder. In order to view documentation through the Python REPL or a notebook, you can use the following code on any given function, class, or method.

```python
help(stco.clustering.TemporalADBSCAN)
help(stco.overlay.simple_overlay)
help(stco.overlay.weighted_overlay)
help(stco.overlay.stcec)
```
