项目作者: taogogo

项目描述 :
a php extension for geohash,geohash is writen in c,very fast to convert geohash and coord.(一个转换经纬度和geohash的PHP扩展)
高级语言: C
项目地址: git://github.com/taogogo/geohash-php-extention.git
创建时间: 2014-01-13T13:42:34Z
项目社区:https://github.com/taogogo/geohash-php-extention

开源协议:

下载


geohash-php-extension

Introduce

geohash is a php extension,it can convert between “longitude and latitude” and “geohash”.

geohash是一个用于转换经纬度和geohash的php扩展。

相似的代码,使用扩展进行转换的速度比使用纯php代码快10倍以上。

Install:

  1. phpize
  2. ./configure
  3. make
  4. make install
  5. echo "extension=geohash.so" >> /etc/php.ini

Example:

Geohash::decode(geohash string);

Geohash::encode(latitude,longtitude);

Geohash::encode(latitude,longtitude,precision=12);

  1. <?php
  2. print_r( Geohash::decode("wm3yr31d2524") );
  3. print_r( Geohash::encode(30.635780068114,104.03160111979,12) );
  4. ?>

output:

  1. Array
  2. (
  3. [latitude] => 30.635780068114
  4. [longitude] => 104.03160111979
  5. )
  6. wm3yr31d2524

contact

e-mail: love(a)taogogo.info

docs

google专利: http://www.google.fr/patents/US20130097163

维基百科: http://en.wikipedia.org/wiki/Geohash