geo-quadkey-rs

License crates.io

geo-quadkey-rs is a Rust library for encoding and decoding geographical coordinates to and from QuadKeys, a tiling approach used by Microsoft’s Bing Maps Tile System for interactive mapping solutions.

Bing Maps Tile System

*Source: Microsoft Bing Maps Tile System

I referenced this repository made in Ruby was very helpful in creating this library: deg84/quadkey

Usage

Include geo-quadkey-rs in your Cargo.toml:

[dependencies]
geo-quadkey-rs = "0.1.0"

Then include it in your code:

extern crate geo_quadkey_rs;

use geo_quadkey_rs::Quadkey;

// Encode coordinates to a quadkey
let quadkey = Quadkey::encode(47.60357, -122.32945, 23);

// Decode a quadkey to coordinates
let (latitude, longitude, precision) = Quadkey::decode("12022001101101100101102");

// Find neighbors of a quadkey
let neighbors = Quadkey::neighbors("12022001101101100101102");

Functions

The Quadkey struct provides the following methods:

License

This project is licensed under the MIT License - see the LICENSE file for details.