Skip to content

🌐 Python implementation of geographical tiling using QuadKeys as proposed by Microsoft

License

Notifications You must be signed in to change notification settings

koxudaxi/pyquadkey2

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 pyquadkey2

Documentation

This is a feature-rich Python implementation of QuadKeys, an approach to geographical tiling, that was proposed by Microsoft to be used for Bing Maps.

In essence, the concept is to recursively divide the flat, two-dimensional world map into squares. Each square contains four squares as children, which again contain four squares and so on, up centimeter-level precision. Each of these squares is uniquely identifiable with a string like 021030032.

For more details on the concept, please refer to the original article.

n1try/pyquadkey2 originates from a fork of buckhx/QuadKey, which is not maintained anymore. It build on top of that project and adds:

  • βœ… Several (critical) bug fixes
  • βœ… Python 3 support
  • βœ… Type hints for all methods
  • βœ… Higher test coverage
  • βœ… Cython backend for improved performance
  • βœ… 64-bit integer representation of QuadKeys
  • βœ… Additional features and convenience methods

Installation

Requirements

This library requires Python 3.6 or higher. To compile it by yourself, Cython is required in addition.

Using Pip

  • pip3 install pyquadkey2

Pip installation is only tested for Linux and Mac, yet. If you encounter problems with the installation on Windows, please report them as a new issue.

From archive

  • Download the latest release as archive (.tar.gz) or wheel (.whl), e.g. 0.1.1.tar.gz
  • Install it with pip: pip3 install 0.1.1.tar.gz

From source

  • Clone repository: git clone https://github.com/n1try/pyquadkey2
  • Make sure Cython is installed: pip3 install cython
  • Compile Cython modules: cd pyquadkey2/quadkey/tilesystem && python3 setup.py build_ext --inplace && ../../
  • Install the library with Pip: pip3 install .

Troubleshooting

  • ImportError: cannot import name 'tilesystem': Simply try pip3 install --upgrade pyquadkey2 once again. Second time usually works, as required build extensions are installed then. This is a known issue and will be fixed in the future.

License

Apache 2.0

Buy me a coffee

About

🌐 Python implementation of geographical tiling using QuadKeys as proposed by Microsoft

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • Python 100.0%