Skip to main content

Python library that provides a powerful set of tools and functions for working with quadkeys. Built on top of C it offers lightning-fast calculations, ensuring optimal performance even with large-scale datasets.

Project description

quadkey-boosted

License Python C

Description

quadkey-boosted is a high-performance Python library that provides a powerful set of tools and functions for working with quadkeys, enabling seamless integration of tile-based mapping systems into your Python applications. Built on top of a blazing-fast C implementation, quadkey-boosted offers lightning-fast calculations, ensuring optimal performance even with large-scale datasets.

Key Features

  • Available API's
    • Conversion
      • lat lng to QuadKey
      • QuadKey to lat lng
      • QuadKey to BingTile
      • BingTile to QuadKey
      • Polygon to quadQuadKeykeys
      • QuadKey to Multipolygon
    • Operations
      • get parent
      • get childrens
      • get K neighbours
    • Metadata
      • get average tile size
      • get zoom level
      • get tile distance between two tiles
      • WKT, GeoJson, WKB representation of quadkey
  • C based backend for fast calculations
  • Can handle various types of projections

License

License

Project Status

  • ✅ Add Basic convertion API
  • ❎ Implement advance geospatial apis
  • ❎ Add support for projections

What is a QuadKey?

A QuadKey is a string representation of a tile's location in a quadtree hierarchy. It is used to index and address tiles at different levels of detail (zoom levels). The QuadKey system is based on dividing the Earth's surface into quadrants using a quadtree structure.

For more details on the concept, please refer to the Microsoft Article About this.

Installation

Requirements

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

using pip

pip install quadkey-boosted

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

Prerequisites (Windows)

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

Build from source

# Clone  repo
git clone https://github.com/ls-da3m0ns/quadkey-boosted

# Create Virtual Environment
python -m venv ./venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Compile 
python setup.py sdist bdist_wheel

# Install 
pip install dist/quadkey-0.0.1-cp38-cp38-linux_x86_64.whl

Usage

Basic Usage

import quadkey
lat = 47.641268
lng = -122.125679
zoom = 15

# Convert lat lng to quadkey
qk = quadkey.geo_to_quadkey(lat, lng, zoom)

# Convert quadkey to lat lng
## get top left corner
lat, lng = quadkey.quadkey_to_geo(qk, corner=0)
## get bottom right corner
lat, lng = quadkey.quadkey_to_geo(qk, corner=2)

# Convert quadkey to bbox
bbox = quadkey.quadkey_to_bbox(qk)

# Convert quadkey to Tile
tl = quadkey.quadkey_to_tile(qk)

# Conver quadkey to quadint
qi = quadkey.quadkey_to_quadint(qk)

# Convert lat lng to quadint
qi = quadkey.geo_to_quadint(lat, lng, zoom)

# get parent quadkey
parent = quadkey.get_parent(qk)

References

I would like to acknowledge the following repositories that served as references during the development of this project:

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

quadkey-boosted-1.0.4.tar.gz (59.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quadkey_boosted-1.0.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (214.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

File details

Details for the file quadkey-boosted-1.0.4.tar.gz.

File metadata

  • Download URL: quadkey-boosted-1.0.4.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for quadkey-boosted-1.0.4.tar.gz
Algorithm Hash digest
SHA256 333b485eb0b58f6199faac7b60bb5f4769853117c451c902afbb4efcfe50c577
MD5 f6c55ee0e70a634ecea9a7c3088b33f7
BLAKE2b-256 0aa262eda2abebc1e865f997d9babb906ba650f7f4bd56dd729a3ebde598c5f1

See more details on using hashes here.

File details

Details for the file quadkey_boosted-1.0.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for quadkey_boosted-1.0.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bcf0557e9dbe5d0ed5552a8cf4ab38bfa564b1314bdfa7fd5aaa960d401edd42
MD5 f837871f724a5477d272d5fde3c32f04
BLAKE2b-256 53a1d0c4ab48eee1a69f6380a177bf98ace507cddb076f83bc1a9a1e2073515c

See more details on using hashes here.

Supported by

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