PHPackages                             cdekok/geo - 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. cdekok/geo

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

cdekok/geo
==========

Geohash library port of ngeohash

1.0.1(8y ago)1158MITPHPPHP ^7.0

Since Sep 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/cdekok/geo)[ Packagist](https://packagist.org/packages/cdekok/geo)[ RSS](/packages/cdekok-geo/feed)WikiDiscussions develop Synced 2d ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

Geohash
=======

[](#geohash)

PHP implementation for encoding / decoding geohashes

[![Build Status](https://camo.githubusercontent.com/1490ad2c40a4ba068b172887e8ac7421fbd74e75222dc3a75c5699a7e3173ebf/68747470733a2f2f7472617669732d63692e6f72672f6364656b6f6b2f67656f2e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/cdekok/geo)[![Coverage Status](https://camo.githubusercontent.com/08a5c0f2d4bb17589346000e7b78981f181459d50ee5e497e4ad4bc461b123c7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6364656b6f6b2f67656f2f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/cdekok/geo?branch=develop)

Usage
-----

[](#usage)

```
use Cdekok\Geo\Geohash;

// Encode
$hash = (new Geohash)->encode($lat, $lon);

// Decode
$location = (new Geohash)->decode($hash);
echo $location['latitude'] . "\n";
echo $location['longitude'] . "\n";

// Decode bounding box
$bb = (new Geohash)->deodeBbox($hash);
echo 'Min latitude: ' . $bb[0] . "\n";
echo 'Min longitude: ' . $bb[1] . "\n";
echo 'Max latitude: ' . $bb[2] . "\n";
echo 'Max longitude: ' . $bb[3] . "\n";

// Find neighbour hash
$north = (new Geohash)->neighbour($hash, Geohash::DIRECTION_NORTH);

// Find all geohashes within a bounding box
$minLat = -90;
$minLon = -180;
$maxLat = 90;
$maxLon = 180;
$length = 1;
$hashes = (new Geohash)->bboxes($minLat, $minLon, $maxLat, $maxLon, $length);
print_r($hashes);
[
    '0',
    '1',
    '4',
    ...
```

Credits
-------

[](#credits)

PHP port of [ngeohash](https://github.com/sunng87/node-geohash)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Every ~11 days

Total

2

Last Release

3150d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbeaa436738692ddf6e27586aca3cac18d803896b5b763885efcc1c334e75119?d=identicon)[mech7](/maintainers/mech7)

---

Top Contributors

[![cdekok](https://avatars.githubusercontent.com/u/190633?v=4)](https://github.com/cdekok "cdekok (18 commits)")

---

Tags

geogeohashngeohash

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cdekok-geo/health.svg)

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

###  Alternatives

[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k8.6M22](/packages/mjaschen-phpgeo)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[jmikola/geojson

GeoJSON implementation for PHP

3109.0M77](/packages/jmikola-geojson)[geokit/geokit

Geo-Toolkit for PHP

251924.7k6](/packages/geokit-geokit)[brick/geo

GIS geometry library

245862.1k15](/packages/brick-geo)[geo-io/interface

Geo I/O base interfaces.

626.1M7](/packages/geo-io-interface)

PHPackages © 2026

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