Geohash class
- author Antoine Corcy
CloneableInstantiable
Constants |
public League |
public League |
public League |
public League |
public League |
public League |
public League |
public League |
public League The maximum length of the geo hash.
|
public League The minimum length of the geo hash.
|
Methods |
public decode( $geohash) : League |
public encode(League
|
public getBoundingBox() : array Returns the bounding box which is an array of coordinates (SouthWest & NorthEast).
|
public getCoordinate() Returns the decoded coordinate (The center of the bounding box).
|
public getGeohash() : string Returns the geo hash.
|
public getNeighbor(string $direction) : string Returns the code of the adjacent area
|
public getNeighbors(bool $includingCornerNeighbors = false) : array Returns neighboring area codes
|
Properties |
protected $base32Chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] The array of chars in base 32.
|
protected $bits = [16, 8, 4, 2, 1] The interval of bits.
|
protected $geohash = '' The geo hash.
|
protected $latitudeInterval = [-90, 90] The interval of latitudes in degrees.
|
protected $longitudeInterval = [-180, 180] The interval of longitudes in degrees.
|
Methods |
protected calculateAdjacent(string $geohash, string $direction) : string |
Properties |
private $borders = ['north' => ['even' => 'prxz', 'odd' => 'bcfguvyz'], 'south' => ['even' => '028b', 'odd' => '0145hjnp'], 'west' => ['even' => '0145hjnp', 'odd' => '028b'], 'east' => ['even' => 'bcfguvyz', 'odd' => 'prxz']] |
private $neighbors = ['north' => ['even' => 'p0r21436x8zb9dcf5h7kjnmqesgutwvy', 'odd' => 'bc01fg45238967deuvhjyznpkmstqrwx'], 'south' => ['even' => '14365h7k9dcfesgujnmqp0r2twvyx8zb', 'odd' => '238967debc01fg45kmstqrwxuvhjyznp'], 'west' => ['even' => '238967debc01fg45kmstqrwxuvhjyznp', 'odd' => '14365h7k9dcfesgujnmqp0r2twvyx8zb'], 'east' => ['even' => 'bc01fg45238967deuvhjyznpkmstqrwx', 'odd' => 'p0r21436x8zb9dcf5h7kjnmqesgutwvy']] |