geohash-compression

1.0.0 • Public • Published

geohash-compression

Compressing string array of geohash

Example

const fs = require('fs');
const compressGeohashes = require('geohash-compression');

const hashes = JSON.parse(fs.readFileSync('./data.json'));

const compressedHashes = compressGeohashes(hashes);
console.log(`Uncompressed length: ${hashes.length}`);
console.log(`Compressed length: ${compressedHashes.length}`);

Result

Uncompressed length: 26953
Compressed length: 2339

data.json

["ezpgwfut","ezpgwfuv","ezpgwfvj","ezpgwfvm","ezpgwfvt","ezpgwfvv","ezpgwfyj","ezpgwfgh","ezpgwfgk","ezpgwfgs","ezpgwfgu","ezpgwfuh","ezpgwfuk","ezpgwfus","ezpgwfuu","ezpgwfvh","ezpgwfvk","ezpgwfvs","ezpgwfvu","ezpgwfyh","ezpgwfyk","ezpgwfys","ezpgwffg",...,"ezpgquns","ezpgqunu","ezpgquph","ezpgqupk","ezpgqups","ezpgqupu","ezpgqup7"]

Readme

Keywords

Package Sidebar

Install

npm i geohash-compression

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

4.59 kB

Total Files

4

Last publish

Collaborators

  • ponlawat_w