cobak78/geohash

一个用于获取一些有趣数据的地理哈希类

0.1.1 2017-03-22 16:35 UTC

This package is not auto-updated.

Last update: 2024-09-20 20:26:21 UTC


README

Scrutinizer Code Quality Code Coverage Build Status Code Climate

geohash

一个用于获取一些有用数据的地理哈希库

通过composer安装

composer require cobak78/geohash

Docker

Geohash包含一个带有已安装测试依赖的基本镜像。使用docker-compose文件启动一个带有挂载应用代码的fpm容器。

用法

使用库来获取

1. Distance between two geo-located points in Km, Miles and Nautic miles:
    - pass _lat, lon, lat, lon_ and _unit_ parameters to function.
    
2. Minimum geohash precision for a given geoBound array and the number of squares you want to divide it.
    - pass an array like _[ top_left => [ lat => x, lon => y ], bottom_right => [ lat => x, lon => y ]_.
    - pass the number of squares, it has to be multiple of two.
    - Function will return the minimal geohash precision (from 1 to 12) who can contain every square.