PHPackages                             luoyy/spatial - 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. luoyy/spatial

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

luoyy/spatial
=============

php coordinate calculation component

v3.0.4(5mo ago)0223PHPPHP &gt;=8.1.0

Since Aug 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/zishang520/spatial)[ Packagist](https://packagist.org/packages/luoyy/spatial)[ RSS](/packages/luoyy-spatial/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (50)Used By (0)

坐标相关的组件
=======

[](#坐标相关的组件)

### 安装包

[](#安装包)

```
composer require luoyy/spatial
```

### Quick Sample Usage

[](#quick-sample-usage)

```
/**
 * DEMO
 */
use luoyy\Spatial\Spatial;
use luoyy\Spatial\Support\LineString;
use luoyy\Spatial\Support\PointWGS84; // WGS84
use luoyy\Spatial\Support\Polygon;
use luoyy\Spatial\Transform;
use luoyy\Spatial\Enums\CoordinateSystemEnum;

var_dump(Transform::transform(new PointWGS84([180, 90]), CoordinateSystemEnum::GCJ02));
var_dump((new PointWGS84([180, 90]))->transform(CoordinateSystemEnum::GCJ02));
var_dump(Spatial::ringArea(new Polygon([[new PointWGS84([116.169465, 39.932670]), new PointWGS84([116.160260, 39.924492]), new PointWGS84([116.150625, 39.710019]), new PointWGS84([116.183198, 39.709920]), new PointWGS84([116.226950, 39.777616]), new PointWGS84([116.442621, 39.799892]), new PointWGS84([116.463478, 39.790066]), new PointWGS84([116.588276, 39.809551]), new PointWGS84([116.536091, 39.808859]), new PointWGS84([116.573856, 39.839643]), new PointWGS84([116.706380, 39.916740]), new PointWGS84([116.600293, 39.937770]), new PointWGS84([116.514805, 39.982375]), new PointWGS84([116.499935, 40.013710]), new PointWGS84([116.546520, 40.030443]), new PointWGS84([116.687668, 40.129961]), new PointWGS84([116.539697, 40.080659]), new PointWGS84([116.503390, 40.058474]), new PointWGS84([116.468800, 40.052578]), new PointWGS84([116.169465, 39.932670])]])));
var_dump(Spatial::distance(new PointWGS84([116.169465, 39.932670]), new PointWGS84([116.160260, 39.924492])));
var_dump(Spatial::lineDistance(new LineString([new PointWGS84([116.169465, 39.932670]), new PointWGS84([116.160260, 39.924492]), new PointWGS84([116.150625, 39.710019]), new PointWGS84([116.183198, 39.709920]), new PointWGS84([116.226950, 39.777616]), new PointWGS84([116.442621, 39.799892]), new PointWGS84([116.463478, 39.790066]), new PointWGS84([116.588276, 39.809551]), new PointWGS84([116.536091, 39.808859]), new PointWGS84([116.573856, 39.839643]), new PointWGS84([116.706380, 39.916740]), new PointWGS84([116.600293, 39.937770]), new PointWGS84([116.514805, 39.982375]), new PointWGS84([116.499935, 40.013710]), new PointWGS84([116.546520, 40.030443]), new PointWGS84([116.687668, 40.129961]), new PointWGS84([116.539697, 40.080659]), new PointWGS84([116.503390, 40.058474]), new PointWGS84([116.468800, 40.052578])])));
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance69

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

Established project with proven stability

 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

Every ~32 days

Recently: every ~48 days

Total

49

Last Release

178d ago

Major Versions

v1.2.2 → v2.0.42022-02-09

v1.2.5 → v2.2.02022-12-30

v1.2.6 → v2.2.32023-02-07

v1.x-dev → v2.3.12023-02-24

v2.x-dev → v3.0.02025-05-13

PHP version history (2 changes)v1.0.1PHP &gt;=7.2.0

v2.0.0PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b266931525b76005d393e4a9cd7f213899fc648af18c1c8e48d5768e5ee68513?d=identicon)[luoyy](/maintainers/luoyy)

---

Top Contributors

[![zishang520](https://avatars.githubusercontent.com/u/10894778?v=4)](https://github.com/zishang520 "zishang520 (54 commits)")

---

Tags

laravellumenspatialgpsphp-spatial

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/luoyy-spatial/health.svg)

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

###  Alternatives

[artesaos/seotools

SEO Tools for Laravel and Lumen

3.3k5.1M60](/packages/artesaos-seotools)[ans-group/laravel-health-check

A package for checking the health of your Laravel/Lumen applications.

167930.0k2](/packages/ans-group-laravel-health-check)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)[laracrafts/laravel-url-shortener

Powerful URL shortening tools in Laravel

97110.7k](/packages/laracrafts-laravel-url-shortener)[proai/lumen-annotations

Route and event binding annotations for Laravel Lumen

1012.4k](/packages/proai-lumen-annotations)

PHPackages © 2026

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