Skip to main content

Python implementation of geographical tiling using QuadKeys as proposed by Microsoft

Project description

🌍 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, yet. If you encounter problems with the installation on Mac or 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

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.1.1.tar.gz (43.9 kB view details)

Uploaded Source

File details

Details for the file pyquadkey2-0.1.1.tar.gz.

File metadata

  • Download URL: pyquadkey2-0.1.1.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4

File hashes

Hashes for pyquadkey2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6c32b4fb8a3a7311b68f3b8d209d4dbdce4c70ca3eb2a833c4bc8611194fb60a
MD5 b337fda79e798f5bcb42a9b6f1f15970
BLAKE2b-256 c90dad4ec0d25068085df9d476da1476215e1a73e882c116a9d06baac2f644bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page