{"_id":"sphericalmercator","_rev":"408170","name":"sphericalmercator","description":"Transformations between the Web Mercator projection and Latitude Longitude coordinates","dist-tags":{"latest":"1.0.5"},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"time":{"modified":"2021-08-04T04:57:28.000Z","created":"2011-06-24T13:56:26.156Z","1.0.5":"2016-04-12T00:07:29.167Z","1.0.4":"2015-09-25T18:59:58.627Z","1.0.3":"2014-12-13T17:59:35.520Z","1.0.2":"2012-07-31T18:03:38.518Z","1.0.1":"2011-08-03T14:21:50.815Z","1.0.0":"2011-06-24T13:56:26.156Z"},"users":{"fgribreau":true,"whitelynx":true,"gggauravgandhi":true},"author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"repository":{"type":"git","url":"git://github.com/mapbox/node-sphericalmercator.git"},"versions":{"1.0.5":{"name":"sphericalmercator","description":"Transformations between the Web Mercator projection and Latitude Longitude coordinates","version":"1.0.5","licenses":[{"type":"BSD"}],"keywords":["map","projection","transformations"],"url":"http://github.com/mapbox/node-sphericalmercator","repository":{"type":"git","url":"git://github.com/mapbox/node-sphericalmercator.git"},"author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","devDependencies":{"tape":"3.0.x","eslint":"~1.00.0","eslint-config-unstyled":"^1.1.0"},"scripts":{"test":"eslint sphericalmercator.js && tape test/*.test.js"},"bin":{"bbox":"bin/bbox.js","xyz":"bin/xyz.js","to900913":"bin/to900913.js","to4326":"bin/to4326.js"},"gitHead":"d12490a49447dff1ca3dd964ad14cf720126de30","bugs":{"url":"https://github.com/mapbox/node-sphericalmercator/issues"},"homepage":"https://github.com/mapbox/node-sphericalmercator#readme","_id":"sphericalmercator@1.0.5","_shasum":"ddc5a049e360e000d0fad9fc22c4071882584980","_from":".","_npmVersion":"2.15.3","_nodeVersion":"0.10.41","_npmUser":{"name":"jrpruit1","email":"jake@jakepruitt.com"},"dist":{"shasum":"ddc5a049e360e000d0fad9fc22c4071882584980","size":5334,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/sphericalmercator/download/sphericalmercator-1.0.5.tgz"},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sphericalmercator-1.0.5.tgz_1460419646547_0.1784869208931923"},"directories":{},"publish_time":1460419649167,"_cnpm_publish_time":1460419649167,"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","_hasShrinkwrap":false},"1.0.4":{"name":"sphericalmercator","description":"Transformations between the Web Mercator projection and Latitude Longitude coordinates","version":"1.0.4","licenses":[{"type":"BSD"}],"keywords":["map","projection","transformations"],"url":"http://github.com/mapbox/node-sphericalmercator","repository":{"type":"git","url":"git://github.com/mapbox/node-sphericalmercator.git"},"author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","devDependencies":{"tape":"3.0.x"},"scripts":{"test":"tape test/*.test.js"},"bin":{"bbox":"bin/bbox.js","xyz":"bin/xyz.js","to900913":"bin/to900913.js","to4326":"bin/to4326.js"},"gitHead":"0afd3b5ab962216915126a0e3f7efaafb36b259b","bugs":{"url":"https://github.com/mapbox/node-sphericalmercator/issues"},"homepage":"https://github.com/mapbox/node-sphericalmercator","_id":"sphericalmercator@1.0.4","_shasum":"baad4e34187f06e87f2e92fc1280199fa1b01d4e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"yhahn","email":"young@mapbox.com"},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"dist":{"shasum":"baad4e34187f06e87f2e92fc1280199fa1b01d4e","size":5087,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/sphericalmercator/download/sphericalmercator-1.0.4.tgz"},"directories":{},"publish_time":1443207598627,"_cnpm_publish_time":1443207598627,"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","_hasShrinkwrap":false},"1.0.3":{"name":"sphericalmercator","description":"Transformations between the Web Mercator projection and Latitude Longitude coordinates","version":"1.0.3","licenses":[{"type":"BSD"}],"keywords":["map","projection","transformations"],"url":"http://github.com/mapbox/node-sphericalmercator","repository":{"type":"git","url":"git://github.com/mapbox/node-sphericalmercator.git"},"author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","devDependencies":{"mocha":"1.x"},"scripts":{"test":"mocha"},"bin":{"bbox":"bin/bbox.js","xyz":"bin/xyz.js","to900913":"bin/to900913.js","to4326":"bin/to4326.js"},"gitHead":"57b7213a5105ace7f02d4487bc68e2213ddc2b0f","bugs":{"url":"https://github.com/mapbox/node-sphericalmercator/issues"},"homepage":"https://github.com/mapbox/node-sphericalmercator","_id":"sphericalmercator@1.0.3","_shasum":"25af12c5a20ef05825c3ac81dfff2b7331c4c487","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"aaronlidman","email":"aaronlidman@gmail.com"},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"dist":{"shasum":"25af12c5a20ef05825c3ac81dfff2b7331c4c487","size":4728,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/sphericalmercator/download/sphericalmercator-1.0.3.tgz"},"directories":{},"publish_time":1418493575520,"_cnpm_publish_time":1418493575520,"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","_hasShrinkwrap":false},"1.0.2":{"name":"sphericalmercator","description":"Transformations between the Web Mercator projection and Latitude Longitude coordinates","version":"1.0.2","licenses":[{"type":"BSD"}],"keywords":["map","projection","transformations"],"url":"http://github.com/mapbox/node-sphericalmercator","repository":{"type":"git","url":"git://github.com/mapbox/node-sphericalmercator.git"},"author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","devDependencies":{},"scripts":{"pretest":"npm install mocha","test":"mocha"},"_npmUser":{"name":"springmeyer","email":"dane@dbsgeo.com"},"_id":"sphericalmercator@1.0.2","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"ab363d077214b9b253c68cd4070bb8e848b4a24c","size":3830,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/sphericalmercator/download/sphericalmercator-1.0.2.tgz"},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"directories":{},"publish_time":1343757818518,"_cnpm_publish_time":1343757818518,"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","_hasShrinkwrap":false},"1.0.1":{"name":"sphericalmercator","version":"1.0.1","author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","_npmJsonOpts":{"file":"/Users/kkaefer/.npm/sphericalmercator/1.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sphericalmercator@1.0.1","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"eac48702906fee8dbbf82b7e7b1d67a9f7b242f7","size":3360,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sphericalmercator/download/sphericalmercator-1.0.1.tgz"},"scripts":{},"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"directories":{},"publish_time":1312381310815,"_cnpm_publish_time":1312381310815,"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","_hasShrinkwrap":false},"1.0.0":{"name":"sphericalmercator","version":"1.0.0","author":{"name":"MapBox","email":"info@mapbox.com","url":"http://mapbox.com/"},"main":"./sphericalmercator","_npmJsonOpts":{"file":"/Users/kkaefer/.npm/sphericalmercator/1.0.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sphericalmercator@1.0.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"67ba8489b4873c3b8171f0ea0d35abf905c939a5","size":3256,"noattachment":false,"key":"/sphericalmercator/-/sphericalmercator-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sphericalmercator/download/sphericalmercator-1.0.0.tgz"},"scripts":{},"directories":{},"publish_time":1308923786156,"maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"_cnpm_publish_time":1308923786156,"deprecated":"This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead","_hasShrinkwrap":false}},"readme":"[![Build Status](https://secure.travis-ci.org/mapbox/node-sphericalmercator.svg?branch=master)](http://travis-ci.org/mapbox/node-sphericalmercator)\n\n`node-sphericalmercator` provides projection math for converting between\nmercator meters, screen pixels (of 256x256 or configurable-size tiles), and\nlatitude/longitude.\n\nCompatible with nodejs packages and in-browser.\n\n## Installation\n\n`npm install sphericalmercator`\n\n## API\n\nSome datatypes are assumed to be arrays: `ll` is `[lon, lat]`, `xy` and `px` are\n`[x, y]`.\n\n```javascript\n// By default, precomputes up to z30\nvar merc = new SphericalMercator({\n    size: 256\n});\n```\n\n### `px(ll, zoom)`\n\nConvert lon, lat to screen pixel x, y from 0, 0 origin, at a certain zoom level.\nThe inverse of `ll`\n\n### `ll(px, zoom)`\n\nConvert screen pixel value to lon, lat, at a certain zoom level. The inverse\nof `px`\n\n### `bbox(x, y, zoom, tms_style, srs)`\n\nConvert tile xyz value to bbox of the form `[w, s, e, n]`\n\n* `x` {Number} x (longitude) number.\n* `y` {Number} y (latitude) number.\n* `zoom` {Number} zoom.\n* `tms_style` {Boolean} whether to compute using tms-style. (optional, default false)\n* `srs` {String} projection for resulting bbox (WGS84|900913). (optional, default WGS84)\n\nReturns bbox array of values in form `[w, s, e, n]`.\n\n### `xyz(bbox, zoom, tms_style, srs)`\n\nConvert bbox to xyz bounds\n\n* `bbox` {Number} bbox in the form `[w, s, e, n]`.\n* `zoom` {Number} zoom.\n* `tms_style` {Boolean} whether to compute using tms-style. (optional, default false)\n* `srs` {String} projection of input bbox (WGS84|900913). (optional, default WGS84)\n\nReturns {Object} XYZ bounds containing minX, maxX, minY, maxY properties.\n\n### `convert(bbox, to)`\n\nConvert bbox from 900913 to WGS84 or vice versa\n\n* `bbox` {Number} bbox in the form `[w, s, e, n]`.\n* `to` {String} projection of resulting bbox (WGS84|900913). (optional, default WGS84)\n\nReturns bbox array of values in form `[w, s, e, n]`.\n\n### `forward(ll)`\n\nConvert lon, lat values to mercator x, y\n\n### `inverse(xy)`\n\nConvert mercator x, y values to lon, lat\n\n## See Also\n\n* [mercantile](https://github.com/sgillies/mercantile) provides similar utilities for projection and tile math in Python\n","_attachments":{},"homepage":"https://github.com/mapbox/node-sphericalmercator#readme","bugs":{"url":"https://github.com/mapbox/node-sphericalmercator/issues"}}