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

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

ccinn/geohash
=============

Class libraries implemented using PHP based on GeoHash algorithms.

v1.0(8y ago)115PHP

Since Jan 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/whiteCcinn/geohash)[ Packagist](https://packagist.org/packages/ccinn/geohash)[ RSS](/packages/ccinn-geohash/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

geohash
=======

[](#geohash)

Class libraries implemented using PHP based on GeoHash algorithms.

For details, please refer to the blog （Chinese）:

Usage
-----

[](#usage)

Three API methods are provided.

- `around($lng, $lat, $interceptLength = 0)` Convert the HashCode in the 9 regions of the longitude and latitude.
- `encode($lng, $lat, $interceptLength = 0)` Converts HashCode to the specified latitude and longitude.
- `distance($centerLng, $centerLat, $pointLng, $pointLat, $lenType = 1, $decimal = 2)` Calculate the distance between two latitude and longitude.

example：

```
require_once 'vendor/autoload.php';

// The base hashcode length must be a multiple of 5, otherwise it will automatically be filled to a multiple of 5.
// The longer the base length of hashcode is, the more options are available to intercept, and the longer it is recommended. 10 is usually enough.
$hashCodeLength = 10;

$geohash = new ccinn\GeoHash($hashCodeLength);

// Search nearby 20 meters
$interceptLength = 8;
$around          = $geohash->around(113.314748, 23.125851, $interceptLength);

var_dump($around, $point = $geohash->encode(113.314851, 23.125839, $interceptLength));

if (in_array($point, $around)) {
    echo 'in_around' . PHP_EOL;
} else {
    echo 'not_in_around' . PHP_EOL;
}

var_dump('distance:' . $geohash->distance(113.314748, 23.125851, 113.314851, 23.125839) . 'm');
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3026d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69c5499d6c0cfaf088d63b3f9cb7ccff477dbd76c3d38536d78c6e960d7b4fc6?d=identicon)[ccinn](/maintainers/ccinn)

---

Top Contributors

[![whiteCcinn](https://avatars.githubusercontent.com/u/13690966?v=4)](https://github.com/whiteCcinn "whiteCcinn (9 commits)")

### Embed Badge

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

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

###  Alternatives

[youwe/workflow-gui

Workflow Configuration UI for Pimcore

2884.6k](/packages/youwe-workflow-gui)[edofre/yii2-fullcalendar

Yii2 widget for fullcalendar

2761.7k1](/packages/edofre-yii2-fullcalendar)[scottybo/laravel-facebook-sdk

Fully unit tested Facebook SDK v5 integration for Laravel 7.x

2225.0k](/packages/scottybo-laravel-facebook-sdk)[deha-soft/jp-string-helper

String helper for japanese

531.3k](/packages/deha-soft-jp-string-helper)

PHPackages © 2026

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