Giter VIP home page Giter VIP logo

tesspy's Introduction

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]

tesspy's People

Contributors

jgaboardi avatar johamann avatar siavash-saki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.