PHPackages                             janfish/lbs - 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. janfish/lbs

ActiveLibrary

janfish/lbs
===========

lbs

07PHP

Since Oct 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/zeng444/lbs)[ Packagist](https://packagist.org/packages/janfish/lbs)[ RSS](/packages/janfish-lbs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

### LBS

[](#lbs)

#### Generate coordinate

[](#generate-coordinate)

```

use Janfish\LBS\Util\Tool;

list($lng, $lat) = Tool::generateCoordinate();
list($lng2, $lat2) = Tool::generateCoordinate();

```

#### Distance

[](#distance)

- Vincenty

```
use Janfish\LBS\LBSFactory;
use Janfish\LBS\Constant\Math;

LBSFactory::getDistance($lng, $lat, $lng2, $lat2, Math::VINCENTY_DISTANCE);

```

- Haversine

```
use Janfish\LBS\LBSFactory;
use Janfish\LBS\Constant\Math;

LBSFactory::getDistance($lng, $lat, $lng2, $lat2, Math::HAVERSINE_DISTANCE);

```

#### Angle

[](#angle)

```
use Janfish\LBS\LBSFactory;

LBSFactory::getAngle($lng, $lat, $lng2, $lat2);

```

#### Transform

[](#transform)

```
use Janfish\LBS\LBSFactory;
use Janfish\LBS\Constant\Earth;

$LBSFactory = new LBSFactory();
list($lng, $lat) = [103.980831, 30.584515];
list($lng, $lat) = $LBSFactory->transform($lng, $lat, Earth::WGS84_COORDINATE_STANDER, Earth::GCJ02_COORDINATE_STANDER);
list($lng, $lat) = $LBSFactory->transform($lng, $lat, Earth::GCJ02_COORDINATE_STANDER, Earth::WGS84_COORDINATE_STANDER);

```

#### Geohash

[](#geohash)

```
use Janfish\LBS\LBSFactory;

LBSFactory::getGeoHash($lng, $lat, 16);

```

#### Geohash neighbors

[](#geohash-neighbors)

- neighbors

```
use Janfish\LBS\LBSFactory;

(LBSFactory::getGeoHashNeighbor($geoHash))->getSurround();

```

- Specified direction

```
use Janfish\LBS\LBSFactory;

(LBSFactory::getGeoHashNeighbor($hash))->getNouth();
(LBSFactory::getGeoHashNeighbor($hash))->getEast();
(LBSFactory::getGeoHashNeighbor($hash))->getWest();
(LBSFactory::getGeoHashNeighbor($hash))->getSouth();

(LBSFactory::getGeoHashNeighbor($hash))->getNorthEast();
(LBSFactory::getGeoHashNeighbor($hash))->getNorthWest();
(LBSFactory::getGeoHashNeighbor($hash))->getSouthEast();
(LBSFactory::getGeoHashNeighbor($hash))->getSouthWest();

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/60a62fd9f299f25558ac4a898ae3833bd7185ba4706bb167a8cabf05a3d96955?d=identicon)[Robert Zeng](/maintainers/Robert%20Zeng)

---

Top Contributors

[![zeng444](https://avatars.githubusercontent.com/u/941266?v=4)](https://github.com/zeng444 "zeng444 (10 commits)")

### Embed Badge

![Health badge](/badges/janfish-lbs/health.svg)

```
[![Health](https://phpackages.com/badges/janfish-lbs/health.svg)](https://phpackages.com/packages/janfish-lbs)
```

PHPackages © 2026

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