{"_id":"latlon-geohash","_rev":"10-7db3adb68613b17d23db111bef719f70","name":"latlon-geohash","description":"Gustavo Niemeyer’s geocoding system","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"latlon-geohash","description":"Gustavo Niemeyer’s geocoding system","author":{"name":"Chris Veness"},"version":"1.0.0","license":"MIT","homepage":"http://www.movable-type.co.uk/scripts/geohash.html","repository":{"type":"git","url":"https://github.com/chrisveness/latlon-geohash"},"keywords":["geohash","geocode","geolocation","latitude","longitude"],"scripts":{"test":"tape test.js | tap-spec"},"devDependencies":{"browserify":"^4.0.0","tap-spec":"^0.2.0","tape":"^2.12.0"},"testling":{"files":"test.js","browsers":["iexplore/7..latest","chrome/26..latest","firefox/21..latest","safari/4..latest","opera/11.5..latest","iphone/6..latest","ipad/6..latest","android-browser/4.2..latest"]},"gitHead":"17520862b982d06ea9a882811103cd473d44fa59","bugs":{"url":"https://github.com/chrisveness/latlon-geohash/issues"},"_id":"latlon-geohash@1.0.0","_shasum":"198e4918461be08da2c58b22a7b0b1938cdf0b0b","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"chrisveness","email":"chrisv@movable-type.co.uk"},"maintainers":[{"name":"chrisveness","email":"chrisv@movable-type.co.uk"}],"dist":{"shasum":"198e4918461be08da2c58b22a7b0b1938cdf0b0b","tarball":"https://registry.npmjs.org/latlon-geohash/-/latlon-geohash-1.0.0.tgz","integrity":"sha512-QRCjqKwk7LxTXNHGnZ3vr8eqOjuUJ8Yv8K0aNLf0wN2U4p5xT7Uv5EvGQBryTOVCio5aED7Eq8YC+h9XTMLX/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoJRdO00C26sKcIQFIlV9POdfSTI0evQ1Em0iaTdtPQAiA3uyXrJd5dX/2EMXRQYPpKj0S2mDWhHvL5prlsxU3H+w=="}]},"directories":{}},"1.0.1":{"name":"latlon-geohash","description":"Gustavo Niemeyer’s geocoding system","author":{"name":"Chris Veness"},"version":"1.0.1","license":"MIT","homepage":"http://www.movable-type.co.uk/scripts/geohash.html","main":"latlon-geohash.js","repository":{"type":"git","url":"https://github.com/chrisveness/latlon-geohash"},"keywords":["geohash","geocode","geolocation","latitude","longitude"],"scripts":{"test":"tape test.js | tap-spec"},"devDependencies":{"browserify":"^4.0.0","tap-spec":"^0.2.0","tape":"^2.12.0"},"testling":{"files":"test.js","browsers":["iexplore/7..latest","chrome/26..latest","firefox/21..latest","safari/4..latest","opera/11.5..latest","iphone/6..latest","ipad/6..latest","android-browser/4.2..latest"]},"gitHead":"f7f39fc3c44e9fea8221639acb0b67749efa8af9","bugs":{"url":"https://github.com/chrisveness/latlon-geohash/issues"},"_id":"latlon-geohash@1.0.1","_shasum":"07da62b3f4727c9c848e5c1c5b4d9e333e93c266","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"chrisveness","email":"chrisv@movable-type.co.uk"},"maintainers":[{"name":"chrisveness","email":"chrisv@movable-type.co.uk"}],"dist":{"shasum":"07da62b3f4727c9c848e5c1c5b4d9e333e93c266","tarball":"https://registry.npmjs.org/latlon-geohash/-/latlon-geohash-1.0.1.tgz","integrity":"sha512-LKGafN2lILNsrkaZOi9AjyOW0zUxgq2fGiGRmzmyNdKKgSUuTsdS5Z/t7Zx/M7mCj63YGXsabPfABwxxkxIbaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC+HBAQBZWx05vGM1KSC+mOn7juOhujmHD1yChU7iKPzAiBuLmL6bZHKQ61BAp4qfJZJJ4Zk8idVXMxV+07Dfkhfkg=="}]},"directories":{}},"1.1.0":{"name":"latlon-geohash","description":"Gustavo Niemeyer’s geocoding system","author":{"name":"Chris Veness"},"version":"1.1.0","license":"MIT","homepage":"http://www.movable-type.co.uk/scripts/geohash.html","main":"latlon-geohash.js","repository":{"type":"git","url":"git+https://github.com/chrisveness/latlon-geohash.git"},"keywords":["geohash","geocode","geolocation","latitude","longitude"],"scripts":{"test":"mocha test.js","lint":"eslint latlon-geohash.js"},"devDependencies":{"chai":"^3.5.0","eslint":"^3.5.0","mocha":"^3.0.2"},"eslintConfig":{"env":{"node":true,"mocha":true},"extends":"eslint:recommended","rules":{"array-bracket-spacing":["error","always"],"comma-dangle":["error","always-multiline"],"curly":["error","multi-line"],"indent":["error",4,{"SwitchCase":1}],"key-spacing":["error",{"align":"value"}],"no-console":"warn","no-redeclare":"warn","no-shadow":"warn","no-unused-vars":"warn","object-curly-spacing":["error","always"],"quotes":["error","single","avoid-escape"],"semi":["error","always"],"strict":["error","global"]}},"gitHead":"53c3d4742b580b00e27387631f367ac0a42e0eb0","bugs":{"url":"https://github.com/chrisveness/latlon-geohash/issues"},"_id":"latlon-geohash@1.1.0","_shasum":"7abe15224c4800e3eaecac71c753a20bfb6cbf65","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"chrisveness","email":"chrisv@movable-type.co.uk"},"dist":{"shasum":"7abe15224c4800e3eaecac71c753a20bfb6cbf65","tarball":"https://registry.npmjs.org/latlon-geohash/-/latlon-geohash-1.1.0.tgz","integrity":"sha512-K1zIBU1Wtdw0Uam+Jvu4eC7mq+XBeZ/cTVGRczfE8Wbhb0pZ7+m+gbrlu0sN2i4MkHMxRu/jBc3XKo4wMXxIlg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD45382jKPPOZAjG1YdddIGoFxQOB66TdiQiiDtCeGzYAIhAPyu8DciQcbtejGOnmq7MVKh44TGeU5Sv30OlnoLTEw0"}]},"maintainers":[{"name":"chrisveness","email":"chrisv@movable-type.co.uk"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/latlon-geohash-1.1.0.tgz_1473788461646_0.20212847157381475"},"directories":{}},"2.0.0":{"name":"latlon-geohash","description":"Gustavo Niemeyer’s geocoding system","homepage":"http://www.movable-type.co.uk/scripts/geohash.html","author":{"name":"Chris Veness"},"version":"2.0.0","license":"MIT","type":"module","main":"latlon-geohash.js","repository":{"type":"git","url":"git+https://github.com/chrisveness/latlon-geohash.git"},"keywords":["geohash","geocode","geolocation","latitude","longitude"],"scripts":{"test":"mocha --exit -r esm test.js","lint":"eslint latlon-geohash.js"},"devDependencies":{"chai":"^4.0.0","eslint":"^6.0.0","esm":"^3.0.0","mocha":"^6.0.0"},"eslintConfig":{"env":{"browser":true,"es6":true,"mocha":true,"node":true},"parserOptions":{"ecmaVersion":6,"sourceType":"module"},"extends":"eslint:recommended","rules":{"array-bracket-spacing":["error","always"],"comma-dangle":["error","always-multiline"],"comma-spacing":["error"],"curly":["error","multi-line"],"indent":["error",4,{"SwitchCase":1}],"key-spacing":["error",{"align":"value"}],"keyword-spacing":["error"],"no-case-declarations":"warn","no-console":["warn",{"allow":["error","info"]}],"no-irregular-whitespace":"warn","no-redeclare":"warn","no-shadow":"warn","no-unused-vars":"warn","no-var":"error","object-curly-spacing":["error","always"],"prefer-const":"error","quotes":["error","single","avoid-escape"],"semi":["error","always"],"space-before-blocks":["error","always"],"space-in-parens":["error"],"strict":["error","global"]}},"_resolved":"","_integrity":"","_from":"git://github.com/chrisveness/latlon-geohash.git","bugs":{"url":"https://github.com/chrisveness/latlon-geohash/issues"},"_id":"latlon-geohash@2.0.0","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-OKBswTwrvTdtenV+9C9euBmvgGuqyjJNAzpQCarRz1m8/pYD2nz9fKkXmLs2S3jeXaLi3Ry76twQplKKUlgS/g==","shasum":"2b0203ab30ef56a18600b0312b8c3a627cbd17d1","tarball":"https://registry.npmjs.org/latlon-geohash/-/latlon-geohash-2.0.0.tgz","fileCount":5,"unpackedSize":15705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIxQ5CRA9TVsSAnZWagAAQ/IP/3VYlaKkZK+ISf/oYFL2\nUnVxaQLn8oBGRg+s4Z/M8X49aSn6UxpV7ujvoOqph6D/a7GhxIYeESX6gKW2\nVm46dXmxZFuSWC6tNYM0J0FI2otib0M/nGbUzE4qQcZn4DDVkiFeb0ggD1Dj\nRaqeYyrJyeXL8Y5YNvEjlpYwlIenwC5A0LK7thN+MYM4c3q2/q98PFHAG4G5\n3efGBAnoqfTIk0sI7fCmTHTD52rJBzVZc8xA/X2hf/w91g90OCSNmAF7OcXV\nmqtGbQsmQOcy0flsoHBlKJ8NsSiWpyv/3dz50URaYWWXoFu5Ic9ROOA99RFC\n2e3RDBPvRT7st+h6pK7qgfN0AoTUIDMOIgH15M9lcmpXEycqSVBSeweOPQPt\nbnZWByX1r0HzSVJVS+8Kc8E2BoQOfj1nmnzaBgUjULepeomInn6iRdAPWefV\nq559IR64i2aRt7KzS8gDQp/KXcAiuFh2zWKXDss2v/r3obX8AsfLflsd6Xav\nUemor2nUWPwsXG25zNx1krUVfLBLiQ02OD1e9Oaes/HQA3dH8tL2doi1Gb0f\nISwSmwrtEiVAelkZACNrkokhV9FApNqk8/M/es/OZ+Ag9MUX1T6luAr49LFT\nrWYhgFs2fD9fSTYLh4TzAXu3GJW7/k9wps2mmg20Vsqom+tsxeYlCarL3oqf\nmbLO\r\n=JgK7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFIUs6nlgOFgxUMEAjUBfKLHUFPFptt5QRICuRKwG3cfAiAysnLmtMnJQWZDWTtcw7aaC8TroPr/lIfWjPzETnJSoQ=="}]},"maintainers":[{"name":"chrisveness","email":"chrisv@movable-type.co.uk"}],"_npmUser":{"name":"chrisveness","email":"chrisv@movable-type.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/latlon-geohash_2.0.0_1562580024943_0.06118386404252507"},"_hasShrinkwrap":false}},"readme":"geohash\n=======\n\nFunctions to convert a [geohash](http://en.wikipedia.org/wiki/Geohash) to/from a latitude/longitude\npoint, and to determine bounds of a geohash cell and find neighbours of a geohash.\n\nNote this version 2 uses ES classes and modules: for older browsers (or Node.js <8.0.0), \n[v1.1.0](https://github.com/chrisveness/latlon-geohash/tree/v1.1.0) is ES5-based.\n\nAPI\n---\n\n- `Geohash.encode(lat, lon, [precision])`: encode latitude/longitude point to geohash of given precision\n   (number of characters in resulting geohash); if precision is not specified, it is inferred from\n   precision of latitude/longitude values.\n- `Geohash.decode(geohash)`: return { lat, lon } of centre of given geohash, to appropriate precision.\n- `Geohash.bounds(geohash)`: return { sw, ne } bounds of given geohash.\n- `Geohash.adjacent(geohash, direction)`: return adjacent cell to given geohash in specified direction (N/S/E/W).\n- `Geohash.neighbours(geohash)`: return all 8 adjacent cells (n/ne/e/se/s/sw/w/nw) to given geohash.\n\nNote to obtain neighbours as an array, you can use\n\n    const neighboursObj = Geohash.neighbours(geohash);\n    const neighboursArr = Object.keys(neighboursObj).map(n => neighboursObj[n]);\n\nThe parent of a geocode is simply `geocode.slice(0, -1)`.\n\nIf you want the geohash converted from Base32 to Base4, you can e.g.:\n\n    parseInt(Geohash.encode(52.20, 0.12, 6), 32).toString(4);\n\n\nUsage in browser\n----------------\n\nGeohash can be used in the browser by taking a local copy, or loading it from\n    [jsDelivr](https://www.jsdelivr.com/package/npm/latlon-geohash): for example,\n\n```html\n<!doctype html><title>geohash example</title><meta charset=\"utf-8\">\n<script type=\"module\">\n    import Geohash from 'https://cdn.jsdelivr.net/npm/latlon-geohash@2.0.0';\n\n    const geohash = Geohash.encode(52.20, 0.12, 6);\n    console.assert(geohash == 'u120fw');\n\n    const latlon = Geohash.decode('u120fw');\n    console.assert(JSON.stringify(latlon) == '{\"lat\":52.1988,\"lon\":0.115}');\n</script>\n```\n\n\nUsage in Node.js\n----------------\n\nGeohash can be used in a Node.js app from [npm](https://www.npmjs.com/package/latlon-geohash) \n(currently the [esm](https://www.npmjs.com/package/esm) package is required to load ES-modules):\n\n```shell\n$ npm install latlon-geohash esm\n$ node -r esm\n> import Geohash from 'latlon-geohash';\n> const geohash = Geohash.encode(52.20, 0.12, 6);\n> console.assert(geohash == 'u120fw');\n> const latlon = Geohash.decode('u120fw');\n> console.assert(JSON.stringify(latlon) == '{\"lat\":52.1988,\"lon\":0.115}');\n```\n\nFurther details\n---------------\n\nMore information (with interactive conversion) at\n[www.movable-type.co.uk/scripts/geohash.html](http://www.movable-type.co.uk/scripts/geohash.html).\n\nFull JsDoc at [www.movable-type.co.uk/scripts/js/latlon-geohash/docs/Geohash.html](http://www.movable-type.co.uk/scripts/js/latlon-geohash/docs/Geohash.html).\n","maintainers":[{"name":"chrisveness","email":"chrisv@movable-type.co.uk"}],"time":{"modified":"2022-06-19T10:49:01.521Z","created":"2014-11-15T17:04:06.690Z","1.0.0":"2014-11-15T17:04:06.690Z","1.0.1":"2015-01-14T10:38:46.027Z","1.1.0":"2016-09-13T17:41:03.739Z","2.0.0":"2019-07-08T10:00:25.140Z"},"homepage":"http://www.movable-type.co.uk/scripts/geohash.html","keywords":["geohash","geocode","geolocation","latitude","longitude"],"repository":{"type":"git","url":"git+https://github.com/chrisveness/latlon-geohash.git"},"author":{"name":"Chris Veness"},"bugs":{"url":"https://github.com/chrisveness/latlon-geohash/issues"},"license":"MIT","readmeFilename":"README.md","users":{"gggauravgandhi":true}}