{"name":"@mapbox/tilebelt","version":"2.0.3","description":"simple tile utilities","type":"module","exports":{".":{"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}}},"scripts":{"test":"vitest --config ./vitest.config.ts --coverage run","bench":"tsx test/bench.ts","format":"prettier src test --write --single-quote","clean":"rm -rf ./dist","prepublishOnly":"npm run build","build-cjs":"tsc -p . --module commonjs --outDir ./dist/cjs && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json","build-esm":"tsc -p . --module nodenext --outDir ./dist/esm && echo '{\"type\": \"module\"}' > ./dist/esm/package.json","build":"npm run clean && npm run build-cjs && npm run build-esm"},"repository":{"type":"git","url":"git+https://github.com/mapbox/tilebelt.git"},"keywords":["tile","map","geojson"],"author":{"name":"morganherlocker"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/tilebelt/issues"},"homepage":"https://github.com/mapbox/tilebelt","devDependencies":{"@types/geojson":"^7946.0.14","@vitest/coverage-v8":"^2.1.2","benchmarkify":"^4.0.0","prettier":"^3.3.3","tsx":"^4.19.2","typescript":"^5.6.2","vitest":"^2.1.1"},"_id":"@mapbox/tilebelt@2.0.3","gitHead":"a6aaec0fe8a8c70dccc3f5435986ecba80f448b0","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-HSscGw2yBlcm0GdLI3S5i8Xw/ffP2fTT2qmRbR1/AkJ02PnNN52yY+zzfw705LKKjesy8jJ/H1dieuioqN0Slw==","shasum":"08cab26d5a77e923f193fafee14cdc7c3d76fa84","tarball":"http://registry-npm.ywwl.com/@mapbox/tilebelt/download/@mapbox/tilebelt-2.0.3.tgz","fileCount":9,"unpackedSize":52186,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD1+TIHlY04FbBmk64FA7vTzzQRcZKZ3D3YOmeje1lwxQIgPYBGuQMYV1lisInenocInWjSamABsABcupdB0iWrd+o="}],"size":11411,"noattachment":false,"key":"/@mapbox/tilebelt/-/@mapbox/tilebelt-2.0.3.tgz"},"_npmUser":{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},"directories":{},"maintainers":[{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tilebelt_2.0.3_1764946502880_0.4913309374707284"},"_hasShrinkwrap":false,"readme":"# tilebelt\n\n[![Run tests](https://github.com/mapbox/tilebelt/actions/workflows/test.yml/badge.svg)](https://github.com/mapbox/tilebelt/actions/workflows/test.yml)\n\nsimple [tile](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) utilities\n\n## install\n\n```bash\nnpm install @mapbox/tilebelt\n```\n\n## usage\n\n```js\nimport * as tilebelt from '@mapbox/tilebelt';\n\nconst tile = [10, 15, 8] // x,y,z\n\ntilebelt.tileToGeoJSON(tile);\n// {\n//   \"type\": \"Polygon\",\n//   \"coordinates\": [\n//     [\n//       [ -165.9375, 82.8533822917608 ],\n//       [ -165.9375, 82.67628497834903 ],\n//       [ -164.53125, 82.67628497834903 ],\n//       [ -164.53125, 82.8533822917608 ],\n//       [ -165.9375, 82.8533822917608 ]\n//     ]\n//   ]\n// }\n\ntilebelt.getParent(tile);\n// [ 5, 7, 7 ]\n```\n\n## features\n\nfunction | description\n---|---\n`tileToGeoJSON(tile)` | get a geojson representation of a tile\n`tileToBBOX(tile)` | get the bbox of a tile\n`bboxToTile(bbox)` | get the smallest tile to cover a bbox\n`getChildren(tile)` | get the 4 tiles one zoom level higher\n`getParent(tile)` | get the tile one zoom level lower\n`getSiblings(tile)` | get the 4 sibling tiles for a tile\n`hasSiblings(tiles, tile)` | check to see if an array of tiles contains a tiles siblings\n`hasTile(tiles, tile)` | check to see if an array of tiles contains a particular tile\n`tilesEqual(tile1, tile2)` | check to see if two tiles are the same\n`tileToQuadkey(tile)` | get the quadkey for a tile\n`quadkeyToTile(quadkey)` | get the tile for a quadkey\n`pointToTile(lon, lat, zoom)` | get the tile for a point at a specified zoom level\n`pointToTileFraction(lon, lat, zoom)` | get the precise fractional tile location for a point at a zoom level\n\n## developing\n\n```sh\nnpm ci          # install deps\nnpm test        # tests\nnpm run bench   # run benchmarks\nnpm run format  # format using prettier\n```\n","publish_time":1764946503046,"_cnpm_publish_time":1764946503046,"dist-tags":{"dev":"2.0.0-dev.1","latest":"2.0.3"}}