Skip to main content

Tessellation of Urban Areas

Project description

tesspy

Tests Project Status: Active – The project has reached a stable, usable state and is being actively developed. Documentation Status version Conda Version

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

You can install tesspy from PyPI using pip (Not Recommended):

pip install tesspy

and from conda (Recommended):

conda install -c conda-forge tesspy

Creating a new environment for tesspy

tesspy depends on geopandas, which could make the installation sometimes tricky because of the conflicts with the current packages. Therefore, we recommend creating a new clean environment and installing the dependencies from the conda-forge channel.

Create a new environment:

conda create -n tesspy_env -c conda-forge

Activate this environment:

conda activate tesspy_env

Install tesspy from conda-forge channel:

conda install -c conda-forge tesspy

Install from the repository

If you want to work with the latest development version, you can directly install it from GitHub. To do that, it is recommended to first install all the dependencies using conda. (preferably in a newly created env).

conda install -c conda-forge geopandas scipy h3-py osmnx hdbscan mercantile scikit-learn

Then install TessPy using:

pip install git+git://github.com/siavash-saki/tesspy

Dependencies

tesspy's dependencies are: geopandas, scipy, h3-py, osmnx, hdbscan, mercantile, and scikit-learn.

Documentation

The official documentation is hosted on ReadTheDocs.

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)

Squares_tessellation

Hexagons

ffm_hex_8 = ffm.hexagons(resolution=8)

hexagon_tessellation

Adaptive Squares

ffm_asq = ffm.adaptive_squares(start_resolution=14, threshold=100, poi_categories=['amenity'])

adaptive_squares_tessellation

Voronoi Polygons

ffm_voronoi = ffm.voronoi(poi_categories=['amenity'], n_polygons=500)

Voronoi_tessellation

City Blocks

ffm_city_blocks = ffm.city_blocks(n_polygons=500)

city_blocks_tessellation

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

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

tesspy-0.1.2.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

tesspy-0.1.2-py3-none-any.whl (23.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page