Copied!

Geohash class

CloneableInstantiable
Constants
public League\Geotools\Geohash\Geohash::DIRECTION_EAST = 'east'
public League\Geotools\Geohash\Geohash::DIRECTION_NORTH = 'north'
public League\Geotools\Geohash\Geohash::DIRECTION_NORTH_EAST = 'north_east'
public League\Geotools\Geohash\Geohash::DIRECTION_NORTH_WEST = 'north_west'
public League\Geotools\Geohash\Geohash::DIRECTION_SOUTH = 'south'
public League\Geotools\Geohash\Geohash::DIRECTION_SOUTH_EAST = 'south_east'
public League\Geotools\Geohash\Geohash::DIRECTION_SOUTH_WEST = 'south_west'
public League\Geotools\Geohash\Geohash::DIRECTION_WEST = 'west'
public League\Geotools\Geohash\Geohash::MAX_LENGTH = 12
 

The maximum length of the geo hash.

  • var int
public League\Geotools\Geohash\Geohash::MIN_LENGTH = 1
 

The minimum length of the geo hash.

  • var int
Methods
public decode( $geohash) : League\Geotools\Geohash\GeohashInterface
 
    public encode(League\Geotools\Coordinate\CoordinateInterface $coordinate, $length = 12self::MAX_LENGTH) : League\Geotools\Geohash\GeohashInterface
     
    • see http://en.wikipedia.org/wiki/Geohash
    • see http://geohash.org/
    public getBoundingBox() : array
     

    Returns the bounding box which is an array of coordinates (SouthWest & NorthEast).

    • return \CoordinateInterface[]
    public getCoordinate()
     

    Returns the decoded coordinate (The center of the bounding box).

    • return \CoordinateInterface
    public getGeohash() : string
     

    Returns the geo hash.

    • return string
    public getNeighbor(string $direction) : string
     

    Returns the code of the adjacent area

    • param string $direction
    • return string
    public getNeighbors(bool $includingCornerNeighbors = false) : array
     

    Returns neighboring area codes

    • param bool $includingCornerNeighbors
    • return array
    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.

    • var array
    protected $bits = [16, 8, 4, 2, 1]
     

    The interval of bits.

    • var array
    protected $geohash = ''
     

    The geo hash.

    • var string
    protected $latitudeInterval = [-90, 90]
     

    The interval of latitudes in degrees.

    • var array
    protected $longitudeInterval = [-180, 180]
     

    The interval of longitudes in degrees.

    • var array
    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']]
    © 2024 Bruce Wells
    Search Namespaces \ Classes
    Configuration