New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/tilebelt

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/tilebelt

simple tile utilities

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

tilebelt

Run tests

simple tile utilities

install

npm install @mapbox/tilebelt

usage

import * as tilebelt from '@mapbox/tilebelt';

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

tilebelt.tileToGeoJSON(tile);
// {
//   "type": "Polygon",
//   "coordinates": [
//     [
//       [ -165.9375, 82.8533822917608 ],
//       [ -165.9375, 82.67628497834903 ],
//       [ -164.53125, 82.67628497834903 ],
//       [ -164.53125, 82.8533822917608 ],
//       [ -165.9375, 82.8533822917608 ]
//     ]
//   ]
// }

tilebelt.getParent(tile);
// [ 5, 7, 7 ]

features

functiondescription
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 4 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

developing

npm ci          # install deps
npm test        # tests
npm run bench   # run benchmarks
npm run format  # format using prettier

Keywords

FAQs

Package last updated on 19 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc