PHPackages                             salavert/open-location-code - 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. salavert/open-location-code

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

salavert/open-location-code
===========================

PHP port of Google Open Location Codes.

v1.0(11y ago)58.1k4[1 issues](https://github.com/salavert/open-location-code/issues)[1 PRs](https://github.com/salavert/open-location-code/pulls)Apache License Version 2.0PHPPHP &gt;=5.3.0

Since May 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/salavert/open-location-code)[ Packagist](https://packagist.org/packages/salavert/open-location-code)[ Docs](http://github.com/salavert/open-location-code)[ RSS](/packages/salavert-open-location-code/feed)WikiDiscussions master Synced 1w ago

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

Open Location Codes
===================

[](#open-location-codes)

[![Build Status](https://camo.githubusercontent.com/32007465ca6cf66facb6268132fd4f5d7f8eec7e8040f2fafb617d3e9c668f36/68747470733a2f2f7472617669732d63692e6f72672f73616c61766572742f6f70656e2d6c6f636174696f6e2d636f64652e737667)](https://travis-ci.org/salavert/open-location-code)

PHP port of Google Open Location Codes.

Open Location Codes are short, generated codes that can be used like street addresses, for places where street addresses don't exist.

Open Location Codes were developed at Google's Zurich engineering office, and then open sourced so that they can be freely used.

Usage
-----

[](#usage)

Encode latitude and longitude to obtain a code

```
$latitude = 51.3701125;
$longitude = -1.217765625;
$olc = new OpenLocationCodes();
$openLocationCode = $olc->encode($latitude, $longitude); // Will return 9C3W9QCJ+2V
```

Installation
------------

[](#installation)

Update your composer.json

```
"require": {
	"salavert/open-location-code": "1.*"
}
```

or use composer's require command:

```
composer require salavert/open-location-code:1.*

```

Original code by Google
-----------------------

[](#original-code-by-google)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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

4127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3597293aa4649719564dd4ed2a600edec825300b511d38f5453b1d0526d160b6?d=identicon)[Salavert](/maintainers/Salavert)

---

Top Contributors

[![salavert](https://avatars.githubusercontent.com/u/216846?v=4)](https://github.com/salavert "salavert (22 commits)")[![kamicup](https://avatars.githubusercontent.com/u/4792883?v=4)](https://github.com/kamicup "kamicup (1 commits)")

---

Tags

locationopen location codesphp open location codesopen locationlocation codes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/salavert-open-location-code/health.svg)

```
[![Health](https://phpackages.com/badges/salavert-open-location-code/health.svg)](https://phpackages.com/packages/salavert-open-location-code)
```

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k15.7M104](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.9M97](/packages/stevebauman-location)[spatie/geocoder

Geocoding addresses to coordinates

8585.3M23](/packages/spatie-geocoder)[zoujingli/ip2region

PHP IP 地理位置查询库，基于 ip2region XDB，支持 IPv4/IPv6、内置 IPv4 数据库、IPv6 按需下载和多种缓存策略

1.4k491.4k71](/packages/zoujingli-ip2region)[kigkonsult/icalcreator

iCalcreator is the PHP implementation of rfc2445/rfc5545 and rfc updates, management of calendar information

2472.9M23](/packages/kigkonsult-icalcreator)[zhuzhichao/ip-location-zh

get the ip's location info with Chinese

616218.8k17](/packages/zhuzhichao-ip-location-zh)

PHPackages © 2026

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