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]
Release files for tesspy 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tesspy-0.2.0.tar.gz | 68.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tesspy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.0 MB
Release files / tesspy-0.2.0.tar.gz
| Download URL | tesspy-0.2.0.tar.gz |
|---|---|
| Size | 68.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3b80ec76110672c891d546a38fc602a50c5b8eb7198e58aedb03c30ee9bb4fb
|
|
BLAKE2b-256 checksum How to use checksums |
a75263714dfdc3ad5804633781f3af6ed0d88b6d15c45fc2a435f9da5574f301
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logRelease files / tesspy-0.2.0-py3-none-any.whl
| Download URL | tesspy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9f0a673a74a461d828c295b64aaab096474ccbc8081250b6bf49084051bb372
|
|
BLAKE2b-256 checksum How to use checksums |
dff6b68ec68fd228e93278b249eccef358b71394d9ce53c5cec0ce81e0f0664b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency log