
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
hilbert-geohash
Advanced tools
This repo is basically interoperable Node.JS port of https://github.com/tammoippen/geohash-hilbert/
Geohash a lng/lat coordinate using hilbert space filling curves.
To install: npm install hilbert-geohash (https://www.npmjs.com/package/hilbert-geohash)
Simple encode/decode:
const { encode, decode } = require("hilbert-geohash");
encode(24, 61) // ZWSQ0WSQ0W
decode("ZWSQ0WSQ0W") // { lng: 24.000000078231096, lat: 60.99999996833503 }
Detailed usage:
const { encode,
decode,
decode_exactly,
hilbert_curve,
neighbours,
rectangle } = require("hilbert-geohash");
// encode(lng, lat, precision = 10, bits_per_char = 6)
encode(24, 61) // ZWSQ0WSQ0W
// decode(lng, lat, bits_per_char = 6)
decode("ZWSQ0WSQ0W") // { lng: 24.000000078231096, lat: 60.99999996833503 }
// decode_exactly(lng, lat, bits_per_char = 6)
decode_exactly("ZWSQ0WSQ0W") // {
// lng: 24.000000078231096,
// lat: 60.99999996833503,
// lng_err: 1.6763806343078613e-7,
// lat_err: 8.381903171539307e-8
// }
// neighbours(geohash, bits_per_char = 6)
neighbours("ZWSQ0WSQ0W"); // {
// 'east': 'ZWSQ0WSQ0X',
// 'west': 'ZWSQ0WSQ0o',
// 'north': 'ZWSQ0WSQ0i',
// 'north-east': 'ZWSQ0WSQ0h',
// 'north-west': 'ZWSQ0WSQ0n',
// 'south': 'ZWSQ0WSQ0V',
// 'south-east': 'ZWSQ0WSQ0Y',
// 'south-west': 'ZWSQ0WSQ0p'
// }
// rectangle(geohash, bits_per_char = 6)
rectangle("ZWSQ0WSQ0W") // {
// "type":"Feature",
// "properties": {
// "code": "ZWSQ0WSQ0W",
// "lng": 24.000000078231096,
// "lat":60.99999996833503,
// "lng_err":1.6763806343078613e-7,
// "lat_err":8.381903171539307e-8,
// "bits_per_char":6
// },
// "bbox": [
// 23.999999910593033,
// 60.999999884516,
// 24.00000024586916,
// 61.000000052154064
// ],
// "geometry": {
// "type": "Polygon",
// "coordinates": [
// [
// [23.999999910593033,60.999999884516],
// [24.00000024586916,60.999999884516],
// [24.00000024586916,61.000000052154064],
// [23.999999910593033,61.000000052154064],
// [23.999999910593033,60.999999884516]
// ]
// ]
// }
// }
// hilbert_curve(precision, bits_per_char = 6)
hilbert_curve(1); // {
// "type":"Feature",
// "properties": {},
// "geometry": {
// "type":"LineString",
// "coordinates": [
// [-157.5,-78.75],
// .
// .
// .
// [157.5,-78.75]
// ]
// }
// }
FAQs
Node.js implementation of Hilbert-curve based geohashing.
The npm package hilbert-geohash receives a total of 216 weekly downloads. As such, hilbert-geohash popularity was classified as not popular.
We found that hilbert-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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.