PHPackages                             perfect/geo-county - 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. perfect/geo-county

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

perfect/geo-county
==================

通过经纬度查找中国县级行政区划编码。

v1.2(6mo ago)014↓92.9%MITPHPPHP &gt;=7.4

Since Dec 30Pushed 6mo agoCompare

[ Source](https://github.com/2233466866/geo-county)[ Packagist](https://packagist.org/packages/perfect/geo-county)[ Docs](https://github.com/2233466866/geo-county)[ RSS](/packages/perfect-geo-county/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

GeoJSON 行政区划编码查找器
=================

[](#geojson-行政区划编码查找器)

根据经纬度查找中国县级行政区划编码的PHP库。

技术支持
----

[](#技术支持)

安装
--

[](#安装)

使用 Composer 安装：

```
composer require perfect/geo-county
```

使用方法
----

[](#使用方法)

### 基本用法

[](#基本用法)

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

use GeojsonLookup\CountyLocator;

// 初始化查找器（需要 GeoJSON 文件路径）
$locator = new CountyLocator('path/to/your/geojson.json');

// 获取行政区划编码
$gbCode = $locator->getGbCode(115.008321, 30.407552);
// 返回: "156420704"

// 获取完整行政区划信息
$info = $locator->getCountyInfo(115.008321, 30.407552);
// 返回: ['name' => '鄂城区', 'gb' => '156420704']

// 批量查找
$coordinates = [
    ['lng' => 115.008321, 'lat' => 30.407552],
    ['lng' => 107.2514, 'lat' => 26.795673],
];
$results = $locator->batchGetGbCodes($coordinates);
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance68

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

184d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17674930?v=4)[JaneEyer](/maintainers/2233466866)[@2233466866](https://github.com/2233466866)

---

Top Contributors

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

---

Tags

coordinatesgeojsonChinaadministrative divisiongb code

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/perfect-geo-county/health.svg)

```
[![Health](https://phpackages.com/badges/perfect-geo-county/health.svg)](https://phpackages.com/packages/perfect-geo-county)
```

###  Alternatives

[jmikola/geojson

GeoJSON implementation for PHP

3069.6M90](/packages/jmikola-geojson)[proj4php/proj4php

A PHP-Class for geographic coordinates transformation using proj4 definitions, thanks to a translation from Proj4JS

1351.9M26](/packages/proj4php-proj4php)[georgique/world-geojson

GeoJson for all the countries, areas (regions) and some states.

4976.0k](/packages/georgique-world-geojson)[medz/gb-t-2260

中华人民共和国国家标准 GB/T 2260 行政区划代码

10764.2k5](/packages/medz-gb-t-2260)[data-values/geo

Geographical value objects, parsers and formatters

20654.5k22](/packages/data-values-geo)[alicfeng/identity-card

IdentityCard Library

1238.7k](/packages/alicfeng-identity-card)

PHPackages © 2026

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