1.3.1 • Published 6 years ago

@alexpavlov/geohash-js v1.3.1

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

GeoHash

NPM Version Build status Coverage status Dependency Status devDependency Status GitHub license

Geohash is a public domain geocoding system invented by Gustavo Niemeyer, which encodes a geographic location into a short string of letters and digits. It is a hierarchical spatial data structure which subdivides space into buckets of grid shape, which is one of the many applications of what is known as a Z-order curve, and generally space-filling curves.

Geohashes offer properties like arbitrary precision and the possibility of gradually removing characters from the end of the code to reduce its size (and gradually lose precision). As a consequence of the gradual precision degradation, nearby places will often (but not always) present similar prefixes. The longer a shared prefix is, the closer the two places are.

Read more on Wikipedia.

Usage

Standalone version

Include geohash.min.js which you can find in the build folder.

<script src="dist/geohash-js/geohash.min.js"></script>

Now you can use library

var hashedValue = geohash.encode(52.372518, 4.896977);

Usage as module

Installation

With npm

$ npm install @alexpavlov/geohash-js

or with yarn

$ yarn add @alexpavlov/geohash-js

Add to your module

CommonJS

var encode = require('@alexpavlov/geohash-js').encode;

var hashedValue = encode(52.372518, 4.896977);

ES2015

import { encode } from '@alexpavlov/geohash-js';

let hashedValue = encode(52.372518, 4.896977);

License

MIT

1.3.1

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1-fix

6 years ago

1.1.1

6 years ago

1.0.0

6 years ago