
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
angular-geohash
Advanced tools
Geohash library for angularjs based on node-geohash.
yarn add angular-geohash
angular.module('MyApp', ["angular-geohash"]).controller("MyController", ['geohash', function(geohash){
geohash.encode(lat,lng);
...
}]);
Encode a pair of latitude and longitude values into a geohash. The third argument is optional, you can specify a length of this hash string, which also affects the precision of the geohash.
Decode a hash string into pair of latitude and longitude values. A javascript object is returned with latitude and longitude keys.
Decode hashstring into a bounding box that matches it. Data is returned as a four-element array: [minlat, minlon, maxlat, maxlon].
Get all hashstringes between [minlat, minlon] and [maxlat, maxlon]. These keys can be used to find a poi stored in the cache with hashstring keys. eg. show all points in the visible range of map
Find the neighbor of a geohash string in certain direction. Direction is a two-element array, i.e. [1,0] means north, [-1,-1] means southwest.
Find all 8 geohash neighbors [n, ne, e, se, s, sw, w, nw] of a geohash string. This method is more efficient than running the geohash.neighbor method multiple times for all directions. array: [hashstr1, hashstr2, ... ]
Note that integer precision is capped at 52bits in Javscript. These are just regular javascript floating point numbers, but the functionality should mimic other uint64 geohash functions in geohash libraries for other languages and are compatible with the geohash integers produced by them, however any geohash integer encoded in anything more than 52bits will be resolved to 52bits resolution.
Encode a pair of latitude and longitude values into a geohash integer. The third argument is optional, you can specify the bitDepth of this number, which affects the precision of the geohash but also must be used consistently when decoding. Bit depth must be even.
Decode a integer geohashed number into pair of latitude and longitude value approximations. A javascript object is returned with latitude and longitude keys. You should also provide the bitDepth at which to decode the number (ie. what bitDepth the number was originally produced with), but will default to 52.
Decode an integer geohash into the bounding box that matches it. Data is returned as a four-element array: [minlat, minlon, maxlat, maxlon].
Get all geohash integers between [minlat, minlon] and [maxlat, maxlon]. These keys can be used to find a poi stored in the cache with geohash integer keys. eg. show all points in the visible range of map
Find the neighbor of a geohash integer in certain direction. Direction is a two-element array, i.e. [1,0] means north, [-1,-1] means southwest. The bitDepth should be specified, but defaults to 52 bits.
Find all 8 neighbors [n, ne, e, se, s, sw, w, nw] of a geohash integer. This method is more efficient than running the geohash.neighbor method multiple times for all directions. The bitDepth should be specified, but defaults to 52 bits.
Check Wikipedia for more information.
angular-geohash is open sourced under MIT License, of course.
FAQs
geohash library for angularjs
The npm package angular-geohash receives a total of 128 weekly downloads. As such, angular-geohash popularity was classified as not popular.
We found that angular-geohash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.