{"id":13700164,"url":"https://github.com/shenzhe/geohash","last_synced_at":"2025-05-04T18:34:29.750Z","repository":{"id":14060029,"uuid":"16763067","full_name":"shenzhe/geohash","owner":"shenzhe","description":"php geohash extension","archived":false,"fork":false,"pushed_at":"2018-04-19T04:34:46.000Z","size":18,"stargazers_count":149,"open_issues_count":5,"forks_count":53,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-13T06:33:08.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"thinkcmf/hbuilder","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shenzhe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-12T10:04:54.000Z","updated_at":"2023-06-23T14:25:54.000Z","dependencies_parsed_at":"2022-08-03T05:01:26.165Z","dependency_job_id":null,"html_url":"https://github.com/shenzhe/geohash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenzhe%2Fgeohash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenzhe%2Fgeohash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenzhe%2Fgeohash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shenzhe%2Fgeohash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shenzhe","download_url":"https://codeload.github.com/shenzhe/geohash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252383020,"owners_count":21739258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T20:00:49.222Z","updated_at":"2025-05-04T18:34:24.709Z","avatar_url":"https://github.com/shenzhe.png","language":"C","funding_links":[],"categories":["地理"],"sub_categories":[],"readme":"geohash\n=======\n\nphp geohash extension  (php geohash 扩展)\n\n\n编译\n======\n\n\tgit clone 到机器\n    \n    执行：\n\tphpize\n\t./configure\n\tmake\n\tmake install\n\n\t然后把 geohash.so 加入到php.ini中\n\t\n\n方法\n====\n\n\t/**\n\t *  $latitude    //纬度\n\t *  $longitude   //经度\n\t *  $precision   //精密度, 默认是12\n\t *  返回 $precision 长度的 string \n\t */\n\tgeohash_encode($latitude, $longitude, $precision=12);  \n\n\n\n\t/**\n\t *  $hash    //geohash_encode后的值\n\t *  返回 array // Array\n\t *\t\t\t\t\t(\n\t *\t\t\t\t\t    [latitude] =\u003e 39.416916975752\n\t *\t\t\t\t\t    [longitude] =\u003e 100.92223992571\n\t *\t\t\t\t\t    [north] =\u003e 39.416917059571\n\t *\t\t\t\t\t    [east] =\u003e 100.92224009335\n\t *\t\t\t\t\t    [south] =\u003e 100.92223992571\n\t *\t\t\t\t\t    [west] =\u003e 100.92223975807\n\t *\t\t\t\t\t)\n\t */\n\tgeohash_decode($hash);\n\n\t/**\n\t *  $hash    //geohash_encode后的值\n\t *  返回 在$hash 8个方向的hash值 （顺序：N, NE, E, SE, S, SW, W, NW）\n\t *  \n\t *\t\t  NW N NE\n\t *\t\t    \\|/\n\t *\t\t  W - - E\n\t *\t\t    /|\\\n\t *\t\t  SW S SE\n\t * \n\t */\n\tgeohash_neighbors($hash);\n\n\t/**\n\t *  $precision    //精密度\n\t *  返回 数组，array(\"width\"=\u003e12.0, \"height\"=\u003e12.0) \n\t *  表示矩形的宽和高\n\t */\n\tgeohash_dimension($precision);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshenzhe%2Fgeohash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshenzhe%2Fgeohash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshenzhe%2Fgeohash/lists"}