PHPackages                             saikiran/geohash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. saikiran/geohash

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

saikiran/geohash
================

Geohash Algorithm to encode geographic coordinates to a string of letters and digits

v1.0.1(5y ago)44456.6k—1.1%14[1 issues](https://github.com/skthon/geohash/issues)3MITPHPPHP &gt;=7.0.0

Since Dec 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/skthon/geohash)[ Packagist](https://packagist.org/packages/saikiran/geohash)[ Docs](https://github.com/skthon/geohash)[ RSS](/packages/saikiran-geohash/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (3)

Geohash
-------

[](#geohash)

Geohash is a php module that provides below functions.

- Encoding geographic location into short string of letters and digits.
- Decoding string of letters and digits to latitude and longitude.
- Identifying the neighbouring geohashes of a provided geohash.

Installation
------------

[](#installation)

The easiest way to install PHP Geohash is with [composer](https://getcomposer.org). Find it on [Packagist](https://packagist.org/packages/saikiran/geohash).

```
$ composer require saikiran/geohash

```

Usage
-----

[](#usage)

Encode co-ordinates

```
use Sk\Geohash\Geohash;

$g = new Geohash();
echo $g->encode(17.38000000, 78.42000000, 5);

```

The result is

```
tepfb

```

Decode geohash into geographical coordinates

```
use Sk\Geohash\Geohash;

$g = new Geohash();
$coordinates = $g->decode("tepfb", 5);
echo "latitude : " . $coordinates[0] . ",  longitude : " . $coordinates[1];

```

The result is

```
latitude : 17.38,  longitude : 78.42

```

Get geohashes of 8 neighbors of a geohash

```
use Sk\Geohash\Geohash;

$g = new Geohash();
$hash = $g->encode(25.813646, -80.133761, 7);
$neighbors = $g->getNeighbors($hash);
echo "Hash: $hash\n";
echo "Neighbors: " . json_encode($neighbors) . "\n";

```

The result is

```
Hash:
Neighbors: {"North":"dhx4be2","East":"dhx4be1","South":"dhx4bdb","West":"dhx4b7p","NorthEast":"dhx4be3","SouthEast":"dhx4bdc","SouthWest":"dhx4b6z","NorthWest":"dhx4b7r"}

```

Running the unit tests
----------------------

[](#running-the-unit-tests)

Go to this directory from your project folder

```
$ cd vendor/saikiran/geohash

```

Then run these two commands

```
$ composer install
$ vendor/bin/phpunit tests

```

See these resources online:
---------------------------

[](#see-these-resources-online)

-
-

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~318 days

Total

4

Last Release

2123d ago

Major Versions

v0.9 → v1.0.02019-08-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db8597e2846dfd7a49fb54c6790e1efd1f0f21f00c60f84db0f46cef8cf86d1?d=identicon)[saikiran](/maintainers/saikiran)

---

Top Contributors

[![skthon](https://avatars.githubusercontent.com/u/16775059?v=4)](https://github.com/skthon "skthon (23 commits)")[![brasizza](https://avatars.githubusercontent.com/u/26041910?v=4)](https://github.com/brasizza "brasizza (1 commits)")[![craastad](https://avatars.githubusercontent.com/u/431915?v=4)](https://github.com/craastad "craastad (1 commits)")

---

Tags

coordinates-to-stringencode-stringsgeohash-algorithmgeohashesgeohashingphpphpgeohash

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saikiran-geohash/health.svg)

```
[![Health](https://phpackages.com/badges/saikiran-geohash/health.svg)](https://phpackages.com/packages/saikiran-geohash)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)[camcima/php-geohash

Refactored GeoHash package

1074.0k](/packages/camcima-php-geohash)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
