Package: tesspy
tesspytesspyis 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 intesspy. 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.InstallationYou can installtesspyfrom PyPI using pip (Not Recommended):pip install tesspyand from conda (Recommended):conda install -c conda-forge tesspyCreating a new environment for tesspytesspydepends ongeopandas, 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:condacreate-ntesspy_env-cconda-forgeActivate this environment:condaactivatetesspy_envInstall tesspy from conda-forge channel:condainstall-cconda-forgetesspyInstall from the repositoryIf 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).condainstall-cconda-forgegeopandasscipyh3-pyosmnxhdbscanmercantilescikit-learnThen installTessPyusing:pipinstallgit+git://github.com/siavash-saki/tesspyDependenciestesspy's dependencies are:geopandas,scipy,h3-py,osmnx,hdbscan,mercantile, andscikit-learn.DocumentationThe official documentation is hosted onReadTheDocs.ExamplesThe 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 useamenitydata from the OpenStreetMap.fromtesspyimportTessellationffm=Tessellation('Frankfurt am Main')Squaresffm_sqruares=ffm.squares(resolution=15)Hexagonsffm_hex_8=ffm.hexagons(resolution=8)Adaptive Squaresffm_asq=ffm.adaptive_squares(start_resolution=14,threshold=100,poi_categories=['amenity'])Voronoi Polygonsffm_voronoi=ffm.voronoi(poi_categories=['amenity'],n_polygons=500)City Blocksffm_city_blocks=ffm.city_blocks(n_polygons=500)Contributing to tesspyAll kind of contributions are welcome:Improvement of code with new features, bug fixes, and  bug reportsImprovement of documentationAdditional testsFollow the instructionsherefor submitting a PR.If you have any ideas or questions, feel free to open an issue.Acknowledgementstesspyis the result of the research projectClusterMobilconducted by theResearch Lab for Urban Transport. This research project is funded by the state of Hesse andHOLMfunding under the “Innovations in Logistics and Mobility” measure of the Hessian Ministry of Economics, Energy, Transport and Housing. [HA Project No.: 1017/21-19]