Skip to main content

PyPI - Version CI - Test Code style: black GitHub last commit GitHub issues PyPI - License

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.

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.

from stco.clustering import SnapshotADBSCAN
from stco.overlay import simple_overlay, stcec, weighted_overlay

help(SnapshotADBSCAN)
help(simple_overlay)
help(weighted_overlay)
help(stcec)

Metadata

Release files for stco 0.1.2

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

Source distribution (sdist)

Source distribution for stco 0.1.2
File Size Uploaded
stco-0.1.2.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stco 0.1.2
File Interpreter ABI Platform
stco-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / stco-0.1.2.tar.gz

Download URL stco-0.1.2.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c3ad523e401d879759d6cc41d5551e55a43f1bf7be93e23457cd00d345ffce80
BLAKE2b-256 checksum
How to use checksums
4caf765b78dc65718053b564d4b42a8dc1a188774c496aa1a2840e8e011d3732
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / stco-0.1.2-py3-none-any.whl

Download URL stco-0.1.2-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb5d4f05160b58d43ed3e6e1c05fe9c0ed7765be3c30aebec88b04d37e080adb
BLAKE2b-256 checksum
How to use checksums
72f34c1736f797b6c6a59f7610514a317c997290d770c381c4c846126bd12977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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