PHPackages                             hcg/get-mbr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hcg/get-mbr

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hcg/get-mbr
===========

根据经纬度,获取'MBR'数据

v1.0.0(4y ago)05MITPHPPHP &gt;=7.0

Since Dec 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/just5325/GetMbr)[ Packagist](https://packagist.org/packages/hcg/get-mbr)[ RSS](/packages/hcg-get-mbr/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

GetMbr
======

[](#getmbr)

根据经纬度,获取'MBR'数据

说明:
---

[](#说明)

> 这个根据一个经纬度坐标、距离然后求另外一个经纬度坐标的作用， 主要就是确定一个最小外包矩形(Minimum bounding rectangle，简称MBR)。
>
> 这个矩形是包含5公里范围内所有这些有效信息的一个最小矩形。 利用公式，求出四个方向0度、90度、180度、270度方向上的四个坐标点就可以得到这个MBR。
>
> 例如，我要找一个坐标点(lat,lon)的5公里范围内的所有商户信息、景点信息等。 这个MBR就是一个经纬度范围值，包含了最大经度，最小经度，最大纬度，最小纬度。
>
> 如果表里存有100万条数据，数据包含一个lat、lon的经纬度信息。 就可以先根据输入的经纬度和距离得到一个MBR，然后通过类似已下的SQL进行距离筛选了

### 安装

[](#安装)

```
composer require hcg/get-mbr

```

使用示例
----

[](#使用示例)

```
require_once './vendor/autoload.php';

use Hcg\GetMbr\GetMbr as GetMbr;

# 获取经纬度104.031252,30.710894，半径为10公里的'MBR'数据
# 返回数组，其中包含字段：
# MaxLatitude：最大经度
# MinLatitude：最小经度
# MaxLongitude：最大纬度
# MinLongitude：最大纬度
$gpsdis = (new Getmbr)->Main(104.031252,30.710894,10);

# 根据经纬度，计算2个点之间的距离。
# 返回距离（单位公里、千米）
$distance = (new Getmbr)->Distance(104.031252, 30.710894, 103.863918,30.447486);

```

示例程序输出：

```
# $gpsdis变量的结果
array(4) {
  ["MaxLatitude"]=>
  float(104.12115880154)
  ["MinLatitude"]=>
  float(103.94134519846)
  ["MaxLongitude"]=>
  float(30.34006953811)
  ["MinLongitude"]=>
  float(31.08171846189)
}
# $distance变量的结果
float(19.900953356431)

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1602d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/383f2f33430cfe8c055049f97cf3b095eae355b85c08e5c4c2db73665091cb34?d=identicon)[hcg](/maintainers/hcg)

---

Top Contributors

[![just5325](https://avatars.githubusercontent.com/u/26363339?v=4)](https://github.com/just5325 "just5325 (3 commits)")

### Embed Badge

![Health badge](/badges/hcg-get-mbr/health.svg)

```
[![Health](https://phpackages.com/badges/hcg-get-mbr/health.svg)](https://phpackages.com/packages/hcg-get-mbr)
```

###  Alternatives

[jaeger/querylist

Simple, elegant, extensible PHP Web Scraper (crawler/spider),Use the css3 dom selector,Based on phpQuery! 简洁、优雅、可扩展的PHP采集工具(爬虫)，基于phpQuery。

2.7k641.7k86](/packages/jaeger-querylist)[smile/module-store-locator

Smile Store Locator

51516.6k4](/packages/smile-module-store-locator)[gpslab/base64uid

Generate UID like YouTube

68103.4k](/packages/gpslab-base64uid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
