cdekok/geo
Composer 安装命令:
composer require cdekok/geo
包简介
Geohash library port of ngeohash
关键字:
README 文档
README
PHP implementation for encoding / decoding geohashes
Usage
use Cdekok\Geo\Geohash; // Encode $hash = (new Geohash)->encode($lat, $lon); // Decode $location = (new Geohash)->decode($hash); echo $location['latitude'] . "\n"; echo $location['longitude'] . "\n"; // Decode bounding box $bb = (new Geohash)->deodeBbox($hash); echo 'Min latitude: ' . $bb[0] . "\n"; echo 'Min longitude: ' . $bb[1] . "\n"; echo 'Max latitude: ' . $bb[2] . "\n"; echo 'Max longitude: ' . $bb[3] . "\n"; // Find neighbour hash $north = (new Geohash)->neighbour($hash, Geohash::DIRECTION_NORTH); // Find all geohashes within a bounding box $minLat = -90; $minLon = -180; $maxLat = 90; $maxLon = 180; $length = 1; $hashes = (new Geohash)->bboxes($minLat, $minLon, $maxLat, $maxLon, $length); print_r($hashes); [ '0', '1', '4', ...
Credits
PHP port of ngeohash
统计信息
- 总下载量: 158
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-16