PHPackages                             lvht/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. lvht/geohash

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

lvht/geohash
============

geohash like python-geohash

v1.1.0(8y ago)77580.2k↓12.2%26[2 issues](https://github.com/lvht/geohash/issues)1MITPHPPHP &gt;=5.4.0

Since Sep 11Pushed 7y ago3 watchersCompare

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

READMEChangelog (2)DependenciesVersions (4)Used By (1)

GeoHash
=======

[](#geohash)

Simple php geohash class like python-geohash.

Getting Started
---------------

[](#getting-started)

### Install

[](#install)

composer require lvht/geohash

### System Requirements

[](#system-requirements)

You need **PHP &gt;= 5.4.0**.

### Usage

[](#usage)

Encode a coordinate:

```
use Lvht\GeoHash;
echo GeoHash::encode(117.031689,36.65396);

```

The result is wwe0x0euu12.

The default precision is 0.00001 which can be changed by the third parameter of encode method.

Find the neighbors for a given geohash:

```
use Lvht\GeoHash;
var_dump(GeoHash::expand('wwe0x0'));

```

and the result is:

```
array(8) {
  [0] =>
  string(11) "wwe0wc7zzzz"
  [1] =>
  string(11) "wwe0x17zzzz"
  [2] =>
  string(11) "wwe0x37zzzz"
  [3] =>
  string(11) "wwe0wb7zzzz"
  [4] =>
  string(11) "wwe0x27zzzz"
  [5] =>
  string(11) "wwe0qz7zzzz"
  [6] =>
  string(11) "wwe0rp7zzzz"
  [7] =>
  string(11) "wwe0rr7zzzz"
}

```

Decode a geohash string:

```
Use Lvht\GeoHash;
var_dump(GeoHash::decode('wwe0x0'));

```

and the result is:

```
array(4) {
  [0] =>
  double(117.0263671875)    # min longitude
  [1] =>
  double(117.03735351562)   # max longitude
  [2] =>
  double(36.650390625)      # min latitude
  [3] =>
  double(36.655883789062)   # max latitude
}

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~721 days

Total

3

Last Release

3189d ago

Major Versions

v0.1 → v1.0.02016-07-28

PHP version history (2 changes)v0.1PHP &gt;=5.3.0

v1.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/88784a5e09bb664bce6c25a861dcf8207df61c3ac6c13805f33dc126a80e91c7?d=identicon)[lvht](/maintainers/lvht)

---

Top Contributors

[![taoso](https://avatars.githubusercontent.com/u/2030591?v=4)](https://github.com/taoso "taoso (3 commits)")[![1d10t](https://avatars.githubusercontent.com/u/553280?v=4)](https://github.com/1d10t "1d10t (1 commits)")[![thbourlove](https://avatars.githubusercontent.com/u/1768066?v=4)](https://github.com/thbourlove "thbourlove (1 commits)")

---

Tags

geohash

### Embed Badge

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

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

###  Alternatives

[saikiran/geohash

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

44456.6k3](/packages/saikiran-geohash)[laravie/geotools

Geo-related tools PHP 7+ library

19105.4k1](/packages/laravie-geotools)[camcima/php-geohash

Refactored GeoHash package

1074.0k](/packages/camcima-php-geohash)[beste/latlon-geohash

Gustavo Niemeyer's geocoding system

1051.7k](/packages/beste-latlon-geohash)[latrell/geohash

This package geohash for Laravel 5 support.

1128.3k](/packages/latrell-geohash)[cevin/geohash

Geohash library for php

192.0k](/packages/cevin-geohash)

PHPackages © 2026

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