Skip to main content

Python implementation of geographical tiling using QuadKeys as proposed by Microsoft

Project description

🌍 pyquadkey2


This is a feature-rich Python implementation of QuadKeys, an approach to geographical tiling, popularized 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.

muety/pyquadkey2 originates from a fork of buckhx/QuadKey, which is not maintained anymore. It builds 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



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

Using Pip

$ pip 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

$ wget
$ pip install pyquadkey2-0.2.2.tar.gz

From source

Prerequisites (Linux)

  • gcc
    • Fedora: dnf install @development-tools
    • Ubuntu / Debian: apt install build-essential
  • python3-devel
    • Fedora: dnf install python3-devel
    • Ubuntu / Debian: apt install python3-dev
    • Others: See here

Prerequisites (Windows)

  • Visual C++ Build Tools 2015 (with Windows 10 SDK) (see here)


# Check out repo
$ git clone

# Create and active virtual environment (optional)
$ python -m venv ./venv
$ source venv/bin/activate

# Install depencencies
$ pip install -r requirements.txt

# Compile
$ cd src/pyquadkey2/quadkey/tilesystem && python build_ext --inplace && cd ../../../..

# Install as module
$ pip install .


Apache 2.0

Buy me a coffee

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

pyquadkey2-0.2.2.tar.gz (60.9 kB view hashes)

Uploaded source

Built Distributions

pyquadkey2-0.2.2-cp310-cp310-win_amd64.whl (30.8 kB view hashes)

Uploaded cp310

pyquadkey2-0.2.2-cp39-cp39-win_amd64.whl (28.6 kB view hashes)

Uploaded cp39

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