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
Installation
Requirements
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 https://github.com/muety/pyquadkey2/releases/download/0.2.2/pyquadkey2-0.2.2.tar.gz
$ pip install pyquadkey2-0.2.2.tar.gz
From source
Prerequisites (Linux
)
gcc
- Fedora:
dnf install @development-tools
- Ubuntu / Debian:
apt install build-essential
- Fedora:
python3-devel
- Fedora:
dnf install python3-devel
- Ubuntu / Debian:
apt install python3-dev
- Others: See here
- Fedora:
Prerequisites (Windows
)
- Visual C++ Build Tools 2015 (with Windows 10 SDK) (see here)
Build
# Check out repo
$ git clone https://github.com/muety/pyquadkey2
# 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 setup.py build_ext --inplace && cd ../../../..
# Install as module
$ pip install .
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pyquadkey2-0.2.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9448eac4dca3bf5407bccf2a8d4886432bf877770683733bbe68af8ddcbab43d |
|
MD5 | 4bd2eafffc33f79d036619e9dc336250 |
|
BLAKE2b-256 | 5f67bf7c6a1221676ba900607b441bb9bcd37dac60e8d715fb2115110bb74f3c |
Hashes for pyquadkey2-0.2.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff30c8561eaf36ab0cbd4c5e4dc004b900c22c925ffd1759d4b03a46e95fa15 |
|
MD5 | d57ed4e583d66b88aff747ff7c9527a5 |
|
BLAKE2b-256 | 6fe022f52fc5341444547f8f830d32fbb1006b389506fcf6280c67b6ee052642 |
Hashes for pyquadkey2-0.2.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0efc0a16f20176de56ddc54c412dc2a7ee74e6f26e51a8c4c3ca6f9a0da329d |
|
MD5 | 0cf43422029acc3950d2d1f4e533a7ba |
|
BLAKE2b-256 | c1ce344f86bb34b2aa308f3d44a60f2d8dca015798242f6e638e8ff860725b73 |
Hashes for pyquadkey2-0.2.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e95e4f01be0a3376c0d8c68b56e58e1bbdcc6b8887a5619fd951420fddd6451 |
|
MD5 | f390b49e7d0f69af81f9c2c6e8358f80 |
|
BLAKE2b-256 | 8b0f8b5210c916fcd14590273499ca96f08900909a56de6d57484bc3e1e86cff |