2017 © Pedro Peláez
 

yii2-extension yii2-geohash

geohash like python-geohash

image

sotechn/yii2-geohash

geohash like python-geohash

  • Thursday, February 9, 2017
  • by sotechn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 55 % Grown

The README.md

Yii-2 Geohash

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 https://en.wikipedia.org/wiki/Geohash, (*1)

Getting Started

Install

composer require sotechn/yii2-geohash

or add your composer.json, (*2)

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

System Requirements

You need PHP >= 5.4.0, Yii ~ 2.0.4, (*3)

Usage

in your config file, (*4)

/congig/web.php

added component:, (*5)

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

after you've added it, you can use it, (*6)

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

and you can also use behavior with model, (*7)

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:, (*8)

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

The Versions

09/02 2017

dev-master

9999999-dev http://github.com/sotechn/yii2-geohash

geohash like python-geohash

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii 2 geohash sotechn

09/02 2017

0.1.3

0.1.3.0 http://github.com/sotechn/yii2-geohash

geohash like python-geohash

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii 2 geohash sotechn

08/02 2017

0.1.2

0.1.2.0 http://github.com/sotechn/yii2-geohash

geohash like python-geohash

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii 2 geohash sotechn

08/02 2017

0.1.1

0.1.1.0 http://github.com/sotechn/yii2-geohash

geohash like python-geohash

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii 2 geohash sotechn

08/02 2017

0.1.0

0.1.0.0 http://github.com/sotechn/yii2-geohash

geohash like python-geohash

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii 2 geohash sotechn