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

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

beste/latlon-geohash
====================

Gustavo Niemeyer's geocoding system

1.5.0(5mo ago)1059.7k↓72.7%2[1 PRs](https://github.com/beste/latlon-geohash-php/pulls)MITPHPPHP ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Jan 19Pushed 1w ago1 watchersCompare

[ Source](https://github.com/beste/latlon-geohash-php)[ Packagist](https://packagist.org/packages/beste/latlon-geohash)[ GitHub Sponsors](https://github.com/jeromegamez)[ RSS](/packages/beste-latlon-geohash/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (7)Dependencies (5)Versions (10)Used By (0)

Geohash
=======

[](#geohash)

[![Current version](https://camo.githubusercontent.com/32800e64140b067700cf32520701ada6742a8a945a14df0925534e664b6cf94b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62657374652f6c61746c6f6e2d67656f686173682e7376673f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/beste/latlon-geohash)[![Packagist PHP Version Support](https://camo.githubusercontent.com/462c892d51fc48384685c430e8dff1bda8b9e9dc31dd7f7a0b113aff32dd1370/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f62657374652f6c61746c6f6e2d67656f68617368)](https://packagist.org/packages/beste/latlon-geohash)[![Tests](https://github.com/beste/latlon-geohash-php/actions/workflows/tests.yml/badge.svg)](https://github.com/beste/latlon-geohash-php/actions/workflows/tests.yml)[![Sponsor](https://camo.githubusercontent.com/1004a94551d1edaf2a6da4d45ba217b79a46eb18dd7dd2d7825add0a2a8ddc4f/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d476974487562266c6162656c3d53706f6e736f72266d6573736167653d25453225394425413426636f6c6f723d666636396234)](https://github.com/sponsors/jeromegamez)

Library to convert a [geohash](https://en.wikipedia.org/wiki/Geohash) to/from a latitude/longitude point, and to determine bounds of a geohash cell and find neighbours of a geohash.

This is a PHP implementation based on [chrisveness/latlon-geohash](https://github.com/chrisveness/latlon-geohash). More information (with interactive conversion) at [www.movable-type.co.uk/scripts/geohash.html](https://www.movable-type.co.uk/scripts/geohash.html).

Usage
-----

[](#usage)

```
use Beste\Geohash;

// encode latitude/longitude point to geohash of given precision (number of
// characters in resulting geohash); if precision is not specified, it is
// inferred from precision of latitude/longitude values.
Geohash::encode(float $lat, float $lon, ?int $precision = null)

// return { lat, lon } of centre of given geohash, to appropriate precision.
Geohash::decode(string $geohash)

// return { sw, ne } bounds of given geohash.
Geohash::bounds(string $geohash)

// return adjacent cell to given geohash in specified direction (n/s/e/w).
Geohash::adjacent(string $geohash, string $direction)

// return all 8 adjacent cells (n/ne/e/se/s/sw/w/nw) to given geohash.
Geohash::neighbours(string $geohash)
```

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

[](#installation)

```
composer require beste/latlon-geohash
```

Running tests
-------------

[](#running-tests)

```
composer test
```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 58% 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 ~246 days

Recently: every ~277 days

Total

7

Last Release

150d ago

PHP version history (6 changes)1.0.0PHP ~7.4.0 || ~8.0.0 || ~8.1.0

1.1.0PHP ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0

1.2.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

1.3.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

1.4.0PHP ~8.3.0 || ~8.4.0

1.5.0PHP ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8685cf532053a084f1eade7b7da00a512c02676e65f1f1bdec73d4978030a47d?d=identicon)[jeromegamez](/maintainers/jeromegamez)

---

Top Contributors

[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (40 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![vitaly-prostirnet](https://avatars.githubusercontent.com/u/32192787?v=4)](https://github.com/vitaly-prostirnet "vitaly-prostirnet (1 commits)")

---

Tags

geocodinggeohashphpgeocodinggeohash

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[toin0u/geocoder-laravel

Geocoder Service Provider for Laravel

7615.4M17](/packages/toin0u-geocoder-laravel)[willdurand/geocoder

Common files for PHP Geocoder

17437.9M170](/packages/willdurand-geocoder)[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

1961.0M11](/packages/anthonymartin-geo-location)[lvht/geohash

geohash like python-geohash

76604.1k1](/packages/lvht-geohash)[smile/module-store-locator

Smile Store Locator

50533.0k5](/packages/smile-module-store-locator)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)

PHPackages © 2026

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