1.0.0 • Published 4 years ago
geohash-compress1 v1.0.0
geohash - compress
=======
A data compression and Geo-hasing library for large sized Geo-polygons. It solves the problem when standard point-in-polygon query takes too much time and conversion of Geo-polygon into Geohashes for constant time point-in-polygon query, takes large space in memory. This library provides a memory effiecent soltution for constant time point-in-polygon query by converting the hashes to lowest possible order.
Usage in Node.jsmple
const geoHashCompress = require('geoHashCompress');
const polygon = await new geoHashCompress([reverse2DArray(geoFenceIndore)],7);
let hashes = polygon.compress()); // returns a map with geohash as key
console.log(polygon.insideOrOutside(22.7418224,75.8814993)) // returns true if a point is inside the polygon.
const geojson = polygon.toGeoJson(); // returns compressed geometry as Geojson.
1.0.0
4 years ago