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

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

bogdaan/open-location-code
==========================

Open location code for php

1076.5k↑25.5%3[1 issues](https://github.com/Bogdaan/open-location-code/issues)PHP

Since Feb 3Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)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

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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/380017420e1a00065cfcd2909d20bb285129d73cd128cacc07045968f10513d3?d=identicon)[Bogdan](/maintainers/Bogdan)

---

Top Contributors

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

---

Tags

geogeolocationnavigationphp

### Embed Badge

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

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

###  Alternatives

[bcc/auto-mapper-bundle

An object to object mapper bundle for Symfony2

63442.7k](/packages/bcc-auto-mapper-bundle)[fgits/carbon-german-holidays

Carbon extension with support for German Holidays

1252.4k](/packages/fgits-carbon-german-holidays)

PHPackages © 2026

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