资源简介

php 实现搜索附近的人功能(laravel+geohash)

资源截图

代码片段和文件信息


/**
 * Geohash generation class for php 
 */
/**
 *
 * Encode and decode geohashes
 *
 * Find neighbors
 *
 */
class Geohash
{
    private $bitss = [16 8 4 2 1];
    private $neighbors = [];
    private $borders = [];
    
    private $coding = “0123456789bcdefghjkmnpqrstuvwxyz“;
    private $codingMap = [];
    
    public function __construct()
    {
    
        $this->neighbors[‘right‘][‘even‘] = ‘bc01fg45238967deuvhjyznpkmstqrwx‘;
        $this->neighbors[‘left‘][‘even‘] = ‘238967debc01fg45kmstqrwxuvhjyznp‘;
        $this->neighbors[‘top‘][‘even‘] = ‘p0r21436x8zb9dcf5h7kjnmqesgutwvy‘;
        $this->neighbors[‘bottom‘][‘even‘] = ‘14365h7k9dcfesgujnmqp0r2twvyx8zb‘;
    
        $this->borders[‘right‘][‘even‘] = ‘bcfguvyz‘;
        $this->borders[‘left‘][‘even‘] = ‘0145hjnp‘;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-09-15 02:09  laravel_geohash-master\
     文件         378  2015-09-15 02:09  laravel_geohash-master\.gitattributes
     文件         574  2015-09-15 02:09  laravel_geohash-master\.gitignore
     文件        8470  2015-09-15 02:09  laravel_geohash-master\GeoHash.php
     文件        1847  2015-09-15 02:09  laravel_geohash-master\README.md

评论

共有 条评论