Skip to content

A php extension for geohash conversion, it's writen in C Language, very fast to convert between geohash and coord.(一个转换经纬度和geohash的PHP扩展) - MIT License

License

Notifications You must be signed in to change notification settings

taogogo/geohash-php-extention

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geohash-php-extension

Introduce

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

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

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

Install:

phpize
./configure 
make
make install
echo "extension=geohash.so" >> /etc/php.ini

Example:

Geohash::decode(geohash string);

Geohash::encode(latitude,longtitude);

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

<?php
print_r( Geohash::decode("wm3yr31d2524") );
print_r( Geohash::encode(30.635780068114,104.03160111979,12) );
?>

output:

Array
(
    [latitude] => 30.635780068114
    [longitude] => 104.03160111979
)

wm3yr31d2524

##contact e-mail: love(a)taogogo.info

##docs

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

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

About

A php extension for geohash conversion, it's writen in C Language, very fast to convert between geohash and coord.(一个转换经纬度和geohash的PHP扩展) - MIT License

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published