Tessellation of Urban Areas
Project description
tesspy
tesspy is a python library for geographical tessellation.
The process of discretization of space into subspaces without overlaps and gaps is called tessellation and is of interest to researchers in the field of spatial analysis. Tessellation is essential in understanding geographical space and provides a framework for analyzing geospatial data. Different tessellation methods are implemented in tesspy. They can be divided into two groups. The first group is regular tessellation methods: square grid and hexagon grid. The second group is irregular tessellation methods based on geospatial data. These methods are adaptive squares, Voronoi diagrams, and city blocks. The geospatial data used for tessellation is retrieved from the OpenStreetMap database.
Installation
Install tesspy using uv (Recommended):
uv pip install tesspy
or using pip:
pip install tesspy
tesspy is also available on conda-forge:
conda install -c conda-forge tesspy
Creating a new environment for tesspy
We recommend using uv to create and manage a virtual environment:
uv venv tesspy_env
source tesspy_env/bin/activate # Linux/macOS
# tesspy_env\Scripts\activate # Windows
uv pip install tesspy
To also install dependencies for running the example notebooks:
uv pip install "tesspy[examples]"
Dependencies
tesspy's dependencies are: geopandas, scipy, h3-py, osmnx, hdbscan, mercantile, matplotlib and scikit-learn.
Documentation
The official documentation is hosted on ReadTheDocs.
Logging
tesspy uses Python's standard logging module. By default, library logging is
silent unless you configure it.
Basic progress logs:
from tesspy import Tessellation, configure_logging
configure_logging("INFO")
t = Tessellation("Frankfurt am Main")
t.city_blocks(verbose=True)
Use verbose=True on POI-driven methods to emit progress events.
Examples
The city of "Frankfurt am Main" in Germany is used to showcase different tessellation methods. This is how a tessellation object is built, and different methods are called. For the tessellation methods based on Points of Interests (adaptive squares, Voronoi polygons, and City Blocks), we use amenity data from the OpenStreetMap.
from tesspy import Tessellation
ffm= Tessellation('Frankfurt am Main')
Squares
ffm_sqruares = ffm.squares(resolution=15)
Hexagons
ffm_hex_8 = ffm.hexagons(resolution=8)
Adaptive Squares
ffm_asq = ffm.adaptive_squares(start_resolution=14, threshold=100, poi_categories=['amenity'])
Voronoi Polygons
ffm_voronoi = ffm.voronoi(poi_categories=['amenity'], n_polygons=500)
City Blocks
ffm_city_blocks = ffm.city_blocks(n_polygons=500)
Citing Tesspy
We would be very grateful if you would cite Tesspy in your scientific publications. Please feel free to use the following citation for this purpose: Saki et al., (2022). TessPy: a python package for geographical tessellation. Journal of Open Source Software, 7(76), 4620, https://doi.org/10.21105/joss.04620
or the bibtex citation directly:
@article{Saki2022,
doi = {10.21105/joss.04620},
url = {https://doi.org/10.21105/joss.04620},
year = {2022},
publisher = {The Open Journal},
volume = {7},
number = {76},
pages = {4620},
author = {Siavash Saki and Jonas Hamann and Tobias Hagen},
title = {TessPy: a python package for geographical tessellation},
journal = {Journal of Open Source Software}}
Contributing to tesspy
All kind of contributions are welcome:
- Improvement of code with new features, bug fixes, and bug reports
- Improvement of documentation
- Additional tests
To set up a development environment, clone the repo and install in editable mode:
git clone https://github.com/siavash-saki/tesspy.git
cd tesspy
uv pip install -e ".[dev,examples]"
Follow the instructions here for submitting a PR.
If you have any ideas or questions, feel free to open an issue.
Acknowledgements
tesspy is the result of the research project ClusterMobil conducted by the Research Lab for Urban Transport. This research project is funded by the state of Hesse and HOLM funding under the “Innovations in Logistics and Mobility” measure of the Hessian Ministry of Economics, Energy, Transport and Housing. [HA Project No.: 1017/21-19]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tesspy-0.2.0.tar.gz.
File metadata
- Download URL: tesspy-0.2.0.tar.gz
- Upload date:
- Size: 68.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3b80ec76110672c891d546a38fc602a50c5b8eb7198e58aedb03c30ee9bb4fb
|
|
| MD5 |
833c29e7c6e7c1ce442d2287e01f6c54
|
|
| BLAKE2b-256 |
a75263714dfdc3ad5804633781f3af6ed0d88b6d15c45fc2a435f9da5574f301
|
Provenance
The following attestation bundles were made for tesspy-0.2.0.tar.gz:
Publisher:
python-publish.yml on siavash-saki/tesspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tesspy-0.2.0.tar.gz -
Subject digest:
f3b80ec76110672c891d546a38fc602a50c5b8eb7198e58aedb03c30ee9bb4fb - Sigstore transparency entry: 976517764
- Sigstore integration time:
-
Permalink:
siavash-saki/tesspy@bb5d3eea5160c9168082536b15f8e580ae48ac0d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/siavash-saki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bb5d3eea5160c9168082536b15f8e580ae48ac0d -
Trigger Event:
release
-
Statement type:
File details
Details for the file tesspy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tesspy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9f0a673a74a461d828c295b64aaab096474ccbc8081250b6bf49084051bb372
|
|
| MD5 |
e0713bcd7617463bcbf81e94b9e1b81e
|
|
| BLAKE2b-256 |
dff6b68ec68fd228e93278b249eccef358b71394d9ce53c5cec0ce81e0f0664b
|
Provenance
The following attestation bundles were made for tesspy-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on siavash-saki/tesspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tesspy-0.2.0-py3-none-any.whl -
Subject digest:
c9f0a673a74a461d828c295b64aaab096474ccbc8081250b6bf49084051bb372 - Sigstore transparency entry: 976517770
- Sigstore integration time:
-
Permalink:
siavash-saki/tesspy@bb5d3eea5160c9168082536b15f8e580ae48ac0d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/siavash-saki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bb5d3eea5160c9168082536b15f8e580ae48ac0d -
Trigger Event:
release
-
Statement type: