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

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sotechn/yii2-geohash
====================

geohash like python-geohash

0.1.3(9y ago)0106BSD-3-ClausePHP

Since Feb 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sotechn/yii2-geohash)[ Packagist](https://packagist.org/packages/sotechn/yii2-geohash)[ Docs](http://github.com/sotechn/yii2-geohash)[ RSS](/packages/sotechn-yii2-geohash/feed)WikiDiscussions master Synced 3w ago

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

Yii-2 Geohash
=============

[](#yii-2-geohash)

Description
-----------

[](#description)

Generate geohash, it is a hierarchical spatial data structure which subdivides space into buckets of grid shape, which is one of the many applications of what is known as a Z-order curve, and generally space-filling curves. See more

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

[](#getting-started)

### Install

[](#install)

```
composer require sotechn/yii2-geohash

```

or add your composer.json

```
"require": {
	...
	"sotechn/yii2-geohash": "~0.1.0"
},

```

### System Requirements

[](#system-requirements)

You need **PHP &gt;= 5.4.0**, **Yii ~ 2.0.4**

### Usage

[](#usage)

in your config file

```
/congig/web.php

```

added component:

```
'components' => [
	...
	'geohash' => [
		'class' => 'sotechn\geohash\Geohash',
	],
]

```

after you've added it, you can use it

```
$hash = Yii::$app->geohash->encode($longitude, $latitude, $prec);

```

and you can also use behavior with model

```
public function behaviors()
{
    return [
		...
		['class' => \sotechn\geohash\behaviors\Geohash::className(),]
    ];
}

```

you can specify their fields to be used and precision that you use in your default project:

```
[
	'class' => \sotechn\geohash\behaviors\Geohash::className(),
	'fieldLng' => 'longitude', // default 'lng'
	'fieldLat' => 'latitude', // default 'ltd'
	'fieldHash' => 'hash', // default 'geohash'
	'defaultPrec' => '0.00000001', // default 0.00001
]

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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 ~0 days

Total

4

Last Release

3425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/219a0e48b55d46145c46d439ba5c6f5fcdc74576c68eca1c9827de6ba5bc3570?d=identicon)[sotechn](/maintainers/sotechn)

---

Tags

yii2yii 2geohashsotechn

### Embed Badge

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

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

###  Alternatives

[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20149.1k11](/packages/softark-yii2-dual-listbox)

PHPackages © 2026

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