2017 © Pedro Peláez
 

library geohash

Geohash library for php

image

cevin/geohash

Geohash library for php

  • Tuesday, March 6, 2018
  • by cevin
  • Repository
  • 1 Watchers
  • 13 Stars
  • 365 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 9 % Grown

The README.md

geohash

What's GeoHash

LINK: http://en.wikipedia.org/wiki/Geohash, (*1)

Usage

use Cevin\Geohash;

$length = 6;

$geohash = new Geohash();

$hash = substr($geohash->encode('latitude','longitude'), 0, $length);

$box = $geohash->neighbors($hash);

$box[] = $hash;

$in_str = "'".implode("','", $box)."'";

// PHP
// $sql = "SELECT FROM `table` WHERE LEFT(geohash, {$length}) IN ($in_str)";
// echo $sql;

// OUTPUT
// SELECT FROM `table` WHERE LEFT(geohash, 6) IN ('xxxxxx','aaaaaa', ......)

License

Anti-996 License, (*2)

The Versions

06/03 2018

dev-master

9999999-dev https://github.com/cevin/geohash

Geohash library for php

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

geocoding geohash

21/11 2016

1.0

1.0.0.0 https://github.com/cevin/geohash

Geohash library for php

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

geohash