0.1.1 • Published 2 months ago

quadkey-tilemath v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

quadkey-tilemath

npm version MIT licensed

The quadkey-tilemath provides functions for converting between geographical coordinates and tile coordinates using the Quadkey system. This system represents a hierarchical tiling of the Earth's surface as a quadtree, with each tile being assigned a unique identifier known as a Quadkey.

The quadkey-tilemath implements the TileSystem static class described here as a reference: http://msdn.microsoft.com/en-us/library/bb259689.aspx

Given a (longitude, latitude) and level produce a quadkey to be used in Bing Maps. Can also supply methods to generate a Google Maps TileXYZ

Class diagram

It is a conceptual class diagram for explanation only and differs from the actual implementation. plantuml

Install

$ npm install quadkey-tilemath

or

$ yarn add quadkey-tilemath

Usage

Converts a longitude, latitude to a quadkey.

import { tileMath } from 'quadkey-tilemath'

// Shibuya
const quadkey = tileMath.pointToQuadkey([139.69116, 35.63051], 20)

// 133002112303213
console.log(quadkey)

Converts a quadkey to lng lat point.

import { tileMath } from 'quadkey-tilemath'

const point = tileMath.quadkeyToPoint('13300211230301333312')

// 139.7014617919922, 35.657854158137965
console.log(point)

Demo using map

Here is a demo that actually draws the quadkey on the map using this library.
https://9revolution9.com/tools/geo/geocode/

0.1.0

2 months ago

0.1.1

2 months ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

1.0.7

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago