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

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

kotenarok/open-location-code
============================

Open location code for php

v1.0(3y ago)028MITPHPPHP ^8.0.2

Since Feb 20Pushed 3y agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/63989bfef28788ec30d0d59e2f6729777117c7a7ffafaba4bd597cc449ee21f6/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f426f676461616e2f6f70656e2d6c6f636174696f6e2d636f64652e706e67)](http://travis-ci.org/Bogdaan/open-location-code)

Open location code for php
==========================

[](#open-location-code-for-php)

> Open Location Codes are a way of encoding location into a form that is easier to use than latitude and longitude.
>
> They are designed to be used as a replacement for street addresses, especially in places where buildings aren't numbered or &gt; streets aren't named.
>
> Open Location Codes represent an area, not a point. As digits are added to a code, the area shrinks, so a long code is more accurate than a short code.
>
> A location can be converted into a code, and a code can be converted back to a location completely offline.

Based on javascript version from [this repo](https://github.com/google/open-location-code).

Usage
=====

[](#usage)

Install via [composer](http://getcomposer.org):

```
$ composer require bogdaan/open-location-code

```

Examples:

```
use OpenLocationCode\OpenLocationCode;

// encode
var_dump(OpenLocationCode::encode(48.41, 34.81));

// decode (return area array)
var_dump(OpenLocationCode::decode("44870000+"));
```

Method OpenLocationCode::decode returns array with following keys:

- **latitudeLo**, **longitudeLo** - the coordinates of the lower left corner of the square
- **latitudeHi**, **longitudeHi** - the coordinates of the top right corner of the square
- **codeLength** - decoded length

Links
=====

[](#links)

- [OLC format, documentation](https://github.com/google/open-location-code/blob/master/docs/olc_definition.adoc)
- [Demo site](https://plus.codes/)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.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

Every ~0 days

Total

2

Last Release

1184d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/077f153fb389f53a0ac4acddddff852bd0a0d6891d1a2fd0e58f2d5fbb26f46a?d=identicon)[kotenarok](/maintainers/kotenarok)

---

Top Contributors

[![Bogdaan](https://avatars.githubusercontent.com/u/2012115?v=4)](https://github.com/Bogdaan "Bogdaan (12 commits)")[![kotenarok](https://avatars.githubusercontent.com/u/5847857?v=4)](https://github.com/kotenarok "kotenarok (2 commits)")

---

Tags

open-location-codeolcplus.codes

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14481.5k](/packages/opengento-module-gdpr)[kphoen/sitemap-generator

Provides a way to create/generate a sitemap using Propel, Doctrine, etc.

1687.8k4](/packages/kphoen-sitemap-generator)[infinityxtech/filament-unlayer

Filament wrapper for unlayer editor.

272.9k](/packages/infinityxtech-filament-unlayer)

PHPackages © 2026

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