# tilebelt

> simple tile utilities

Latest version **1.0.1** (published 2015-09-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tilebelt
pnpm add tilebelt
yarn add tilebelt
bun add tilebelt
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-09-02 |
| First published | 2014-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/tilebelt) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 288 |
| Author | morganherlocker |
| Maintainers | morganherlocker, ajashton, lxbarth, mikemorris, ianshward, mourner, tristen, ingalls, ansis, jfirebaugh, miccolis, gretacb, aaronlidman, camilleanne, rclark, mapbox, willwhite, springmeyer, kkaefer, dthompson, yhahn, tmcw |
| Keywords | tile, map, geojson |

## Links

- npm: https://www.npmjs.com/package/tilebelt
- Repository: https://github.com/mapbox/tilebelt
- Issues: https://github.com/mapbox/tilebelt/issues
- npm.io page: https://npm.io/package/tilebelt

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-09-02
- 1.0.0 — 2015-09-02
- 0.7.1 — 2015-03-13
- 0.7.0 — 2014-11-26
- 0.6.1 — 2014-11-14
- 0.6.0 — 2014-10-27
- 0.5.3 — 2014-10-07
- 0.5.2 — 2014-09-17
- 0.5.1 — 2014-08-30
- 0.5.0 — 2014-08-29
- 0.4.0 — 2014-08-28
- 0.3.0 — 2014-08-28
- 0.2.0 — 2014-08-18
- 0.1.1 — 2014-08-14
- 0.1.0 — 2014-08-14

## README

tilebelt
====
[![Build Status](https://travis-ci.org/mapbox/tilebelt.svg?branch=master)](https://travis-ci.org/mapbox/tilebelt) [![Coverage Status](https://coveralls.io/repos/mapbox/tilebelt/badge.svg?branch=use-tap)](https://coveralls.io/r/mapbox/tilebelt?branch=use-tap)

simple [tile](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) utilities

## install

```bash
npm install tilebelt
```

## usage

```js
var tilebelt = require('tilebelt');

var tile = [10,15,8] // x,y,z

console.log(tilebelt.tileToGeoJSON(tile));
console.log(tilebelt.getParent(tile));
```

## features

function | description
---|---
tileToGeoJSON(tile) | get a geojson representation of a tile
tileToBBOX(tile) | get the bbox of a tile
bboxToTile(bbox) | get the smallest tile to cover a bbox
getChildren(tile) | get the 4 tiles one zoom level higher
getParent(tile) | get the tile one zoom level lower
getSiblings(tile) | get the 3 sibling tiles for a tile
hasSiblings(tiles, tile) | check to see if an array of tiles contains a tiles siblings
hasTile(tiles, tile) | check to see if an array of tiles contains a particular tile
tilesEqual(tile1, tile2) | check to see if two tiles are the same
tileToQuadkey(tile) | get the quadkey for a tile
quadkeyToTile(quadkey) | get the tile for a quadkey
pointToTile(lon, lat, zoom) | get the tile for a point at a specified zoom level
pointToTileFraction(lon, lat, zoom) | get the precise fractional tile location for a point at a zoom level

## tests

```bash
npm test
```

## benchmarks

```bash
npm run bench
```

---
_Source: https://npm.io/package/tilebelt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
